---
title: "Openai Images Generations"
method: POST
path: "/v1/images/generations"
tags: ["Image Generation"]
---

# Openai Images Generations

`POST /v1/images/generations`

Generate image using OpenAI Images API

## Headers

- `xi-api-key` string, nullable
- `x-api-key` string, nullable

## Request body

- OpenAIImagesGenerationsIn
  - `model` string, required — The model to use for image generation.
  - `n` integer — The number of images to generate.
  - `response_format` 'b64_json'
  - `size` string — The size of the generated images. Available sizes depend on the model.
  - `user` string, nullable — A unique identifier representing your end-user, which can help to monitor and detect abuse.
  - `prompt` string, required — A text description of desired image(s).
  - `quality` string, nullable — The quality of the image that will be generated.
  - `style` string, nullable — The style of the generated images.

## Response `200`

Successful Response

- OpenAIImagesOut
  - `created` integer — Unix timestamp of when the images were created
  - `data` OpenAIImageData[], required — List of generated images
    - `b64_json` string, nullable — The base64-encoded image data
    - `revised_prompt` string, nullable — The prompt used to generate this image
    - `url` string, nullable — The URL of the generated image

## Other responses

- `422` — Validation Error

---

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