API Reference Overview
The EmpirioLabs API speaks OpenAI- and Anthropic-compatible request shapes so any
client that talks to those providers works against https://api.empiriolabs.ai
unchanged. All requests require a bearer token (Authorization: Bearer $EMPIRIOLABS_API_KEY or the Anthropic-style x-api-key header).
Endpoints
Models as the source of truth
GET /v1/models is the canonical schema. Every model returns:
pricing_rows[]— per-token, per-image, per-second, or per-call rates with any cache or volume discounts applied.supported_parameters[]— name + type + default + range for every parameter the model accepts (including conditional parameters that only apply when another flag is set).capabilities— flags forstreaming,system_prompt,tool_calling,vision,audio_input,video_input,web_search,thinking,citations, etc.input_modalities/output_modalities— distinct lists so multimodal models that accept video as input but only emit text are not mistaken for video generators.
Universal disable_formatting flag
Every chat, search, and media endpoint accepts a disable_formatting=true
flag (also accepted as raw=true, passthrough=true, or raw_response=true).
When set, the worker skips EmpirioLabs server-side formatting (Markdown
“Thinking…” headers, citation list reformatting, code-block wrapping, etc.)
and returns the upstream payload shape verbatim. Use this when:
- You render responses yourself and want full control of the markdown.
- You feed the response into a downstream pipeline that expects the raw upstream shape.
- You are debugging why a response looks different in the playground vs your app.
Tool calling
Tool / function calling propagates straight through. Pass standard OpenAI
tools[] and tool_choice on /v1/chat/completions; the response carries
message.tool_calls[] and a downstream role: "tool" message round-trips
correctly. Anthropic-style tool blocks work the same way on /v1/messages.
Long-running requests
The platform’s inbound HTTP timeout is 15 minutes (the maximum a Railway
edge connection holds open). Anything that needs longer must use the
asynchronous POST /v1/jobs/... family:
/v1/audio/transcriptionsreturns ajob_idimmediately./v1/images/generationsand/v1/videos/generationsalways create a job (image jobs typically complete in seconds; video jobs in 1-15 minutes).- Poll
GET /v1/jobs/{job_id}every 2-10 seconds. Job state is retained for up to 1 hour after completion.
If a synchronous chat completion needs more than ~14 minutes of compute
(deep reasoning, multi-step research), set stream=true so partial output
is returned as it arrives.
Generated media retention
All generated images, videos, audio, and stored transcript files live on the
EmpirioLabs media CDN at https://media.empiriolabs.ai. URLs returned by the
API are signed with a 7-day expiry. The underlying objects are deleted
after 30 days. Save anything you need to keep — both at the URL level and
the file level — within that window.
Errors
Errors come back in OpenAI’s shape ({"error": {"message", "type", "code"}})
on chat/responses endpoints, and Anthropic’s shape on /v1/messages. Errors
never leak the upstream provider name, internal hostnames, or provider
request IDs — those are stripped by the gateway and worker layers before the
response reaches you.
How to use the generated reference
- Open API Reference in the top navigation tab.
- Inspect endpoint details, required fields, and example payloads.
- Use the example responses to align your integration with the documented contract.
- Use AI Agent Access when you want an AI coding
assistant to read the docs through
llms.txtor machine-readable API schemas.
If you’re onboarding a new integration, start with Getting Started for a quick walkthrough, then move into the generated reference for full request and response details.
