Skip to Content
Log in

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 codeOn Kerox
ByteDance's endpointPOST https://api.kerox.ai/v1/tasks, for images and video alike
ByteDance's API keyA Kerox key: Authorization: Bearer $KEROX_API_KEY (Quickstart)
model: ByteDance's model namemodel: the Kerox model ID, such as bytedance/seedream-5.5 (Models)
The rest of the bodyUnchanged, inside input, with "format": "native" next to it
callback_urlwebhook_url, at the top level next to model (Webhooks)
The result in the responseThe 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_url becomes the top-level webhook_url.
  • Remove them: execution_expires_after, response_format, stream. A body that has them is refused with HTTP 400 invalid_request, and param names 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.

On this page

For AI agents

This page as Markdown: /docs/migrate-from-bytedance.md

Everything at once: /llms-full.txt