Skip to navigation

API Reference

Complete REST surface: chat, responses, embeddings, reranks, decisions, images, video, 3D, audio, transcription, document OCR, search, detection, batch, jobs

EmpirioLabs speaks OpenAI-, Anthropic-, and Google Gemini-compatible request shapes. Point an OpenAI SDK at https://api.empiriolabs.ai/v1, or an Anthropic or Gemini SDK at https://api.empiriolabs.ai, and authenticate with your EmpirioLabs API key. These OpenAI SDK calls work differently:

  • Images. images.edit uploads the image as a file, which is not accepted: send POST /v1/images/edits as JSON with the image’s URL. images.generate returns the finished images, as it does on OpenAI.
  • Speech. audio.speech.create returns the audio bytes, which is what the SDK asks for.
  • Files. Files are batch files. files.create takes purpose: "batch", and files.list, files.retrieve, files.content, and files.delete work on your batch input, output, and error files.
  • Responses. Responses are not stored. Send the full conversation with every responses.create call; previous_response_id, background: true, and the calls that read a stored response, such as responses.retrieve, are not available.

Authentication

Requests authenticate with your API key. The catalog endpoints (GET /v1/models, the Gemini model list at GET /v1beta/models, the generation template and Compose recipe lists, and the GPU catalog) also answer without one. Either header is accepted on every endpoint:

Authorization: Bearer $EMPIRIOLABS_API_KEY
x-api-key: $EMPIRIOLABS_API_KEY

Gemini-compatible routes additionally accept the key in the x-goog-api-key header or the ?key= query parameter, matching Gemini client defaults.

from openai import OpenAI
client = OpenAI(
base_url="https://api.empiriolabs.ai/v1",
api_key="$EMPIRIOLABS_API_KEY",
)
resp = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Hello!"}],
)

Endpoint surface

Chat completions

OpenAI-compatible chat. Streaming, tool calling, vision, audio input, JSON mode, structured output, reasoning controls.

Responses API

OpenAI Responses-compatible. Same models as chat completions with the input / instructions request shape. Responses are not stored.

Legacy completions

OpenAI-compatible prompt completions on every chat model.

Anthropic Messages

Drop-in for Anthropic SDK clients. tool_use / tool_result blocks round-trip cleanly.

Gemini-compatible

Native Google Gemini generateContent, streaming, countTokens, and model listing for any chat model.

Images

Generate, edit, inpaint, image variations. Hosted CDN URLs, 7-day signed.

Video

Async video generation. Returns a job_id; poll the jobs endpoint for the URL.

Generation templates

Apply curated effects to generations, or plan and render full short-form videos with Compose recipes.

Audio (TTS, music, voices)

TTS plus real-time streaming TTS (Inworld), music / podcast / SFX generation, voice clone management.

Realtime voice

Full-duplex speech over a WebSocket. Speech-to-speech conversation and live transcription on one connection.

Long responses

Text responses past the 15 minute HTTP limit, over a WebSocket connection to the Responses API.

Agents

Long-running tool-using agent tasks. Start, poll, stream messages, stop early.

Transcription

Whisper / Deepgram / Parakeet. Multipart upload or file_url.

Document OCR

PDFs and images to Markdown, page by page, with tables, images, headers, and footers.

Search and research

Exa, Tavily, Linkup, Perplexity Search. Domain filters, date ranges, geo bias.

3D generation

Async 3D asset generation from a text prompt, images, or both. Returns a job_id; poll for the generated files.

Detection

POST /v1/detect for GPTZero AI-detection.

Embeddings

OpenAI-compatible embeddings. Multilingual text + multimodal embedders.

Reranks

Semantic document reranking. Sort retrieval candidates by relevance for RAG and search refinement.

Decisions

Calibrated probabilities for yes/no, choice, score, and tool questions about text, images, audio, and video.

Batch API

Bulk chat and embeddings as one asynchronous job. Upload a JSONL file, poll, download results.

File URLs

Pass any public URL on input fields. No upload, no re-sign. Generated outputs are valid for 7 days.

Jobs

Poll the status / result of any async generation. State retained 1 hour after completion.

Account usage

Balance, spend by product, cache hit rate, and per-request usage history.

GPU Cloud

Deploy managed GPU instances and one-click templates with the same API key.

Hosted Agents

Provision and manage always-on hosted agent runtimes.

Models

Live catalog with pricing, parameter schema, capability flags, regions.

Errors

OpenAI-, Anthropic-, and Gemini-compatible error envelopes.

Chat completions

POST /v1/chat/completions

Pass any chat-capable model from the catalog as model. Streaming uses Server-Sent Events with data: ... lines and a final data: [DONE]. usage arrives at the end of the stream on a chunk that also has choices. Set stream_options.include_usage to true to receive it the way OpenAI sends it, in its own chunk just before [DONE] whose choices is an empty list; some models still report it on a chunk with choices. Read usage from the last chunk that carries it. When web search adds a Sources list to the answer, the list arrives as content before the chunk that carries finish_reason.

curl https://api.empiriolabs.ai/v1/chat/completions \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"messages": [{"role": "user", "content": "Summarize CRDT consistency in 3 bullets."}],
"stream": true,
"temperature": 0.7
}'

Every model’s accepted parameters live on its docs page (e.g. temperature, top_p, enable_thinking, reasoning_effort, web_search_tier). Browse them under Authors and Models.

Responses API

POST /v1/responses

OpenAI Responses-compatible. Models that list POST /v1/responses in supported_endpoints accept the Responses request shape: input, instructions, streaming, tool calling, and structured output via text.format.

Responses are not stored, whatever store is set to. Send the full conversation in input with every request; previous_response_id, conversation, prompt, and item_reference input items return 400 with the code unsupported_parameter. Background responses are not available: background: true returns 400 with the code unsupported_value. A tool type the model does not support returns 400 naming the tool, and a web_search tool turns on the model’s own web search when it has one. The response object repeats the request’s settings (tools, tool_choice, parallel_tool_calls, instructions, max_output_tokens, and the others), with store always false.

A streamed answer cut off by max_output_tokens or a content filter ends with response.incomplete, and a stream that fails after it starts ends with response.failed, whose response.error gives the code and message. A stream ends after its final event, with no [DONE] sentinel.

curl https://api.empiriolabs.ai/v1/responses \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seed-2-0-pro",
"input": "Write a one-line launch checklist.",
"instructions": "Be concise.",
"store": false
}'

Model parameters across endpoints

Model-specific parameters advertised on the model page and in GET /v1/models/{id} can be sent to /v1/chat/completions, /v1/responses, and /v1/messages when that model supports the endpoint. The gateway adapts request shapes so the same controls reach the underlying model.

For thinking-capable models, enable_thinking and thinking_budget are accepted on all three text endpoints. On /v1/messages, you can also use Anthropic-style thinking:

{
"thinking": {
"type": "enabled",
"budget_tokens": 1024
}
}

That maps to the same enable_thinking=true and thinking_budget=1024 controls used by Chat Completions and Responses. "type": "adaptive" turns thinking on without a budget, and "type": "disabled" turns it off.

Legacy completions

POST /v1/completions

Use this endpoint for OpenAI-compatible clients that still send a raw prompt instead of chat messages. Every model that accepts POST /v1/chat/completions accepts this shape.

Send one text prompt per request: a list with more than one prompt, or a prompt given as token IDs, returns 400 with param set to prompt. echo: true returns the prompt followed by the completion. A non-empty suffix, or a best_of above 1, returns 400 naming the parameter.

Streaming uses Server-Sent Events. usage arrives at the end of the stream on a chunk that also has choices. Set stream_options.include_usage to true to receive it the way OpenAI sends it, in its own chunk just before [DONE] whose choices is an empty list; some models still report it on a chunk with choices. Read usage from the last chunk that carries it.

curl https://api.empiriolabs.ai/v1/completions \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-5-9b",
"prompt": "Write one concise launch sentence.",
"max_tokens": 64,
"stream": true
}'

Anthropic Messages

POST /v1/messages

Drop-in for any Anthropic SDK client: models that list POST /v1/messages in supported_endpoints are reachable here under the Anthropic Messages shape.

curl https://api.empiriolabs.ai/v1/messages \
-H "x-api-key: $EMPIRIOLABS_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hi!"}]
}'

tool_use and tool_result blocks round-trip cleanly. Mixed text-plus-tool_use content arrays are preserved. max_tokens is optional. A web_search tool turns on web search on models that offer it; any other server tool, and any content block the model cannot take, returns 400 naming it. A stream that fails after it starts ends with one error event.

POST /v1/messages/count_tokens takes the same body (without max_tokens) and returns {"input_tokens": N}, an estimate of the request’s input size. It requires an API key, is not billed, and returns 404 for a model that is not in the catalog. Errors on both endpoints use the Anthropic error shape.

Gemini-compatible endpoint

POST /v1beta/models/{model}:generateContent

Native Google Gemini request and response shapes for any chat model. POST /v1beta/models/{model}:streamGenerateContent?alt=sse streams Server-Sent Events (each event is a partial GenerateContentResponse; there is no [DONE] sentinel); without alt=sse it returns the same responses as one JSON array. POST /v1beta/models/{model}:countTokens returns {"totalTokens": N}, an estimate of the input size; it requires an API key and is not billed. GET /v1beta/models and GET /v1beta/models/{model} list the chat models in the Gemini Model shape, for the SDK’s models.list() and models.get(); both answer without an API key.

A googleSearch tool turns on web search on models that offer it. A request the API cannot serve as asked returns 400 naming the field: candidateCount above 1, responseModalities other than TEXT, responseLogprobs, cachedContent, or a built-in tool other than googleSearch, such as codeExecution or urlContext.

Authenticate with the x-goog-api-key header or the ?key= query parameter. The google-genai SDKs work by pointing their base URL at https://api.empiriolabs.ai; pricing, parameters, and billing match /v1/chat/completions. Errors use the Google error shape.

curl "https://api.empiriolabs.ai/v1beta/models/qwen3-7-max:generateContent" \
-H "x-goog-api-key: $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{ "role": "user", "parts": [{ "text": "Hello!" }] }],
"generationConfig": { "temperature": 0.7, "maxOutputTokens": 256 }
}'

Image generation

POST /v1/images/generations

curl https://api.empiriolabs.ai/v1/images/generations \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2-7-image",
"prompt": "A glass cathedral at sunset, dramatic lighting",
"aspect_ratio": "16:9",
"resolution": "4K",
"thinking_mode": true,
"num_images": 4
}'

Image generation returns the finished OpenAI-shaped created and data[] response, which is what OpenAI SDK images.generate integrations expect. A generation still running after about 14 minutes answers with the {job_id, poll_url} envelope instead, with the job still running; poll the jobs endpoint for the result. Send Prefer: respond-async (or sync: false) to get the envelope at once.

POST /v1/images/edits applies a text instruction to an existing image. Send JSON with the image URL as image, the instruction as prompt, and an image-edit model such as grok-imagine-image-2-0 as model, which is required. It answers the same way: the finished images, or the job envelope with Prefer: respond-async.

Image-edit flows accept image: ["https://..."] with up to the model’s documented limit (3 for qwen-image-2-0, 9 for wan2-7-image, 14 for seedream-5-0-lite). Image-set modes generate cohesive series; see each model’s page for the toggle.

Returned URLs live on https://media.empiriolabs.ai and expire after 7 days. Save anything you want to keep before the URL expires.

POST /v1/images/analysis answers a question about one image (image_url) with any chat model whose input_modalities include image (qwen3-7-flash when model is omitted), and returns the answer as text in analysis. No image is generated.

Video generation

POST /v1/videos/generations

Always async: the endpoint returns a job_id and a polling URL. model is required unless a template or extend_from is set; see Generation Templates for the model each one runs.

curl https://api.empiriolabs.ai/v1/videos/generations \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-0-pro",
"prompt": "A cinematic dolly shot of a city street at dusk in the rain",
"resolution": "1080p",
"aspect_ratio": "16:9",
"duration": 8,
"generate_audio": true
}'

Generation templates

Effect templates apply curated creative treatments to normal image and video generation requests.

GET /v1/templates lists the public template catalog. Use GET /v1/images/templates or GET /v1/videos/templates when you already know the modality.

GET /v1/videos/compose/recipes lists full-production video recipes, caption styles, input requirements, and recommended model options.

POST /v1/videos/compose starts a Compose recipe job:

  • mode: "plan" returns an editable storyboard from a brief or script.
  • mode: "render" takes a storyboard and produces the final MP4.
  • mode: "edit" takes the manifest from a render job’s result plus edits, each with a zero-based scene_index and an action: regen_visual, edit_caption, or redo_vo (the last two take the new text in value).
Plan a Compose storyboard
curl https://api.empiriolabs.ai/v1/videos/compose \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recipe": "custom",
"mode": "plan",
"brief": "Explain why cold plunge clips went viral.",
"aspect_ratio": "9:16",
"scene_count": 5
}'

Compose returns the same async job envelope as video generation. Poll GET /v1/jobs/{job_id} until the result is ready. See Generation Templates for the end-to-end plan, render, edit, and usage workflow.

Audio generation

POST /v1/audio/speech synchronous text-to-speech, including multi-speaker podcasts. Returns JSON with a hosted URL by default; pass response_format: "b64_json" for inline audio, or send an Accept header of application/octet-stream or audio/* (as the OpenAI SDK does) to receive the audio file itself.

POST /v1/audio/speech:stream real-time TTS. Returns Server-Sent Events as the model synthesizes, ending with audio.done, which carries the complete file’s url and format. Sub-130ms time-to-first-byte on Inworld TTS Mini, sub-250ms on Max. Use for voice agents and interactive playback. Models that stream list POST /v1/audio/speech:stream in supported_endpoints; other TTS models use the synchronous endpoint. A failure before the first event returns an ordinary error response with its HTTP status.

POST /v1/audio/generations music and sound-effect generation from a prompt, with models such as Stable Audio, ACE-Step, MiniMax Music, and Sonilo. Returns a job to poll.

GET /v1/voices?model=<tts-model> lists a TTS model’s voices as {object, model, total, data}. Pass a voice’s id as voice on either speech endpoint.

On the Qwen Audio TTS models, GET /v1/voices also lists the custom voices your account holds (type=custom lists them alone) and DELETE /v1/voices/{voice_id}?model=<tts-model> deletes one, which frees its place in the account’s limit at once. The Playground offers the same under Voice, when Voice is set to Custom. Gemini 3.8 TTS keeps no list of custom voices: keep the voice_id from the response that created the voice.

voice: "custom" creates a voice from a recording on the TTS models whose voice options include it: pass voice_audio_url, an https URL to the recording, and voice_consent_audio_url on a model that lists it. The model page gives the recording length and formats it takes. A model that keeps the voice also returns voice_id and voice_id_expires_at; pass the voice_id as voice on either speech endpoint to speak with that voice again until it expires.

curl https://api.empiriolabs.ai/v1/audio/speech \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2-5-flash-tts",
"input": "Hello from EmpirioLabs.",
"voice": "Charon",
"output_format": "WAV"
}'

Transcription

POST /v1/audio/transcriptions

Accepts either a multipart file upload or a JSON payload with file_url.

curl https://api.empiriolabs.ai/v1/audio/transcriptions \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-F "model=openai-whisper-1" \
-F "file=@meeting.mp3" \
-F "response_format=verbose_json" \
-F "timestamp_granularities=word,segment"

Every transcription request returns 202 with a job_id and a poll_url, whatever the length of the recording. Poll GET /v1/jobs/<job-id> until status is completed; the transcript is in result.

Document OCR

POST /v1/ocr

Reads a PDF or an image and returns every page as Markdown, with image regions, tables, headers, and footers. document takes a document_url or an image_url, each a public URL or a base64 data URI; pages chooses zero-based pages. A request still running after about four and a half minutes answers 202 with a job_id, and Prefer: respond-async asks for it at once.

curl https://api.empiriolabs.ai/v1/ocr \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "lightonocr-3-4b",
"document": {"type": "document_url", "document_url": "https://arxiv.org/pdf/2412.13663"},
"pages": [0, 1]
}'

See the Document OCR API guide for page selection, image and table options, long documents, and billing.

Long responses

WEBSOCKET /v1/responses

An HTTP request can run for up to 15 minutes. A response that takes longer runs over a WebSocket connection to /v1/responses, for every model that supports POST /v1/responses: send a response.create message and read the same events a streaming POST /v1/responses sends. Nothing is stored, so stay connected until the response ends. See Long Responses.

Realtime voice

WEBSOCKET /v1/realtime

A WebSocket endpoint for full-duplex audio: the model can be interrupted mid-response, and live transcription returns results while the speaker is still talking. stream: true on the HTTP endpoints streams output only and cannot carry microphone audio to the model.

wss://api.empiriolabs.ai/v1/realtime?model=<model>

Authenticate with your API key in an Authorization: Bearer header on the handshake. A web page cannot set that header, so it connects with a short-lived client secret that your server creates with POST /v1/realtime/client_secrets; see Connect from a browser.

import asyncio, json, os, websockets
async def main():
async with websockets.connect(
"wss://api.empiriolabs.ai/v1/realtime?model=stepaudio-3-realtime",
additional_headers=[("Authorization", f"Bearer {os.environ['EMPIRIOLABS_API_KEY']}")],
max_size=None,
) as ws:
print(json.loads(await ws.recv())["type"]) # session.created
await ws.send(json.dumps({
"type": "conversation.item.create",
"item": {"type": "message", "role": "user",
"content": [{"type": "input_text", "text": "Say hello."}]},
}))
await ws.send(json.dumps({"type": "response.create"}))
async for raw in ws:
event = json.loads(raw)
if event["type"] == "response.audio.delta":
... # base64 16-bit PCM chunk, append to your playback buffer
elif event["type"] == "response.done":
break
asyncio.run(main())

Speech-to-speech models bill each completed turn from that turn’s token usage; live transcription models bill by the duration of audio sent. Models, per-model voices, the event table and the transcription protocol are on Realtime Voice API.

Search and research

POST /v1/search unified search surface for retrieval-style models. The exact accepted params per model live on each model’s page (e.g. exa-search exposes 27 params including search_type, category, max_age_hours, subpages, summary_query, code_tokens).

POST /v1/research multi-step research with a research model (tavily-research). Answers synchronously with a report with numbered citations in answer and its sources in results; a run can take several minutes.

POST /v1/answer direct question-answering models (exa-answer). Returns a concise answer plus its sources in results (title, url, id, and text when you send text: true). The answer is always one JSON response; stream is ignored.

curl https://api.empiriolabs.ai/v1/search \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tavily-search",
"query": "latest CRDT research papers 2026",
"search_depth": "advanced",
"include_answer": "advanced",
"max_results": 10,
"topic": "general"
}'

Agents

Long-running, tool-using agent tasks (currently routed to Manus). Submit once, then poll for status and step-by-step messages, or stop early.

POST /v1/agents/run does double duty:

  • With no task_id it starts a fresh task.
  • With task_id it sends a follow-up message to an existing task. The agent picks it up on its next reasoning step.

Either way the response is 202 with a job (job_id and poll_url). Poll GET /v1/jobs/{job_id}; the finished job’s result holds the agent’s output, with the task id in result.task_id. Set stream: true to receive Server-Sent Events instead.

When the agent stops to ask a question or to wait for a confirmation, the finished job’s result.waiting says which (type is question or confirmation) and result.text ends with the question. Reply with a follow-up that sends the same task_id: it answers the question, or continues without the confirmation. A follow-up’s job returns and bills only that turn.

GET /v1/agents/{task_id} retrieve the task’s current details, as {object, model, task_id, result}.

GET /v1/agents/{task_id}/messages list every step the agent has emitted so far. Useful for rendering a live reasoning trace alongside the final answer.

POST /v1/agents/{task_id}/stop stop a running task. Billing settles for the work the agent already completed.

curl https://api.empiriolabs.ai/v1/agents/run \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "manus",
"input": "Summarize the top 5 humanoid robotics startups by funding raised in 2025-2026"
}'

3D Generation

POST /v1/3d/generations

3D generation is async. The inputs depend on the model: a text prompt, one or more images, or both. Each model page lists the parameters the model accepts, with their allowed values and defaults. The endpoint returns a job_id and a polling URL; poll the jobs endpoint until the job is completed, then read the generated files from result.data.

curl https://api.empiriolabs.ai/v1/3d/generations \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "trellis-2-4b",
"image": "https://example.com/product-photo.png",
"resolution": "1024",
"texture_size": "2048",
"decimation_target": 500000,
"seed": 42
}'

Each file in result.data has a signed url (inline b64_json when response_format is b64_json) and a filename to save it under. Where the model provides them, a file also has a format, for example glb, and a role that says what the file is.

Detection

POST /v1/detect

Specialized text-classification endpoint. Currently powers GPTZero AI-detection. Each model’s scan_type enum picks the scan; see the per-model docs for the full parameter surface.

GPTZero AI-detection
curl https://api.empiriolabs.ai/v1/detect \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gptzero",
"input": "The quick brown fox jumps over the lazy dog.",
"scan_type": "ai_detection",
"multilingual": false
}'

GPTZero is also reachable via /v1/chat/completions and /v1/responses: pass the text on the message body and the gateway adapts the call. The detection summary comes back as the assistant message; pass disable_formatting: true to receive the raw upstream JSON instead.

Embeddings

POST /v1/embeddings

OpenAI-compatible embeddings. Multilingual text and multimodal (text + image + video) embedders are available. model is required. Text input is a string or a list of strings; token IDs return 400. encoding_format: "base64" works on every model. dimensions sets the vector size on models that offer more than one; a fixed-size model returns 400 for any other value.

curl https://api.empiriolabs.ai/v1/embeddings \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-v4",
"input": ["Sentence one.", "Sentence two."],
"encoding_format": "float"
}'

Reranks

POST /v1/reranks

Sort candidate documents by semantic relevance to a query. Returns each document’s original index plus a 0-1 relevance score (higher = more relevant). Use this to tighten the output of a vector store / BM25 / hybrid retriever before passing the top hits to a language model, the standard last step in a RAG pipeline.

curl https://api.empiriolabs.ai/v1/reranks \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-rerank",
"query": "What is a rerank model?",
"documents": [
"Rerank models sort candidate documents by relevance.",
"Quantum computing is a cutting-edge field of computer science.",
"Pre-trained language models advanced rerank models."
],
"top_n": 2,
"return_documents": true
}'

The optional instruct parameter swaps between Q&A retrieval (default) and pure semantic-similarity sorting; see the qwen3-rerank model page for the full parameter table.

Decisions

POST /v1/decisions

Answer typed questions about a state with calibrated probabilities. Decision models read text, JSON, images, audio, and video, and return a probability distribution and a confidence value for each question instead of generated text. Question types are noul (yes or no), choice (2 to 255 named options), score (2 to 10 ordered levels), and tool (which function to call). Usage counts input tokens only.

curl https://api.empiriolabs.ai/v1/decisions \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "aplomb-1",
"state": "I was charged twice for my subscription this month. Please refund the duplicate charge today.",
"questions": {
"is_urgent": {"type": "noul", "instructions": "Does the customer need a resolution today?"},
"department": {
"type": "choice",
"instructions": "Which team should handle this message?",
"criteria": {"billing": null, "technical": null, "sales": null}
}
}
}'

See the Decisions API guide for every question type, media input, limits, and billing.

Batch API

Process large request sets asynchronously. Batch runs chat and embeddings requests for batch-eligible models; check the batch_supported field on GET /v1/models (eligible model pages also show a Batch API row). Each line bills at the model’s list price less its batch_discount_pct, which is 0 when the model runs batch at list price. On a model with a batch discount, batch requests cannot use web search or built-in tools; send those requests to the real-time endpoint. Results arrive within the 24-hour completion window.

  1. Upload a JSONL input file with POST /v1/files (multipart, purpose=batch). Each line is {"custom_id": "...", "method": "POST", "url": "/v1/chat/completions", "body": {...}}; /v1/embeddings lines work the same way, including encoding_format: "base64". Every line needs a custom_id that is unique in the file (at most 256 characters). A line’s url must be the batch’s endpoint and its method POST (a line may also leave both out), or creating the batch returns 400 invalid_batch_line. Up to 50,000 requests per file. Files are kept for 7 days.
  2. Create the batch with POST /v1/batches, passing the returned input_file_id. completion_window is 24h. metadata takes up to 16 string pairs (keys up to 64 characters, values up to 512).
  3. Poll GET /v1/batches/{batch_id} until the batch reaches a terminal status. GET /v1/batches lists recent batches, newest first, and pages with limit and after (the previous page’s last_id) while has_more is true. POST /v1/batches/{batch_id}/cancel cancels one. A batch that fails gives the reason in errors.
  4. Download results with GET /v1/files/{output_file_id}/content and GET /v1/files/{error_file_id}/content. The output file has a line for each request that succeeded, and the error file a line for each request that did not.

Each result line is {"id", "custom_id", "response", "error"}. A request that got an HTTP answer has response with its status_code, its request_id (the ID its row in Account Usage carries), and the response body, and error is null; a failed request’s body is an error body in the API’s error shape. A request that never ran, for example because the batch expired or was cancelled first, has response: null and an error with a code (batch_expired, batch_cancelled) and message.

Error file lines
{"id": "batch_req_6f1d2c3b4a5e4f60718293a4b5c6d7e8", "custom_id": "request-2", "response": {"status_code": 400, "request_id": "batch_497c277b51594a8e8e6c474d92fb4b41:request-2", "body": {"error": {"message": "Web search is not available in batch requests. Send this request to the real-time endpoint.", "type": "invalid_request_error", "param": null, "code": "batch_tools_unsupported"}}}, "error": null}
{"id": "batch_req_0a9b8c7d6e5f40312a4b5c6d7e8f9a0b", "custom_id": "request-3", "response": null, "error": {"code": "batch_expired", "message": "This request could not be executed before the completion window expired."}}

GET /v1/files lists your batch files (filter with purpose: batch or batch_output), GET /v1/files/{file_id} returns one with its expires_at, and DELETE /v1/files/{file_id} deletes one; deleting the input file of a batch that is still running returns 409 file_in_use. A file past its expires_at returns 404 file_expired.

curl https://api.empiriolabs.ai/v1/files \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-F "purpose=batch" \
-F "file=@requests.jsonl"

Usage object

Every endpoint that bills usage returns a usage field on the response. A streamed Chat Completions or Completions response carries it at the end of the stream, on a chunk that also has choices or, when the request sets stream_options.include_usage: true, in its own chunk with an empty choices list; read it from the last chunk that carries it. Messages, Responses and Gemini streams report it in message_delta, in response.completed (or response.incomplete) and in the last event’s usageMetadata. Base shape:

  • cost_usd: what your account was charged for the request, after any discount, plan allowance or add-on. It equals cost.amount on the request’s Account Usage row. A stream carries it on its final usage event. It is omitted when the charge is not final yet; Account Usage then shows it.
  • prompt_tokens / completion_tokens / total_tokens: for chat-style models.
  • Cache fields (cache_read_input_tokens, cache_creation_input_tokens): when prompt caching applies.

POST /v1/decisions uses its own shape: input_tokens, output_tokens (always 0), and input_tokens_details by modality, without cost_usd. See Decisions API.

Models with tiered, per-call, or variant pricing stamp extra fields on usage so you can see which rate was applied:

  • Tier / variant pricing. A tier discriminator appears on usage when the same dimension has more than one rate. The primary field is pricing_tier_label (human-readable, e.g. "Medium context" / "Pro" / "2K"). Some models stamp the raw dimension directly instead (resolution, quality, mode, rate_tier). The dashboard renders the badge from whichever is present.
  • Per-call pricing. Models that bill per tool invocation (search, fetch, code execution, etc.) report counts under tool_calls_details.<tool>.invocation or tool_usage.<tool>. The dashboard expands these into a per-tool breakdown automatically.
  • Per-dimension pricing. Models that bill multiple dimensions in one request (e.g. citation tokens + reasoning tokens + search queries on deep-research models) report each dimension as its own field (citation_tokens, reasoning_tokens, num_search_queries, etc.).

The same fields drive the tier badge and per-tool breakdown on the dashboard usage logs, and they are also returned by the GET /v1/account/usage history endpoint under each event’s metadata.worker_usage, plus a structured top-level tool_breakdown array on events from per-call models. So whether you read live response usage, account-usage history, or your dashboard, the tier and billing breakdown match exactly. See Account Usage API for the full response shape, including the account balance, per-product spend, and page-level cache_hit_rate.

File URLs

EmpirioLabs does not host user uploads. Pass any public URL directly on the input field of the model endpoint:

Endpoint familyInput fieldAccepts
Chat completions (vision)content[].image_url.urlAny public image URL or data: URI
Chat completions (audio)content[].audio_url.urlAny public audio URL
Image generation (edit / variation)image: ["https://..."]Up to N URLs (model-specific limit)
Video generation (i2v / r2v / edit)image: "https://..." / video: "https://..."Public URLs
Audio TTS / musicn/a (text-only input)-
Audio transcriptionfile_url: "https://..." or multipart file=@local.mp3Public URL or direct upload of short clips
Searchn/a (query text)-
Embeddings (multimodal)input[].url (image/video item)Public URLs
Reranksn/a (text query + text documents)-
DecisionsMedia nodes anywhere in state, for example {"type": "image", "url": "https://..."}Public https:// URLs, or base64 data with mime

For audio transcription specifically, the multipart-direct upload on /v1/audio/transcriptions is the supported path for private clips that aren’t on a URL; those bytes flow straight to the speech-to-text model service without persistent storage.

Generated output URLs are signed and expire 7 days after creation. There is no re-sign endpoint. Save anything you need to keep (both the URL and the binary) within that window.

Async jobs

GET /v1/jobs/<job-id> polls the status / final result of any async generation or transcription job. GET /v1/jobs lists your last 100 jobs, filterable by status (processing, completed, failed, or cancelled). Job ids are UUIDs.

Job state is retained for 1 hour after completion.

Job state shape
{
"job_id": "5f3c9a2e-8d14-4b6f-a0e7-1c2d3e4f5a6b",
"status": "processing | completed | failed | cancelled",
"created_at": 1778000000,
"completed_at": 1778000041,
"endpoint": "/v1/videos/generations",
"model": "<model id>",
"result": null,
"error": null
}

created_at and completed_at are Unix timestamps in seconds. completed_at appears once the job has finished.

When status is completed, the result field carries the full response in the same shape the synchronous endpoint would have returned.

A request stays open for up to 15 minutes. Requests that return audio or a text file must finish within 5 minutes. Longer generation work runs as an async job: poll it with GET /v1/jobs/<job-id>. A longer text response runs over WebSocket mode.

Models

GET /v1/models lists every available model.

GET /v1/models/<model-id> returns the full schema for one model, including its parameter table.

Both are public: a request without an API key is answered, and a request that sends a key that does not verify returns 401.

Each model returns:

FieldDescription
idCanonical slug (e.g. wan2-7-image)
objectAlways model
createdUnix seconds of the model’s release date, or 1735689600 when it is not known
owned_byThe model’s author, as in author
descriptionShort marketing description
categorytext / image / video / audio / transcription / research / embedding / reranker / ocr / decision / tools / 3d
input_modalitiesWhat the model accepts
output_modalitiesWhat the model emits
context_windowTokens (chat) or null (media)
logoCDN URL to the model logo
pricing_rowsPer-token, per-image, per-second, or per-call rates
pricingUSD per token (prompt, completion, input_cache_read) and per image or request, as strings; "-1" where the model is not priced per token, with its rates in unit_pricing
unit_pricingThe rates in pricing_rows that have one exact price per unit, as {unit, usd, label}, for example {"unit": "minute", "usd": "0.03"}; tiered and ranged rates appear in pricing_rows only
supported_endpointsWhich endpoints accept this model; one that lists POST /v1/chat/completions also accepts POST /v1/completions and the /v1beta Gemini routes
supported_parametersFull schema: name, label, type, description, default, min/max, and options for enum parameters
featuresTags like streaming, vision, tool_calling, voice_cloning
structured_outputjson_schema (strict schema enforcement), json_object (JSON mode), none, or null
batch_supportedbatch when the model is available on the Batch API; otherwise none or null
batch_discount_pctPercent off list price for Batch API requests; 0 when batch runs at list price, null when the model is not on the Batch API

GET /v1/models/<model-id> also returns default_params, the default of every parameter that has one.

curl https://api.empiriolabs.ai/v1/models | jq '.data[0]'
curl https://api.empiriolabs.ai/v1/models/wan2-7-image | jq '.supported_parameters'

disable_formatting flag

Many chat, search, research, and rerank endpoints accept a disable_formatting=true flag. When set on a supporting model, the answer comes back without EmpirioLabs formatting, such as the Sources list that web search adds, citation links, a References block, or reasoning Markdown.

Coverage is per model: a model honors the flag when disable_formatting is in its supported_parameters on GET /v1/models/{id}, and the parameter’s description on the model page says exactly what it changes for that model.

Image, video, audio-generation, transcription, and embedding endpoints do not accept this flag, since there is no formatting layer to disable on those endpoints.

Generated media retention

Generated images, videos, and audio are returned as signed URLs that are valid for 7 days. After that, the URL stops working and the asset is gone; there is no re-sign endpoint. Save anything you want to keep before the 7-day window expires.

Errors

Every OpenAI-compatible endpoint answers an error with the OpenAI envelope. param and code are null when they do not apply, and request_id matches the x-request-id header:

{
"error": {
"message": "temperature must be between 0 and 1.99.",
"type": "invalid_request_error",
"param": "temperature",
"code": "invalid_value",
"request_id": "req_3f6c2a9e-5b1d-4c8e-9f70-2a4b6c8d0e1f"
}
}

/v1/messages and /v1/messages/count_tokens answer with the Anthropic envelope:

{ "type": "error", "error": { "type": "invalid_request_error", "message": "..." }, "request_id": "req_..." }

The /v1beta Gemini endpoints answer with the Google envelope, where code is the HTTP status:

{ "error": { "code": 400, "message": "...", "status": "INVALID_ARGUMENT" } }

See Errors and Status Codes for what each status means and when to retry.

Headers reference

HeaderRequiredPurpose
Authorization / x-api-keyyesBearer token authentication
x-goog-api-keyon the /v1beta Gemini endpoints, instead of the aboveGemini client authentication
Content-Typeyes on POSTapplication/json or multipart/form-data
anthropic-versionnoAnthropic API version (e.g. 2023-06-01), which Anthropic SDKs send on /v1/messages; optional

Browse the per-model parameter schemas under Authors and Models. When you click into a specific model, every parameter the model accepts (type, default, range, allowed values, conditional flags) is documented in a table generated from the live database.