# AI video, image and audio generation API workflow

Generate video clips, product images, sound effects, and isolated voice tracks across 82 live media-generation operations under one API key.

## Why teams consolidate this workflow

Creative automation pipelines typically maintain separate wallets and webhook parsers across video, image, and audio vendors, risking duplicate charges when long-running renders take 30-120 seconds.

## Implementation sequence

1. **Inspect media model parameters and pricing.** Browse /providers/alibaba, /providers/kling, /providers/elevenlabs, and /providers/minimax, and call POST /apis/v1/inspect at $0.
2. **Submit bounded runs with max_cost_usd.** Execute variable media tools via POST /apis/v1/run with max_cost_usd so unexpected high-duration inputs fail closed at $0.
3. **Poll pending runs without extra fees.** When a video or audio job returns status 'pending' with a run_id, poll GET /apis/v1/runs/{id} or MCP get_run instead of re-submitting.

## Example request

```python
import os
import requests

headers = {"Authorization": f"Bearer {os.environ['KEEPBAL_API_KEY']}"}
spec = requests.post(
    "https://keepbal.com/apis/v1/inspect",
    headers=headers,
    json={"publicId": "kling/video-kling-2-6-t2v"},
    timeout=30,
)
spec.raise_for_status()
print(spec.json())
```

## Pricing and spend controls

Polling GET /apis/v1/runs/{id} settles a completed run once with zero polling fee. Never retry a timed-out media POST before checking its run status.

## Related catalog surfaces

- [Alibaba Wan 2.7 & Qwen Image APIs](/providers/alibaba)
- [Kling Video Generation APIs](/providers/kling)
- [ElevenLabs Audio APIs](/providers/elevenlabs)
- [MiniMax Media APIs](/providers/minimax)
- [Media generation category](/tools/category/media-generation)

## Frequently asked questions

### How do I avoid paying twice on slow video generation tasks?

Record the returned run_id and poll GET /apis/v1/runs/{id} (or MCP get_run). Re-POSTing /apis/v1/run starts a second billable render.

### What happens if a media generation job fails upstream?

Failed, blocked, or provider-error runs settle at $0.

[All use cases](/use-cases) · [Cost calculator](/cost-calculator) · [MCP config generator](/mcp-config)
