---
title: "Create images"
method: POST
path: "/v1/images/generations"
---

# Create images

`POST /v1/images/generations`

Generate images from a text prompt using OpenAI-compatible request shapes on DeerAPI. For the latest model-specific output controls and parameter support, refer to the OpenAI image generation guide: https://developers.openai.com/api/docs/guides/image-generation

## Request body

- object
  - `model` string, required — The image generation model to use. Choose a current model from the [Models page](https://api.deerapi.com/pricing).
  - `prompt` string, required — Text description of the image you want to generate.
  - `n` integer — Number of images to generate. Keep this at 1 for the broadest compatibility.
  - `quality` string — Quality setting for models that support it. See the OpenAI image generation guide for the latest model-specific values.
  - `size` string — Requested output size. Supported values depend on the selected model. See the OpenAI image generation guide for the latest model-specific ranges.
  - `response_format` 'url' | 'b64_json' — The response container for `dall-e-2` and `dall-e-3`. This parameter is not supported for GPT image models, which return base64-encoded image data.
  - `output_format` string — The encoded image type for GPT image model results, such as `png`, `jpeg`, or `webp`. See the OpenAI image generation guide for current GPT image output controls.

## Response `200`

Image generation result.

- object
  - `created` integer, required — Unix timestamp for the completed generation.
  - `background` string — Background mode returned by models that expose it.
  - `output_format` string — Encoded image type returned by GPT image models.
  - `quality` string — Quality level returned by models that expose it.
  - `size` string — Output size returned by models that expose it.
  - `usage` object, required
    - `input_tokens` integer
    - `output_tokens` integer
    - `total_tokens` integer
    - `input_tokens_details` object
      - `image_tokens` integer
      - `text_tokens` integer
  - `data` object[], required
    - `url` string — Temporary image URL when the selected model supports URL output.
    - `b64_json` string — Base64-encoded image payload for models that return inline content.
    - `revised_prompt` string — Provider-rewritten prompt, when available.

---

[API](https://skmtc.net/deerapi/apis/text-to-audio-api.md) · [All operations](https://skmtc.net/deerapi/apis/text-to-audio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deerapi/text-to-audio-api/versions/b6265ced74a1/schema)
