> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poyo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT Image 1.5

> The GPT Image 1.5 API generates or edits images. Output size is 1024x1024, 1024x1536, or 1536x1024, and the edit model supports masks.

> [!TIP]
>
> 1. After submission, a `task_id` will be returned. If you provided a `callback_url`, when the task status becomes `finished` or `failed`, a POST request will be sent to the `callback_url`.
> 2. Regardless of whether `callback_url` is provided, you can retrieve the result through the unified [Query Task Status](https://docs.poyo.ai/api-manual/task-management/status.md) endpoint.

Generate high-quality images using GPT Image 1.5 models. Supports text-to-image, image-to-image, and advanced image editing capabilities.

## Models

* **gpt-image-1.5** - Text-to-image and image-to-image generation
* **gpt-image-1.5-edit** - Advanced image editing with mask support

## Size

`input.size` accepts `1024x1024`, `1024x1536`, or `1536x1024`. It defaults to `1024x1024` when omitted.


## OpenAPI

````yaml api-manual/image-series/gpt-image-1.5.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: PoYo AI - GPT Image 1.5 API
  description: GPT Image 1.5 Generation and Editing
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - GPT Image 1.5
      summary: Submit GPT Image 1.5 Generation Task
      description: Generate or edit images using GPT Image 1.5 models
      operationId: submitGPTImage15Task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              gpt-image-1.5:
                summary: GPT Image 1.5 Generation
                value:
                  model: gpt-image-1.5
                  callback_url: https://your-domain.com/callback
                  input:
                    prompt: A serene mountain landscape at sunset with vibrant colors
                    size: 1024x1024
                    'n': 1
              gpt-image-1.5-edit:
                summary: GPT Image 1.5 Edit
                value:
                  model: gpt-image-1.5-edit
                  callback_url: https://your-domain.com/callback
                  input:
                    prompt: Replace the sky with a starry night sky
                    image_urls:
                      - https://example.com/original-image.jpg
                    mask_url: https://example.com/mask.png
                    size: 1024x1024
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 400
                error:
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 401
                error:
                  message: Unauthorized - Invalid API key
                  type: authentication_error
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
      properties:
        model:
          type: string
          description: GPT Image 1.5 model identifier
          enum:
            - gpt-image-1.5
            - gpt-image-1.5-edit
        callback_url:
          type: string
          format: uri
          description: Webhook callback URL for result notifications
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - prompt
          description: Input parameters for generation
          properties:
            prompt:
              type: string
              description: Generation prompt describing the desired output
              maxLength: 1000
              example: A beautiful sunset over the ocean
            image_urls:
              type: array
              items:
                type: string
                format: uri
              description: Reference image URLs (for image editing)
              example: []
            size:
              type: string
              description: Output image dimensions
              enum:
                - 1024x1024
                - 1024x1536
                - 1536x1024
              default: 1024x1024
              example: 1024x1024
            'n':
              type: integer
              description: Number of images to generate
              enum:
                - 1
                - 2
                - 3
                - 4
              example: 1
            mask_url:
              type: string
              format: uri
              description: Mask image URL for editing
              example: https://example.com/mask.png
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
          description: >-
            Business status code. `200` means success; any other value means the
            request failed. Always check this field: some validation errors
            return HTTP 200 with `code: 400` in the body.


            - `200`: Success

            - `400`: Invalid request parameters

            - `401`: Missing or invalid API key

            - `402`: Insufficient credits

            - `403`: Permission denied

            - `404`: Resource not found

            - `408`: Request timeout

            - `429`: Rate limit exceeded

            - `500`: Internal server error

            - `502`: Upstream service error

            - `503`: Service unavailable


            See [Error Codes](/api-manual/error-codes) for details.
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1757165031-uyujaw3d
              description: Unique task identifier for status tracking
            status:
              type: string
              enum:
                - not_started
                - running
                - finished
                - failed
              example: not_started
              description: >-
                Task status. Always `not_started` right after submission. Use
                [Query Task Status](/api-manual/task-management/status) or
                `callback_url` to get later states.


                - `not_started`: Queued, waiting to be processed

                - `running`: Being generated

                - `finished`: Completed; results are in `files` or `output`

                - `failed`: Failed; details are in `error_message`
            created_time:
              type: string
              format: date-time
              example: '2025-11-12T10:30:00'
              description: ISO 8601 timestamp when the task was created
    ErrorResponse:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: integer
          example: 400
          description: >-
            Business status code. `200` means success; any other value means the
            request failed. Always check this field: some validation errors
            return HTTP 200 with `code: 400` in the body.


            - `200`: Success

            - `400`: Invalid request parameters

            - `401`: Missing or invalid API key

            - `402`: Insufficient credits

            - `403`: Permission denied

            - `404`: Resource not found

            - `408`: Request timeout

            - `429`: Rate limit exceeded

            - `500`: Internal server error

            - `502`: Upstream service error

            - `503`: Service unavailable


            See [Error Codes](/api-manual/error-codes) for details.
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              example: Invalid request parameters
              description: Error message describing what went wrong
            type:
              type: string
              example: invalid_request_error
              description: Error type identifier
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        All API endpoints require Bearer Token authentication.


        Create an API key: sign in to PoYo, open **Dashboard → API Key** at
        [poyo.ai/dashboard/api-key](https://poyo.ai/dashboard/api-key), and
        click to create a key.


        Add it to the request header:


        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.