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

# GPT-4o Image Generation

> Generate images based on text prompts and image resources

<Note>
  Note: This endpoint is based on reverse engineering, so stability may vary over time.
</Note>


## OpenAPI

````yaml openapi/en/openai.json POST /openai/4o-image/generations
openapi: 3.1.0
info:
  title: Open AI API DOCS
  version: 1.0.0
  description: TTAPI OpenAI API service
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /openai/4o-image/generations:
    post:
      description: Generate images based on text prompts and image resources
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FourgenerationsRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      deprecated: true
      security:
        - CustomApiKey: []
components:
  schemas:
    FourgenerationsRequest:
      type: object
      properties:
        prompt:
          type: string
          description: >-
            Text prompt for image generation. Since this is a reverse-engineered
            model, it's recommended to include keywords in your prompt such as:
            **",draw a xxx", "generate a xxx", "draw a xxx"**. Language is not
            restricted; OpenAI itself supports multilingual models with
            excellent Chinese support.
        referImages:
          type: array
          description: Reference image array
          enum:
            - >-
              https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
            - >-
              https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
        hookUrl:
          type: string
          description: >-
            Callback notification URL. When task completes or fails, this URL
            will be notified. <a href="fetch" target="_self">Notification data
            structure</a> is consistent with fetch structure. If not set, you
            need to request the <a href="fetch" target="_self">fetch
            endpoint</a> for query
      required:
        - prompt
  responses:
    SuccessResponse:
      description: Request successful
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            required:
              - status
              - message
              - data
    400Response:
      description: Parameter error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Authorization failed
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        You can obtain your API key from the <a
        href='https://dashboard.ttapi.io' target='_blank'>TTAPI Dashboard</a>.

````