/api/v1/imagesFor text-to-image or reference-image generation. For asynchronous tasks, cost is determined by OpenRouter usage.cost or generation metadata recorded at the terminal state.
Back to Images endpoint listRequest parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | See the OpenAPI schema for field details. |
prompt | string | Yes | See the OpenAPI schema for field details. |
size | string | No | See the OpenAPI schema for field details. |
n | integer | No | See the OpenAPI schema for field details. |
response_format | string | No | Allowed values: url, b64_json. |
provider | GrProviderConfig | No | GR provider config object used by image/video task calls. |
provider.provider_id | string | No | See the OpenAPI schema for field details. |
provider.options | object | No | See the OpenAPI schema for field details. |
Response fields
| Field | Type | Required | Description |
|---|---|---|---|
created | integer | No | See the OpenAPI schema for field details. |
data | object[] | No | See the OpenAPI schema for field details. |
usage | Usage | No | usage.cost is the upstream cost fact when present, including 0. GR billing may apply local discounts when writing final cost. |
usage.prompt_tokens | integer | No | See the OpenAPI schema for field details. |
usage.completion_tokens | integer | No | See the OpenAPI schema for field details. |
usage.total_tokens | integer | No | See the OpenAPI schema for field details. |
usage.cost | number | No | usage.cost |
usage.is_byok | boolean | No | See the OpenAPI schema for field details. |
usage.cost_details | object | No | See the OpenAPI schema for field details. |
usage.prompt_tokens_details | object | No | See the OpenAPI schema for field details. |
usage.completion_tokens_details | object | No | See the OpenAPI schema for field details. |
usage.server_tool_use | object | No | See the OpenAPI schema for field details. |
Errors
401
UNAUTHORIZEDMissing or invalid Authorization Bearer token.
403
FORBIDDENThe current API key is not authorized for this scope, model, or management capability.
422
VALIDATION_ERRORThe request body, path parameters, or query parameters do not match the endpoint schema.
Notes
- Use a GlobalRouter API key; upstream OpenRouter API keys are never exposed to tenants.
- An image endpoint provider object must exactly match the OpenRouter provider routing object; a GR provider wrapper is not automatically equivalent.
- Upstream OpenRouter keys exist only in server-side configuration, never in requests or responses.