Get started
One key for every model
1
Create a key
One key works for every model. It is shown once, so store it as KORPI_API_KEY.
2
Add funds
One balance pays for video, image and text. Top up from $10; failed generations are refunded.
3
Send a request
Call any model by id. Chat is OpenAI compatible, so existing SDKs work with a new base URL.
Playground
Build a request
Model
Grok Imaginegrok-imagine
Duration
Aspect ratio
Estimated cost
$0.0594
videos/generations
curl -X POST https://backend.korpi.ai/v1/videos/generations \ -H "Authorization: Bearer $KORPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "grok-imagine", "prompt": "Macro shot of a white paper origami crane slowly unfolding its wings on a dark walnut desk, warm desk lamp light, floating dust particles, smooth slow camera push-in, cinematic", "duration": 6, "aspect_ratio": "16:9" }' # Poll until status is completedcurl https://backend.korpi.ai/v1/videos/generations/$ID \ -H "Authorization: Bearer $KORPI_API_KEY"Sample response
Press Preview to see a real response.
Recipes
Every model, same key
OpenAI SDK
Keep your SDK
Point the base URL at Korpi and switch models by id.
https://backend.korpi.ai/v1Chat completions
import osfrom openai import OpenAI client = OpenAI(base_url="https://backend.korpi.ai/v1", api_key=os.environ["KORPI_API_KEY"]) completion = client.chat.completions.create( model="claude-opus-5.5", messages=[{"role": "user", "content": "Hello"}],)print(completion.choices[0].message.content)Agents
Hand it to your agent
Paste into Claude Code, Cursor or Codex
Use the Korpi API (base URL https://backend.korpi.ai/v1) with the key in the KORPI_API_KEY environment variable, sent as "Authorization: Bearer $KORPI_API_KEY".
- Video: POST /videos/generations with {"model":"grok-imagine","prompt":"...","duration":6|8|10,"aspect_ratio":"16:9"|"9:16"|"1:1"} and optional "image_url". It returns 202 with an id; poll GET /videos/generations/{id} every 3 s until status is "completed" or "failed".
- Image: POST /images/generations with {"model":"nano-banana","prompt":"...","aspect_ratio":"1:1"} and up to 4 https "image_urls" as references.
- Text: POST /chat/completions in OpenAI format. GET /models lists every model id.
- Errors are {"error":{"code","message"}}. On 402 insufficient_balance, stop and tell me to add funds.Errors
Every error, explained
400
invalid_requestA field is missing or out of range. The message names it.400
model_not_foundUnknown model id. Call GET /models for the list.401
invalid_api_keyMissing, malformed or revoked key.402
insufficient_balanceAdd funds and retry. Nothing was charged.404
not_foundUnknown endpoint or generation id.503
api_disabledTemporarily unavailable. Retry with backoff.