Skip to content
Docs menu

API reference

Create a task

On this page

POST /api/v1/generate

Submit a generation. We validate your key, debit credits for the model, forward the request upstream, and return either an inline result (chat) or a task id to poll (media).

FieldTypeDescription
modelIdstringModel id from the Market (e.g. veo-3-1, nano-banana-pro). The alias `model` is also accepted.
inputobjectModel-specific parameters — see each model's page for its fields.
callbackUrlstring?Optional https webhook; we POST the finished task to it (see Webhooks).
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "modelId": "veo-3-1", "input": { "prompt": "a city at dusk", "aspectRatio": "16:9" } }'

Media model response (poll the task id):

json
{ "taskId": "a1b2c3d4e5f6g7h8", "creditsCharged": 312 }

Chat/LLM model response (inline, no polling):

json
{ "text": "…", "creditsCharged": 24 }