Skip to main content
Docs · API reference

Images, audio and video

POST /images/generations, /audio/speech, /audio/transcriptions and /videos. The policy's pool decides the model; `auto` takes the first one of that type.

Browse docs · API referenceImages, audio and video
On this page
  1. Where these models run
  2. Refusals
  3. What the usage row records
  4. Image generation
  5. Request
  6. Example
  7. Response
  8. Speech
  9. Request
  10. Example
  11. Transcription
  12. Example
  13. Response
  14. Speech and transcription share one model type
  15. Video
  16. Example
  17. The job

None of these endpoints routes. Nothing Inferbase measures ranks image models against each other, or speech models, or video models, so there is no evidence to choose on. The routing policy decides instead: name a model, or send auto and take the first model of that type the key can reach.

What auto reaches depends on the policy's pool. A policy that names a pool makes that pool the whole list, in the order you arranged, and a request naming a model outside it is refused with 403. A policy on the default catalog pool restricts nothing, and auto takes the first model of that type in catalog order.

Where these models run

In practice these four endpoints serve on your own credential: a provider key or a cloud account you have connected. Connect a key under Connections, add the model to your routing policy's pool, and it serves.

An Inferbase route can serve them too, but only when that route carries a rate in the unit its vendor bills in. No route does today, so naming a model Inferbase serves on its own routes returns 503 with the fix in the message.

The reason is pricing rather than capability. Image, audio and video vendors bill per image, per megapixel, per character, per minute or per video, never per token, and a per-token rate computes nothing against a request that spends no tokens. Serving one without a rate in the right unit would mean charging you nothing for generation that costs us money. On your own credential the vendor bills you directly, so there is nothing for us to compute and nothing to get wrong.

Refusals

Four refusals are specific to choosing the model. All four arrive before the provider is called, so nothing is billed.

StatusWhen
403The request named a model the policy's pool does not hold. The message names the model and the endpoint.
403The request said auto and the pool holds no model of that type. The message names the pool.
404The model is not in the catalog at all. GET /models lists what the key can name.
503The model exists but runs only on an Inferbase route that carries no rate for this endpoint's unit, or the credential it would run on does not offer this surface. The message names the fix.

Rate limits, the key's spend cap and the project's budget apply here as they do on chat, so 429 and 402 are also possible.

What the usage row records

Chat, embeddings and rerank are metered in tokens. These are not, so the usage row records its own units and leaves the token counts at zero. Logs shows those units in place of a token count.

A row records every unit the request makes knowable, not only one. Hosts disagree about which unit they charge in, and one that charges per image today may charge per megapixel tomorrow, so the row is written to stay readable either way.

EndpointUnits recorded
/images/generationsImages returned, or images requested when the call failed, and the megapixels they came to when the request stated a size
/audio/speechCharacters spoken
/audio/transcriptionsSeconds and minutes of audio, when the provider states a duration
/videosThe video, and the seconds requested when the request stated a length

A transcription only states its duration when you ask for verbose_json. Without one the row records nothing for that request rather than estimating seconds from the file size. The duration is recorded exactly as the provider stated it, unrounded.

Every row for these endpoints costs zero, because your own credential paid the provider.

Image generation

Method and pathPOST /images/generations
PurposeGenerate images, OpenAI shape.
AuthenticationAPI key or session
LimitsUp to 10 images per call, and a prompt of up to 32,000 characters. Billed by the provider, to you.

Request

FieldMeaning
modelAn image model the policy's pool holds, or auto for the first one in it. Required.
promptWhat to generate. Required.
nHow many images. Default 1.
response_formaturl or b64_json. Any other value is a 422.
size, quality, style, userForwarded when set.
background, output_format, seedProvider-specific parameters, forwarded untouched.

These are the whole list. A field outside it is a 422, including a parameter the provider itself accepts, because a silently dropped field would make the response a different request from the one you sent.

Example

bash
curl https://api.inferbase.ai/api/v1/inference/images/generations \
  -H "Authorization: Bearer inf_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "prompt": "a slate rooftop in the rain, seen from above",
    "n": 1
  }'

Response

The OpenAI shape: data carries one entry per image with a url or a b64_json, plus revised_prompt when the provider rewrote your prompt before generating. The response also names the model that served and adds served_by.

Speech

Method and pathPOST /audio/speech
PurposeTurn text into audio, OpenAI shape.
AuthenticationAPI key or session
LimitsUp to 8,000 characters per call.

The response body is the audio itself, so the disclosure other endpoints put in a served_by object rides in headers here: X-Inferbase-Model and X-Inferbase-Vendor. The media type is whatever the provider returned.

This endpoint does not support idempotency replay, because a replayed body would have to be stored as audio.

Request

FieldMeaning
modelA speech model the policy's pool holds, or auto. Required.
inputThe text to speak. Required.
voiceThe provider's voice name.
response_formatmp3, opus, aac, flac, wav or pcm, as the provider supports.
speed0.25 to 4.0.
instructionsStyle direction, where the provider supports it. Up to 4,000 characters.

Example

bash
curl https://api.inferbase.ai/api/v1/inference/audio/speech \
  -H "Authorization: Bearer inf_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"model": "auto", "input": "The rooftop is wet.", "voice": "alloy"}' \
  --output speech.mp3

Transcription

Method and pathPOST /audio/transcriptions
PurposeTurn audio into text, OpenAI shape.
AuthenticationAPI key or session
Limits25 MB per file.

Multipart, as every OpenAI SDK sends it. Send file and the fields below as form fields.

FieldMeaning
fileThe audio file. Required. Its extension is how most providers detect the container, so keep it. An empty file is a 400 and one over the size limit a 413.
modelA transcription model the policy's pool holds, or auto. Defaults to auto.
language, prompt, response_format, temperatureForwarded when set.

Example

bash
curl https://api.inferbase.ai/api/v1/inference/audio/transcriptions \
  -H "Authorization: Bearer inf_your_api_key" \
  -F file=@meeting.m4a \
  -F model=auto \
  -F response_format=verbose_json

Response

text is the transcript. Ask for verbose_json and the provider's extra fields ride through untouched, including duration and segments. Ask for anything else and you get the plain shape, even where Inferbase asked the provider for more in order to meter the request. The response shape follows what you asked for, never what we asked the provider for, so it does not change with the credential that served it.

The response also names the model that served.

Speech and transcription share one model type

Both directions are filed under the catalog model_type of audio, so a pool can hold a text-to-speech model and a transcriber at the same time.

Each endpoint drops the models whose stated output contradicts it, so a transcriber the catalog knows produces text is never what auto picks on /audio/speech. A model whose output the catalog does not state stays eligible for both, because excluding it would hide a model that does work on the strength of missing data. Name the model rather than sending auto when a pool holds both directions and one of them is uncatalogued.

Video

Video generation is asynchronous at every provider, so this is three endpoints rather than one: start a job, poll it, download the result.

Method and pathPOST /videos
PurposeStart a video generation. Returns a job, not a video.
AuthenticationAPI key or session
FieldMeaning
modelA video model the policy's pool holds, or auto. Required.
promptWhat to generate. Required, up to 32,000 characters.
secondsRequested length in seconds, 1 to 600. The billing unit, and the row records none without it.
sizeFor example 1280x720, as the provider supports.

Example

bash
# Start the job.
curl https://api.inferbase.ai/api/v1/inference/videos \
  -H "Authorization: Bearer inf_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"model": "auto", "prompt": "rain on a slate rooftop", "seconds": 8}'

# Poll it, using the id the create call returned.
curl https://api.inferbase.ai/api/v1/inference/videos/video_9f2c... \
  -H "Authorization: Bearer inf_your_api_key"

# Download it once status is completed.
curl https://api.inferbase.ai/api/v1/inference/videos/video_9f2c.../content \
  -H "Authorization: Bearer inf_your_api_key" \
  --output clip.mp4

The job

status is one of queued, in_progress, completed or failed. Each provider's own status words are mapped onto those four. A word no provider has been mapped from reads as in_progress, so an unknown state means keep polling rather than a failure. progress is a percentage where the provider reports one, and error carries the provider's message on a failure.

The id is Inferbase's, not the provider's. Store it, because it is what both reads take.

The job stays tied to the credential that started it. Every poll and every download resolves that credential again, so disconnecting the key or cloud account leaves the job unreadable and both reads return 503. A job belonging to another project reads as 404. There is no endpoint that lists jobs, so keep the ids you started.

A poll that cannot reach the provider returns 502 and leaves the job alone. It does not mark it failed, because the generation is very likely still running.

The usage row for a video is written by the poll that first sees the job finished or failed, not by the call that started it. A job nobody polls to a terminal state records no usage.

Downloading before the job finishes returns 409 naming the state, not 404. The video is fetched from the provider on demand through the credential that made it; Inferbase never stores it.

Last updated September 10, 2026.