---
title: "Create image"
method: POST
path: "/openai/v1/images/generations"
tags: ["OpenAI Integration"]
---

# Create image

`POST /openai/v1/images/generations`

Generates images from text prompts using OpenAI-compatible format.

**Note:** Azure OpenAI deployments are also supported via the Azure integration endpoint.

**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/images/generations`).

## Request body

- object
  - `model` string, required — Model identifier
  - `prompt` string, required — Text prompt to generate image
  - `n` integer — Number of images to generate
  - `size` '256x256' | '512x512' | '1024x1024' | '1792x1024' | '1024x1792' | '1536x1024' | '1024x1536' | 'auto' — Size of the generated image
  - `quality` 'standard' | 'hd' — Quality of the generated image
  - `style` 'natural' | 'vivid' — Style of the generated image
  - `response_format` 'url' | 'b64_json' — Format of the response. This parameter is not supported for streaming requests.
  - `user` string — User identifier for tracking
  - `stream` boolean — Whether to stream the response. When true, images are sent as base64 chunks via SSE.
  - `fallbacks` string[] — Fallback models to try if primary model fails

## Response `200`

Successful response. Returns JSON for non-streaming requests, or Server-Sent Events (SSE) stream when `stream=true`.
When streaming, each event contains a chunk of the image as base64 data, with the final event having type `image_generation.completed`.

- object
  - `created` integer — Unix timestamp when the image was created
  - `data` object[] — Array of generated images
    - `url` string, uri — URL of the generated image
    - `b64_json` string — Base64-encoded image data
    - `revised_prompt` string — Revised prompt used for generation
    - `index` integer — Index of this image
  - `background` string — Background type used
  - `output_format` string — Output format used
  - `quality` string — Quality setting used
  - `size` string — Size setting used
  - `usage` object
    - `input_tokens` integer — Number of input tokens
    - `input_tokens_details` object
      - `image_tokens` integer — Tokens used for images
      - `text_tokens` integer — Tokens used for text
    - `total_tokens` integer — Total tokens used
    - `output_tokens` integer — Number of output tokens
    - `output_tokens_details` object
      - `image_tokens` integer — Tokens used for images
      - `text_tokens` integer — Tokens used for text

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

[API](https://skmtc.net/getbifrost/apis/bifrost-api.md) · [All operations](https://skmtc.net/getbifrost/apis/bifrost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbifrost/bifrost-api/revisions/f8cab88f64ea/schema)
