Developers

Start a generation

POST
/generations

Starts one Generation Job and charges its Credits when accepted. Inputs are public https URLs: a publicUrl from create_upload_target, or any public https URL. A failed generation refunds its Credits.

Asynchronous: Returns at once with the creationId; poll get_generation_status until status is succeeded or failed.

Send an Idempotency-Key to make retries safe: the same key with the same body returns the first result, with a different body 409.

Authorization

headerAuthorizationBearer <token>

An API Key the User creates in account settings, sent as Authorization: Bearer <key>. It holds the Scopes chosen at creation.

Header Parameters

Idempotency-Key?string

A client key, unique per request.

Length1 <= length <= 255

Request Body

application/json
  1. body
submission*|||
originalPrompt?string
Length1 <= length

Response Body

Success.

application/json
  1. response
creationId*string
status*string
Value in"generating""succeeded""failed"
remainingCredits?integer
Range-9007199254740991 <= value <= 9007199254740991
Example request
curl -X POST 'https://ximagesplitter.com/api/v1/generations' \
  -H 'Content-Type: application/json' \
  -d '{
  "submission": {
    "mode": "image",
    "modelKey": "seedream-5-5",
    "prompt": "string",
    "assets": [
      {
        "slotId": "string",
        "url": "http://example.com"
      }
    ],
    "options": {
      "property1": "string",
      "property2": "string"
    },
    "operation": "text-to-image"
  }
}'
Example response
{
  "creationId": "string",
  "status": "generating",
  "remainingCredits": -9007199254740991
}