API de relay: images
Esta página se genera a partir de docs-site/openapi/relay.yaml. Su contenido está en inglés; no la edites a mano.
Image generation and editing (OpenAI shape).
POST /v1/images/generations
Sección titulada «POST /v1/images/generations»Image generation
operationId relayImagesGenerations · auth: bearerAuth
Models priced per image report no usage; the gateway appends {"usage":{"cost":C}}
so the cost stays visible.
Request body (required) application/json — ImageGenerationRequest
provider(RoutingPreferences) — Per-request routing wishes (OpenRouter-style). Use only the keys listed here: the Anthropic and Gemini dialects reject unknown keys with 400, and the others may ignore them. See docs/routing for the exact ranking.order(array of string) — Provider tags to try first, in this order. Matching is case-insensitive.only(array of string) — Use only these providers. 400provider_not_foundwhen none of them offers the model.ignore(array of string) — Never use these providers.sort(“price” | “latency” | “throughput”) — Rank the providers that are not named inorder. Providers with no measurement yet rank last.allow_fallbacks(boolean) —falsetogether withorder(or amodel:providerpin) restricts routing to those providers. Withoutorderor a pin it has no effect.
models(array of string) — Fallback list. The first entry that differs frommodelis tried after every provider ofmodelhas failed before the response started. One fallback model is used; further entries are ignored. The fallback is billed at its own price.usage(UsageSwitch) — Accepted and removed before the request reaches the provider. The cost is always returned; the switch exists so that clients written for other gateways keep working.include(boolean)
model(string, required)prompt(string, required)n(integer)size(string)quality(string)
| Status | Meaning | Body |
|---|---|---|
| 200 | The images. | application/json OpenAIObject |
| default | Error in the OpenAI envelope (error.message, error.type, error.param, error.code). |
application/json OpenAIError |
Response 200 application/json — OpenAIObject
The provider-shaped response object of the dialect, with cost added inside its usage object.
POST /v1/images/edits
Sección titulada «POST /v1/images/edits»Image edit (multipart)
operationId relayImagesEdits · auth: bearerAuth
Body limit is GATEWAY_MAX_MULTIPART_BYTES (default 100 MiB).
Request body (required) multipart/form-data — MultipartForm
Form fields of the OpenAI endpoint (file, model, …), plus the optional gateway fields provider and models as JSON strings.
| Status | Meaning | Body |
|---|---|---|
| 200 | The edited images. | application/json OpenAIObject |
| default | Error in the OpenAI envelope (error.message, error.type, error.param, error.code). |
application/json OpenAIError |
Response 200 application/json — OpenAIObject
The provider-shaped response object of the dialect, with cost added inside its usage object.