---
title: "Generate Images"
method: POST
path: "/v1/images/generations"
---

# Generate Images

`POST /v1/images/generations`

Generate images from text prompts using gpt-image-2-c, the cost-effective variant of GPT Image 2. Supports `response_format`. Does not support the `n` parameter (one image per request).

## Request body

- object
  - `model` 'gpt-image-2-c', required — Model ID.
  - `prompt` string, required — Text description of the desired image.
  - `size` string — Output image size in `{width}x{height}` format. Supports flexible resolutions — both edges must be multiples of 16, aspect ratio ≤ 3:1, total pixels between 655,360 and 8,294,400, max edge 3,840px.
  - `quality` 'low' | 'medium' | 'high' — Image quality.
  - `output_format` 'png' | 'jpeg' — Output image format.
  - `moderation` 'auto' | 'low' — Content moderation level.
  - `output_compression` integer — Compression level for jpeg format (0-100%).
  - `response_format` 'url' | 'b64_json' — Response format. Either `url` or `b64_json`.

## Response `200`

Images generated successfully.

- object
  - `data` object[] — Array of generated images.
    - `url` string — Pre-signed URL of the generated image (when `response_format=url`).
    - `b64_json` string — Base64-encoded image data (when `response_format=b64_json`).
    - `revised_prompt` string — The revised prompt used.

## Other responses

- `400` — Bad request. Invalid parameters.
- `401` — Unauthorized. Invalid or missing API key.

---

[API](https://skmtc.net/anyfast/apis/anthropic-claude-compatible-endpoint.md) · [All operations](https://skmtc.net/anyfast/apis/anthropic-claude-compatible-endpoint/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/anyfast/anthropic-claude-compatible-endpoint/versions/edfc53e182a1/schema)
