> ## 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

> Создавайте изображения на основе текстовых подсказок и ресурсов изображений.

<Note>
  Примечание: этот эндпоинт основан на обратной разработке, поэтому его стабильность со временем может меняться.
</Note>


## OpenAPI

````yaml openapi/ru/openai.json POST /openai/4o-image/generations
openapi: 3.1.0
info:
  title: Документация OpenAI API
  version: 1.0.0
  description: TTAPI OpenAI API сервис
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /openai/4o-image/generations:
    post:
      description: >-
        Создавайте изображения на основе текстовых подсказок и ресурсов
        изображений.
      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: >-
            Текстовая подсказка для создания изображения. Поскольку это модель
            созданная методом обратной разработки, рекомендуется включать в
            приглашение такие ключевые слова, как: **", "нарисовать xxx",
            "создать xxx", "нарисовать xxx"**. Язык не ограничен; Сам OpenAI
            поддерживает многоязычные модели с отличной поддержкой китайского
            языка.
        referImages:
          type: array
          description: Массив эталонных изображений
          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: >-
            Уведомление об обратном вызове URL. Когда задача будет завершена или
            не выполнена, этот URL будет уведомлен. <a href="fetch"
            target="_self">Структура данных уведомления</a> соответствует
            структуре выборки. Если не установлено, вам необходимо запросить
            интерфейс <a href="fetch" target="_self">получение результата</a>
            для запроса.
      required:
        - prompt
  responses:
    SuccessResponse:
      description: Запрос выполнен успешно
      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: Ошибка параметров
      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: Ошибка авторизации
      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: >-
        Вы можете получить API-ключ в <a href='https://dashboard.ttapi.io'
        target='_blank'>панель управления TTAPI</a>.

````