Skip to main content
POST

Authorizations

Authorization
string
header
required

All endpoints require Bearer Token authentication. Add to the request header:

Authorization: Bearer YOUR_API_KEY

YOUR_API_KEY is the API Token (sk-... format).

Body

application/json

Request body in messages[] form (OpenAI Chat compatible). Apart from the fields listed below, other OpenAI-compatible parameters (temperature, top_p, stop, frequency_penalty, etc.) are used per the OpenAI Chat spec.

model
string
required
Example:

"claude-opus-4-7"

messages
object[]
required

OpenAI Chat format messages array. messages[*].content may be a string or an array; array element type ∈ {text, image_url, video_url, audio_url, file_url}. A type the model does not support returns 422 model_not_support_capability.

Typical content shapes:

  1. Plain text (string content, simplest form):
  1. Plain text (array content, the unified format when mixing with multimodal):
  1. text + image:
  1. text + video:
  1. text + file:
  1. Multi-turn conversation (system + multiple user/assistant turns):
  1. Mixed attachments of all types (a single user message containing 2 each of image_url / video_url / audio_url / file_url):

Inline base64 (asynchronous mode only, when sync is omitted or false): In image_url / video_url / audio_url / file_url blocks, inline base64 in the {"url": ...} object form (data: URI, or at least 4096 encoded characters whose decoded content matches a known media signature) is uploaded to file storage and replaced with a URL before the request is persisted or submitted upstream; the original base64 is not stored. Shorter raw base64 or content with an unrecognized signature is passed through unchanged and is not size-validated. Limits apply only to inline base64 items (public HTTP(S) URLs are not limited): decoded size ≤ 5 MB per item, ≤ 5 inline items per array, ≤ 10 MB total per request, and ≤ 20 inline items per request. An invalid data: prefix or payload that decodes to zero bytes returns 422; exceeding a limit also returns 422. Use /v1/files/upload first and pass the resulting URL instead.

When sync: true, the request is not stored as a task and the rules above do not apply: inline base64 is submitted upstream unchanged without size or count validation.

Shapes outside the coverage scope: input_audio.data / file.file_data, and the direct string form {"type":"image_url","image_url":"data:..."} (where the value is not a {"url": ...} object). Inline base64 in these shapes is passed through unchanged.

Example:
stream
boolean
default:false

Whether to stream.

Behavior differences:

Example:

false

max_tokens
integer | null

Generation token limit. Family-level constraints: claude-* required; gpt-* usually ≥ 16; gemini-* optional.

Example:

64

temperature
number | null

Sampling temperature.

top_p
number | null

Nucleus sampling.

stop

Stop sequences.

Response

Task created

Submit response, conforming to the unified task standard shape. results / error are fixed at null during submit; they are returned via GET /v1/tasks/{task_id} after the task completes or fails

id
string
required

Task ID, formatted as task-llm-{timestamp}-{8random}. Used for GET /v1/tasks/{task_id} queries or GET /v1/llm/generations/{task_id}/stream SSE subscriptions

Example:

"task-llm-1776874565-yq3szvcu"

object
enum<string>
required

Object type, fixed at llm.generation.task

Available options:
llm.generation.task
Example:

"llm.generation.task"

type
enum<string>
required

Media type, fixed at llm

Available options:
llm
Example:

"llm"

model
string
required

The model name submitted by the client (echoed verbatim)

Example:

"claude-opus-4-7"

status
enum<string>
required

Task status, fixed at pending during submit

Available options:
pending
Example:

"pending"

progress
integer
required

Progress 0-100, fixed at 0 during submit

Example:

0

created
integer
required

Creation time (Unix seconds)

Example:

1776874565

stream
object · null · null

Returns {url: ...} when stream=true; null when stream=false. The client uses this to decide whether to connect to SSE

results
object[] | null

Fixed at null during submit; obtained via GET /v1/tasks/{task_id} after the task completes — results[0] is the full OpenAI ChatCompletion response.

Known limitation: a thinking model's reasoning content (reasoning_content) appears only in the SSE stream's delta and is not accumulated into results[0].message.content

Example:

null

error
object | null

Fixed at null during submit; returned via GET /v1/tasks/{task_id} when the task fails

Example:

null