Images, video, embeddings and speech
These routes use the same product key. They are separate from tiers.
Images#
POST /v1/images generates an image from text or edits input images.
| Field | Meaning |
|---|---|
prompt | Required, up to 8000 characters |
images | Up to 4 data URLs, data:image/<png\|jpeg\|webp\|gif\|heic\|heif>;base64,..., for editing. Omit to generate |
subject, request_id | As in Text completion |
The body is limited to 30,000,000 bytes. The response has images ([{"mime","data"}], base64 without a prefix), text (accompanying text or null), model, pool, rung, attempts and totalLatencyMs. When nothing answers, the result is 503 all_rungs_failed and, if known, retry_at with the time the quota comes back.
Video#
Video is a task.
POST /v1/videowithprompt(up to 8000 characters), an optionalimage(one data URL, png, jpeg or webp) andsubject. It returns202 {"id","status"}.GET /v1/video/:idreturns{"id","status"}, witherrororbyteswhen known.GET /v1/video/:id/contentstreamsvideo/mp4.
A task is visible only to the product that created it; others get 404 not_found. Tasks are remembered for 24 hours. If video is not configured, the answer is 503 not_configured.
Embeddings#
POST /v1/embeddings is OpenAI-compatible.
input: a string or a non-empty array of strings, up to 64 texts by default.modelis optional, but if you send it, it must equal the pinned model.encoding_format, if present, must befloat.
The model is chosen by the gateway and stays the same, because stored vectors only work with the model that made them. The response is {"object":"list","data":[{"object":"embedding","index","embedding":[...]}],"model","usage":{...}}.
Speech transcription#
POST /v1/audio/transcriptions takes multipart/form-data with a file field and the usual OpenAI fields such as model, language and response_format. The gateway streams the file and returns the transcription server's status and body unchanged. The size limit defaults to 300 MiB.
Each product has a queue lane. In the interactive lane a person is waiting; in the batch lane background work waits behind. A request waits for a free slot, and leaving the connection cancels it.
curl -sS "$BLACKGATE_URL"/v1/audio/transcriptions \
-H "Authorization: Bearer $BLACKGATE_KEY" \
-F file=@voice.ogg -F model=<speech model> -F response_format=verbose_json
Errors on these routes#
| Status | error | Meaning |
|---|---|---|
| 400 | bad_request | Malformed body or field |
| 413 | too_large | Body over the route's limit |
| 502, 504 | upstream_error, timeout | The model or server failed or was too slow |
| 503 | not_configured | The route is not set up |
| 503 | model_unavailable | The embeddings model is not available |
Embeddings and speech are not counted against the daily limits.