Getting Started
Everything you need to send your first xbapi request and receive a generated video.
xbapi gives you AI generation models through one task-based API. Requests use a stable response envelope, asynchronous task processing, and automatic refunds when generation fails.
Base URL
https://api.xbaiapi.comThe domain is currently a placeholder. Replace it with the production domain before launch.
Request flow
- Create an API key in the console.
- Submit a generation request with
POST /api/v1/jobs/createTask. - Store the returned
taskId. - Poll
GET /api/v1/jobs/recordInfo, or providecallBackUrland wait for the callback. - Read the final URL from the successful task response.
First request
curl -X POST https://api.xbaiapi.com/api/v1/jobs/createTask \
-H "Authorization: Bearer xb-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.0",
"input": {
"prompt": "a cat stretching on a sunlit windowsill",
"resolution": "720p",
"duration": 5,
"ratio": "16:9",
"generateAudio": true,
"imageUrls": []
}
}'Response envelope
Every endpoint returns the same top-level structure.
{
"code": 200,
"msg": "success",
"data": {}
}An HTTP 200 response from the create endpoint means the task was accepted. It does not mean generation has completed.
Available models
| Model | Use case | Status |
|---|---|---|
seedance-2.0 | Standard video generation | Available |
seedance-2.0-fast | Faster video generation | Available |
Each model page lists its parameters, examples, and rate.
Next steps
Start with Authentication, then open the page for the model you want, for example Seedance 2.0, and Query a task.