VAP SDK - Execution control layer for AI agents calling paid APIs
Project description
VAP SDK for Python
Execution control layer for AI agents calling paid APIs.
VAP enforces cost control, retry limits, and execution ownership when your agents call external media APIs. Pre-commit pricing with Reserve → Burn → Refund model. No surprise bills.
🚀 Quick Start
pip install vap-sdk
from vap import VapClient
client = VapClient(api_key="your-api-key")
result = client.execute("streaming_campaign", text="Welcome to the future of AI media!")
print(result.video_url) # Your video is ready!
📋 Features
- Simple API: One method to generate complete media packages
- Preset System: Pre-configured media generation pipelines
- Deposit-Reserve-Burn: Transparent prepaid financial model
- Sync & Async: Both synchronous and asynchronous clients
- Type Safe: Full Pydantic models with IDE autocomplete
- Framework Ready: Built for LangChain, CrewAI, and MCP integration
💰 Preset Pricing
| Preset | Output | Price |
|---|---|---|
streaming_campaign |
Video + Music + Narration | $5.90 |
full_production |
Full Production Package | $7.90 |
video.basic |
Basic Video | $1.96 |
music.basic |
AI Music Track | $0.68 |
image.basic |
AI Generated Image | $0.18 |
📖 Usage Examples
Basic Video Generation
from vap import VapClient
with VapClient(api_key="your-key") as client:
result = client.execute(
"streaming_campaign",
text="Introducing our revolutionary AI product",
style="corporate",
voice="professional_male"
)
print(f"Video: {result.video_url}")
print(f"Cost: ${result.cost}")
Async Usage
import asyncio
from vap import AsyncVapClient
async def generate_video():
async with AsyncVapClient(api_key="your-key") as client:
result = await client.execute(
"video.basic",
text="Hello async world!",
image_prompt="futuristic city skyline"
)
return result.video_url
url = asyncio.run(generate_video())
Check Account Balance
from vap import VapClient
client = VapClient(api_key="your-key")
account = client.get_account()
print(f"Balance: ${account.balance}")
print(f"Tier: {account.tier}")
List Available Presets
from vap import VapClient
client = VapClient(api_key="your-key")
presets = client.list_presets()
for preset in presets:
print(f"{preset.name}: ${preset.price} - {preset.description}")
Error Handling
from vap import VapClient, VapInsufficientFundsError, VapAuthError
client = VapClient(api_key="your-key")
try:
result = client.execute("streaming_campaign", text="My video")
except VapAuthError:
print("Invalid API key")
except VapInsufficientFundsError as e:
print(f"Need ${e.required}, have ${e.available}")
🔗 Framework Integrations
LangChain Tool
from langchain.tools import Tool
from vap import VapClient
client = VapClient(api_key="your-key")
vap_tool = Tool(
name="generate_video",
description="Generate a video from text description",
func=lambda text: client.execute("video.basic", text=text).video_url
)
CrewAI Integration
from crewai import Agent, Tool
from vap import VapClient
client = VapClient(api_key="your-key")
video_tool = Tool(
name="Video Generator",
description="Creates videos from text prompts",
func=lambda prompt: client.execute("streaming_campaign", text=prompt).video_url
)
creative_agent = Agent(
role="Video Producer",
tools=[video_tool]
)
🏗️ API Reference
VapClient
VapClient(
api_key: str, # Your VAP API key
base_url: str = "...", # API base URL (optional)
timeout: float = 300.0 # Request timeout in seconds
)
Methods
| Method | Description |
|---|---|
execute(preset, **params) |
Execute a media generation preset |
get_execution(id) |
Get execution status and result |
get_account() |
Get account balance and info |
list_presets() |
List available presets |
estimate_cost(preset) |
Estimate cost before execution |
VapResult
result.execution_id # Unique execution ID
result.status # pending, processing, completed, failed
result.cost # Actual cost charged
result.video_url # First video output URL
result.audio_url # First audio output URL
result.image_url # First image output URL
result.outputs # List of all outputs
result.is_completed # Check if completed
🔑 Getting an API Key
- Visit vap.studio
- Create an account
- Add funds to your balance
- Generate an API key
📚 Documentation
Full documentation available at docs.vap.studio
🤝 Support
- GitHub Issues: github.com/vap-studio/vap-sdk
- Email: support@vap.studio
- Discord: discord.gg/vap
📄 License
MIT License - see LICENSE for details.
VAP - Give your Agent a Studio 🎬
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vap_sdk-0.2.0.tar.gz.
File metadata
- Download URL: vap_sdk-0.2.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c800841cb841a3d5ba61e2b13de23f940cc43373345e85b7ef1168a3b48f5968
|
|
| MD5 |
a39535e6359ef25040432c71e68a8388
|
|
| BLAKE2b-256 |
257f4ebdf1439fa8324d51d40f15d6c2e24a476abdfa5f5128a11d1909e008da
|
File details
Details for the file vap_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: vap_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ff8acf92ff76a14e4f75aa199e3ea4bc4e8818fe700df6ee574c9f09e63ff8e
|
|
| MD5 |
c71a2b783557a55e4d746b1ea1bbb804
|
|
| BLAKE2b-256 |
f9a1aff260b4eaaf35e56391c33be984d487fbc120ab42aeba2e2cee958d4738
|