---
title: "Generates one standard image as base64."
method: POST
path: "/openai/{region}/v1/images/generations"
tags: ["Images"]
---

# Generates one standard image as base64.

`POST /openai/{region}/v1/images/generations`

## Request

- Base URL: `https://api.langdock.com`
- URL: `https://api.langdock.com/openai/{region}/v1/images/generations`
- Auth: HTTP bearer

Generates one standard-resolution image with a Completion API key. Returns b64_json only. Does not support n other than 1, URL output, HD, or image edits. A detected safety refusal returns 400 with a stable content filter message.

## Path parameters

- `region` 'eu' | 'us', required

## Request body

- object
  - `model` string, required: Image generation model ID from your workspace. GET /openai/{region}/v1/models lists chat models, not image models.
  - `prompt` string, required: The image description.
  - `n` 1: Number of images. Only 1 is supported.
  - `size` 'auto' | '1024x1024' | '1536x1024' | '1024x1536': Output size. auto and 1024x1024 map to square, 1536x1024 to landscape, and 1024x1536 to portrait.
  - `quality` 'auto' | 'low' | 'medium' | 'high': Quality hint forwarded to the image model. Not every image model uses it.
  - `response_format` 'b64_json': Response format. Only b64_json is supported.
  - `user` string: Optional end-user identifier. Accepted for OpenAI compatibility.

## Response `200`

OK

- object
  - `created` integer, required: Unix timestamp in seconds.
  - `data` object[], required
    - `b64_json` string, required: Base64-encoded image.
    - `revised_prompt` string: Revised prompt when the model returns one.

## Other responses

- `400`: Invalid fields, an unavailable image model, no image models in the region, or a detected safety refusal by the image model. Refused requests are not billed.
- `401`: Missing, invalid, or expired API key.
- `403`: API key without the Completion API scope.
- `429`: Usage or rate limit exceeded.
- `500`: Internal server or upstream provider error.
- `504`: The model did not respond in time. Please retry.

## Changes

- **2026-11-03** `c62bf90b4013`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langdock/apis/langdock-api/changes/openai/:region/v1/images/generations/post.md)

---

[API](https://skmtc.dev/langdock/apis/langdock-api.md) - [All operations](https://skmtc.dev/langdock/apis/langdock-api/llms.txt) - [OpenAPI document](https://skmtc.dev/langdock/apis/langdock-api/revisions/c62bf90b4013?raw)
