Migrate from ByteDance's API
Move code written for ByteDance's own API to Kerox: keep the request body, wrap it, change the host and key, read the result the Kerox way.
ByteDance models take ByteDance's own request body when you add "format": "native", so the parameters you already send stay as they are. What changes is around them: the host, the key, where model and the callback go, and how you get the result. Other models don't have this option: they take Kerox's parameter names, which ByteDance models take too.
What to change
| In your ByteDance code | On Kerox |
|---|---|
| ByteDance's endpoint | POST https://api.kerox.ai/v1/tasks, for images and video alike |
| ByteDance's API key | A Kerox key: Authorization: Bearer $KEROX_API_KEY (Quickstart) |
model: ByteDance's model name | model: the Kerox model ID, such as bytedance/seedream-5.5 (Models) |
| The rest of the body | Unchanged, inside input, with "format": "native" next to it |
callback_url | webhook_url, at the top level next to model (Webhooks) |
| The result in the response | The response has the task's id at once; poll GET /v1/tasks/{id} or wait for the webhook, then read the files in outputs (Tasks) |
Some of ByteDance's parameters are handled differently:
- Accepted and ignored:
service_tier,priority,safety_identifier. A body that has them works unchanged; they are not passed to the model and ByteDance's defaults apply. - Moved:
callback_urlbecomes the top-levelwebhook_url. - Remove them:
execution_expires_after,response_format,stream. A body that has them is refused with HTTP400invalid_request, andparamnames the field.
Before and after
An image request. response_format goes; the result is always a file URL in outputs.
{
"model": "<ByteDance model name>",
"prompt": "a quiet coastal lighthouse at dusk",
"size": "2K",
"response_format": "url",
"watermark": false
}A video request. callback_url moves out to webhook_url; service_tier can stay and is ignored.
{
"model": "<ByteDance model name>",
"content": [{ "type": "text", "text": "a red fox running through fresh snow" }],
"ratio": "16:9",
"resolution": "720p",
"duration": 5,
"service_tier": "default",
"callback_url": "https://your-app.example.com/webhooks/kerox"
}Send it
The video request, sent. What each model takes in this format is its input_schema in GET /v1/models/{id}, and the ByteDance format section of its model page.
curl -X POST https://api.kerox.ai/v1/tasks \
-H "Authorization: Bearer $KEROX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bytedance/seedance-2.5",
"format": "native",
"input": {
"content": [
{ "type": "text", "text": "a red fox running through fresh snow" }
],
"ratio": "16:9",
"resolution": "720p",
"duration": 5
}
}'The response and everything after it are the same as for every task: see Tasks & polling.