> ## 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-Генерация изображений [Неофициальный]

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



## OpenAPI

````yaml openapi/ru/openai.json POST /openai/gpt/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/gpt/generations:
    post:
      description: >-
        Создавайте изображения на основе текстовых подсказок и ресурсов
        изображений.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GptgenerationsRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    GptgenerationsRequest:
      type: object
      properties:
        model:
          type: string
          description: Поддерживаемые модели
          enum:
            - gpt-image-1.5
            - gpt-image-2
            - gpt-image-2-plus
          default: gpt-image-2
        prompt:
          type: string
          description: >-
            Текстовая подсказка для создания изображения. Поскольку это модель
            созданная методом обратной разработки, рекомендуется включать в
            приглашение ключевые слова, такие как: ** «нарисовать xxx», «создать
            a», «нарисовать xxx»**. Язык не ограничен; Сам OpenAI поддерживает
            многоязычные модели с отличной поддержкой китайского языка.
        referImages:
          type: array
          description: Массив эталонных изображений
          items:
            type: string
          example:
            - https://cdn.ttapi.io/xxx1.png
            - https://cdn.ttapi.io/xxx2.png
        hookUrl:
          type: string
          description: >-
            Уведомление об обратном вызове URL. Когда задача будет завершена или
            не выполнена, этот URL будет уведомлен. <a href="gpt-fetch"
            target="_self">Структура данных уведомления</a> соответствует
            структуре выборки. Если не установлено, вам необходимо запросить
            конечную точку <a href="gpt-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>.

````