The Vixlens API
Generate video and images from your own code — the same models, the same credit balance and the same pipeline as the web app.
API access is included on the Studio plan. See pricing.
1. Authenticate
Create a key in Settings → API Keys. Send it as a bearer token on every request; it acts as your account and spends your credits. Your API base URL and public key are shown on the same page. Each key is limited to 120 requests a minute, and keys can be revoked at any time.
Authorization: Bearer sk_live_...
2. Pricing
API generations cost exactly what they cost in the web app: credits per generation, depending on the model, resolution and duration. Every response includes costCredits. Credit packs sell credits at $0.01 each, and plans for less. Failed generations are refunded automatically.
3. Create a generation
One endpoint per type. The body takes a model id from the table below, a prompt, and that model's own settings (its model page lists them).
curl -X POST "$VIXLENS_API_BASE/generations/text-to-image" \
-H "Authorization: Bearer sk_live_..." \
-H "apikey: $VIXLENS_PUBLIC_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2",
"prompt": "A matte ceramic mug on a wooden table, morning window light",
"size": "1024x1024",
"quality": "medium"
}'HTTP/1.1 201 Created
{
"job_id": "7f3c…",
"estimated_time_seconds": 3,
"status": "pending",
"model": "openai/gpt-image-2",
"costCredits": …,
…
}4. Poll for the result
Generations run asynchronously. Poll the job until its status is completed or failed. Result links are signed and expire, so download the file rather than storing the URL.
curl "$VIXLENS_API_BASE/generations/7f3c…" \
-H "Authorization: Bearer sk_live_..." \
-H "apikey: $VIXLENS_PUBLIC_KEY"
{ "status": "completed", "resultUrl": "https://…", "thumbnailUrl": "https://…", … }Models
Model ids and the endpoint each one uses. Seedance 2.5, Seedance 2.0 and the motion-control models take their own request shapes — ask us for details.
| Model | Id | Type | Endpoint |
|---|---|---|---|
| HappyHorse 1.1 — Live | alibaba/hh1.1-i2v | Image to video | POST /generations/image-to-video |
| Wan 2.7 | alibaba/wan-2.7-i2v | Image to video | POST /generations/image-to-video |
| Kling 2.6 Image | kling/2.6-image | Image to video | POST /generations/image-to-video |
| Kling 2.1 Pro | kling/2.1-pro | Image to video | POST /generations/image-to-video |
| Recraft v4.1 | recraft/recraftv4-1 | Text to image | POST /generations/text-to-image |
| Recraft v4.1 Pro | recraft/recraftv4-1-pro | Text to image | POST /generations/text-to-image |
| Recraft v4.1 Vector | recraft/recraftv4-1-vector | Text to image | POST /generations/text-to-image |
| Lucid Origin | @cf/leonardo/lucid-origin | Text to image | POST /generations/text-to-image |
| Nano Banana 2 Lite | google/nano-banana-2-lite | Text to image | POST /generations/text-to-image |
| Nano Banana Pro | google/nano-banana-pro | Text to image | POST /generations/text-to-image |
| Nano Banana 2.1 | google/nano-banana-2-1 | Text to image | POST /generations/text-to-image |
| GPT Image 2 | openai/gpt-image-2 | Text to image | POST /generations/text-to-image |
| Grok Imagine | xai/grok-imagine-image | Text to image | POST /generations/text-to-image |
| Grok Imagine Quality | xai/grok-imagine-image-quality | Text to image | POST /generations/text-to-image |
| Seedream 5 Pro | bytedance/seedream-5-pro | Text to image | POST /generations/text-to-image |
| Seedream 4.5 | bytedance/seedream-4.5 | Text to image | POST /generations/text-to-image |
| Seedream 5 Lite | bytedance/seedream-5-lite | Text to image | POST /generations/text-to-image |
| Seedance 2.0 Mini | bytedance/seedance-2.0-mini | Text to video | POST /generations/text-to-video |
| Wan 3.0 | alibaba/wan-3.0 | Text to video | POST /generations/text-to-video |
| Flux 3 Video | black-forest-labs/flux-3-video | Text to video | POST /generations/text-to-video |
| Grok Imagine Video | xai/grok-imagine-video | Text to video | POST /generations/text-to-video |
| Grok Imagine Video 1.5 Preview | xai/grok-imagine-video-1.5-preview | Text to video | POST /generations/text-to-video |
| Veo 3.1 | google/veo-3.1 | Text to video | POST /generations/text-to-video |
| Veo 3.1 Fast | google/veo-3.1-fast | Text to video | POST /generations/text-to-video |
| Hailuo 2.3 | minimax/hailuo-2.3 | Text to video | POST /generations/text-to-video |
| H3 Max | minimax/h3-max | Text to video | POST /generations/text-to-video |
| P-Video | pruna/p-video | Text to video | POST /generations/text-to-video |
| Vidu Q3 Pro | vidu/q3-pro | Text to video | POST /generations/text-to-video |
| Vidu Q3 Turbo | vidu/q3-turbo | Text to video | POST /generations/text-to-video |
| Kling 4.0 | kling/4.0 | Text to video | POST /generations/text-to-video |
| Kling 3.0 | kling/3.0 | Text to video | POST /generations/text-to-video |
| Kling 3.0 Omni | kling/3.0-omni | Text to video | POST /generations/text-to-video |
| Kling 3.0 Turbo | kling/3.0-turbo | Text to video | POST /generations/text-to-video |
| Kling 2.6 | kling/2.6 | Text to video | POST /generations/text-to-video |