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 vapagent.com
- Create an account
- Add funds to your balance
- Generate an API key
📚 Documentation
Full documentation available at api.vapagent.com/docs
🤝 Support
- GitHub Issues: github.com/elestirelbilinc-sketch/vap-showcase
- Email: support@vapagent.com
📄 License
MIT License - see LICENSE for details.
VAP - VAP is where nondeterminism stops. 🎯
Metadata
Release files for vap-sdk 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| vap_sdk-0.2.1.tar.gz | 10.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vap_sdk-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / vap_sdk-0.2.1.tar.gz
| Download URL | vap_sdk-0.2.1.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
789af740bd64b0ba6956139e4880804004bd6d2265a1366507291afab422bdce
|
|
BLAKE2b-256 checksum How to use checksums |
fa400c55ebdd34d28ee7a62574c1577fbb76733e3362af1475516f664e2d8585
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / vap_sdk-0.2.1-py3-none-any.whl
| Download URL | vap_sdk-0.2.1-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57f1e44c7917f73cdf0df53fa5bc38f55b0eef59eae9ba3b5412002d0f005046
|
|
BLAKE2b-256 checksum How to use checksums |
5a67cc44ba77f178fe226603d11b2e2c6cffbffc611a77e9f1e1330de1a7bbc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for vap-sdk 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.