OpenAI APIs Images API

Image generation, editing, and variation operations

Operations 3

POST /images/generations OpenAI APIs Create image #
POST /images/edits OpenAI APIs Create image edit #
POST /images/variations OpenAI APIs Create image variation #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/openai-apis-images-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

openai-apis-images-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenAI APIs OpenAI Assistants Images API
  description: API for building AI assistants with custom instructions, knowledge retrieval, code execution, and function calling capabilities. Supports managing assistants, threads, messages, and runs.
  version: '2.0'
  contact:
    name: OpenAI Support
    email: support@openai.com
    url: https://help.openai.com
  termsOfService: https://openai.com/policies/terms-of-use
servers:
- url: https://api.openai.com/v1
  description: OpenAI Production API
security:
- bearerAuth: []
tags:
- name: Images
  description: Image generation, editing, and variation operations
paths:
  /images/generations:
    post:
      operationId: createImage
      summary: OpenAI APIs Create image
      description: Creates an image given a text prompt using DALL-E models.
      tags:
      - Images
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateImageRequest'
      responses:
        '200':
          description: Image generation response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized - invalid or missing API key
        '429':
          description: Rate limit exceeded
        '500':
          description: Server error
  /images/edits:
    post:
      operationId: createImageEdit
      summary: OpenAI APIs Create image edit
      description: Creates an edited or extended image given an original image and a prompt. The mask specifies which areas of the image to edit.
      tags:
      - Images
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateImageEditRequest'
      responses:
        '200':
          description: Image edit response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized - invalid or missing API key
        '429':
          description: Rate limit exceeded
  /images/variations:
    post:
      operationId: createImageVariation
      summary: OpenAI APIs Create image variation
      description: Creates a variation of a given image.
      tags:
      - Images
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateImageVariationRequest'
      responses:
        '200':
          description: Image variation response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized - invalid or missing API key
        '429':
          description: Rate limit exceeded
components:
  schemas:
    CreateImageVariationRequest:
      type: object
      required:
      - image
      properties:
        image:
          type: string
          format: binary
          description: The image to use as the basis for variation(s)
        model:
          type: string
          default: dall-e-2
          description: The model to use for creating variations
        n:
          type: integer
          minimum: 1
          maximum: 10
          default: 1
          description: The number of images to generate
        response_format:
          type: string
          enum:
          - url
          - b64_json
          default: url
          description: The format in which the generated images are returned
        size:
          type: string
          enum:
          - 256x256
          - 512x512
          - 1024x1024
          default: 1024x1024
          description: The size of the generated images
        user:
          type: string
          description: A unique identifier representing your end-user
    CreateImageEditRequest:
      type: object
      required:
      - image
      - prompt
      properties:
        image:
          type: string
          format: binary
          description: The image to edit (PNG, less than 4MB, square)
        mask:
          type: string
          format: binary
          description: Additional image whose transparent areas indicate where to edit
        prompt:
          type: string
          maxLength: 1000
          description: A text description of the desired edits
        model:
          type: string
          default: dall-e-2
          description: The model to use for image editing
        n:
          type: integer
          minimum: 1
          maximum: 10
          default: 1
          description: The number of images to generate
        size:
          type: string
          enum:
          - 256x256
          - 512x512
          - 1024x1024
          default: 1024x1024
          description: The size of the generated images
        response_format:
          type: string
          enum:
          - url
          - b64_json
          default: url
          description: The format in which the generated images are returned
        user:
          type: string
          description: A unique identifier representing your end-user
    CreateImageRequest:
      type: object
      required:
      - prompt
      properties:
        prompt:
          type: string
          maxLength: 4000
          description: A text description of the desired image(s)
        model:
          type: string
          default: dall-e-2
          description: The model to use for image generation (dall-e-2 or dall-e-3)
          examples:
          - dall-e-3
        n:
          type: integer
          minimum: 1
          maximum: 10
          default: 1
          description: The number of images to generate
        quality:
          type: string
          enum:
          - standard
          - hd
          default: standard
          description: The quality of the image (dall-e-3 only)
        response_format:
          type: string
          enum:
          - url
          - b64_json
          default: url
          description: The format in which the generated images are returned
        size:
          type: string
          enum:
          - 256x256
          - 512x512
          - 1024x1024
          - 1792x1024
          - 1024x1792
          default: 1024x1024
          description: The size of the generated images
        style:
          type: string
          enum:
          - vivid
          - natural
          default: vivid
          description: The style of the generated images (dall-e-3 only)
        user:
          type: string
          description: A unique identifier representing your end-user
    ImageResponse:
      type: object
      properties:
        created:
          type: integer
          description: Unix timestamp of when the image was created
        data:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
                description: The URL of the generated image (when response_format is url)
              b64_json:
                type: string
                description: Base64-encoded JSON of the image (when response_format is b64_json)
              revised_prompt:
                type: string
                description: The revised prompt used for generation (dall-e-3 only)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: OpenAI API key passed as a Bearer token
externalDocs:
  description: OpenAI Assistants API Documentation
  url: https://platform.openai.com/docs/api-reference/assistants