Esc to close · ⌘K / Ctrl-K opens search anywhere
BharatRouter serves text-to-image the same way it serves chat and audio: one API key, the OpenAI wire format, INR pricing. Image models are a routed modality — a request is expanded into an ordered candidate list and tried with circuit-breaker failover across providers. The route that served the request is echoed in the x-br-provider response header.
Served text-to-image over an OpenAI-compatible surface. Today it is BYOK-only: open models FLUX.1 and SDXL route across multiple providers for price/latency/failover using your own provider key. A first-party, India-resident Krutrim Cloud image SKU is planned but not yet enabled — so there is no platform-billed or India-resident image route at the moment.
POST /v1/images/generations — JSON body. The reply is the OpenAI images shape: { "created": …, "data": [{ "url" | "b64_json" }] }. Every failure returns a clean OpenAI-shaped error object — never a fake 200with an empty data array.
| Field | Meaning |
|---|---|
model | Image model id — sdxl, flux-1-schnell, flux-1-dev (default sdxl). |
prompt (required) | The text prompt. Treated as content — see Privacy. |
n | Number of images (default 1, clamped to a small max). |
size | e.g. 1024x1024 (default), 512x512. |
response_format | url (default) or b64_json. |
quality, user | Optional, passed through where the upstream supports them. |
BharatRouter extras (same as chat/audio): provider (pin a provider), data_policy ("india_only"), optimize(cost/latency/quality/…), exclude(drop providers/models), and upstream_key (per-request BYOK).
Set "data_policy": "india_only" to pin a request to India-resident routes. There is no India-resident image route enabled today (the first-party Krutrim image SKU is pending), so india_only currently returns an honestno_route for every image model rather than silently leaving the country. This flips on automatically once the Krutrim image route is enabled.
Every image route is BYOK-only (bring your own provider key): metered for usage value and budget governance, but no BharatRouter money debit(cost_uinr = 0) — the per-image prices in the catalog are estimates, not charges. Providers are reached three ways: a clean passthrough (the OpenAI/images/generations wire shape), a bespoke per-provider adapter, or an async submit-and-poll adapter (bounded — a job that never finishes fails cleanly, it never hangs).
| Model | Routes |
|---|---|
sdxl | SDXL on DeepInfra / Nebius / Together / Fireworks / Hyperbolic (BYOK). Novita SDXL is async (deferred). Krutrim diffusion1XL (India, platform key) is pending. |
flux-1-schnell | FLUX.1-schnell (Apache-2.0) across DeepInfra / Nebius / Novita / SiliconFlow / NVIDIA / Together / Fireworks / Hyperbolic / Replicate (BYOK). |
flux-1-dev | FLUX.1-dev across DeepInfra / Nebius / SiliconFlow / Together / NVIDIA / Venice / Fireworks / Hyperbolic (BYOK). |
flux-1-pro | FLUX 1.1 Pro on Together (BYOK). |
cogview-4 | Z.ai (Zhipu) CogView-4 (BYOK). |
qwen-image | Qwen-Image (Apache-2.0) across SiliconFlow / NVIDIA / Alibaba DashScope (async) (BYOK). |
sd-3.5-large | Stable Diffusion 3.5 Large on NVIDIA / Venice (BYOK). |
seedream | ByteDance Seedream 4 on Volcengine / BytePlus (BYOK). |
gemini-image | Google Gemini 2.5 Flash Image (BYOK, b64 only). |
minimax-image | MiniMax image-01 (BYOK). |
step-1x | StepFun Step-1X (BYOK). |
grok-2-image | xAI Grok-2 image (BYOK; xAI ignores size/quality). |
gpt-image-1, gpt-image-1-mini, dall-e-3 | OpenAI image models (BYOK). |
| Tier | How it is reached | Providers |
|---|---|---|
| Clean passthrough | OpenAI /images/generations wire shape, unchanged | OpenAI, Together, DigitalOcean, StepFun, Venice, NVIDIA, xAI, Volcengine, Zhipu |
| Bespoke adapter | Non-OpenAI request/response shape, normalized by BharatRouter | Novita, Fireworks, Hyperbolic, SiliconFlow, MiniMax, Gemini |
| Async submit + poll | Submit a job, then poll to completion (bounded) | Alibaba DashScope, Replicate |
URL expiry caveat. DashScope, Replicate, MiniMax and Seedream return image URLs that expire ~24h after generation; Gemini (and Imagen) returnbase64 only. In v1 BharatRouter passes the provider URL or base64 throughas-is — there is no re-hosting store — so if you need a durable copy, request"response_format": "b64_json" where the provider supports it, or download the URL promptly.
The foreign SDXL/FLUX routes are bring-your-own-key: save a provider key (Account → Provider keys) or pass upstream_key per request, and BharatRouter routes to that provider on your key. BYOK requests are metered for usage value and budget governance but incur no BharatRouter money debit — identical to chat. Per-imageinrPerImage is a catalog estimate of usage value, not a charge.
URL response (default):
curl https://api.bharatrouter.com/v1/images/generations \
-H "Authorization: Bearer br-..." -H "Content-Type: application/json" \
-d '{
"model": "sdxl",
"prompt": "a lotus blooming over a misty lake at dawn",
"n": 1,
"size": "1024x1024",
"data_policy": "india_only"
}'Base64 response (b64_json):
curl https://api.bharatrouter.com/v1/images/generations \
-H "Authorization: Bearer br-..." -H "Content-Type: application/json" \
-d '{
"model": "flux-1-schnell",
"prompt": "a peacock in a monsoon garden, watercolour",
"response_format": "b64_json",
"upstream_key": "YOUR_PROVIDER_KEY"
}'Flat INR per generated image (v1). Cost is metered through the standard billable path (non-BYOK, successful, standard tier) and surfaces inUsage & activity like every other request. Per-megapixel × steps metering is deferred.
Note: the per-image prices in the catalog areestimates pending confirmation and may change before general availability.
Image Sangam is the image analog of Sangamconsensus: a panel of image models generates in parallel, and an India-resident vision judge picks the single best image by prompt-adherence, correctness, and quality. Because you select one image (you can't merge pixels), the image "synthesizer" is a best-of-N judge, not a fuse. This is distinct from the console's COMPARE grid (which just shows all N) and from chat Sangam's text synthesizer.
Call it exactly like any image model — the built-in id isbharatrouter/image-sangam (panel: flux-1-schnell +flux-1-dev + sdxl; judge: a vision model). The reply is the normal OpenAI images shape with the chosen image, plus a br_sangam block (and anx-br-sangam header) describing the panel, the chosen index, the judge, and whether judging actually ran.
curl https://api.bharatrouter.com/v1/images/generations \
-H "Authorization: Bearer br-..." -H "Content-Type: application/json" \
-d '{
"model": "bharatrouter/image-sangam",
"prompt": "a lotus blooming over a misty lake at dawn",
"response_format": "b64_json",
"upstream_key": "YOUR_PROVIDER_KEY"
}'
# → { "created": …, "data": [{ "b64_json": "…chosen…" }],
# "br_sangam": { "kind": "image",
# "panel": [{"model":"flux-1-schnell","provider":"…","ok":true}, …],
# "chosen": {"model":"flux-1-dev","provider":"…","index":0},
# "judge_model": "qwen2.5-vl-7b-instruct", "judged": true,
# "reason": "best matched the prompt's lighting and composition" } }Residency. The panel images may be foreign-BYOK — that is your own BYOK choice, and they left India at generation time. The judge is independent: under "data_policy": "india_only" (or a residency:india variant) the judge sub-call pins india_only in its body, so the generated images never leave the country to be scored. If no India-resident vision route is available underindia_only, the judge simply fails open (below) rather than routing off-shore.
Cost ≈ the panel per-image usage-value + one judge call. Each panel image meters through the standard images path and the judge meters through the standard chat path — no new money code, no double-charge.
Fail-open (never worse than a single generation). If the judge errors, times out, or returns garbage, the first successful panel image is returned withjudged:false. If only one panel image succeeds it is returned without a judge call; if none succeed you get the images plane's normal clean error — never a fake200.
The image prompt is content. BharatRouter iszero-retention by default (DPDP): the prompt is forwarded to the chosen provider to generate the image and is never logged — only routing and metering metadata (model, provider, image count, status, latency, residency) is recorded. Image Sangam is the same: the br_sangam / x-br-sangam metadata iscontent-free (panel size, chosen index, judge model, judged flag) — never image bytes or the prompt; the images forwarded to the judge are never logged.