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

> ## Agent Instructions
> Send API requests to https://api.ttapi.io with the TT-API-KEY header. Midjourney account hosting uses https://hold.ttapi.io. Claude Code uses https://cc.ttapi.io.
> Most generation endpoints are asynchronous. The submit response returns a job id. Poll that product's fetch endpoint, or pass a webhook on the submit request. A fetch call does not start a new generation.
> 1 USD = 100 quota. Check the pricing page for that product before estimating cost.
> This file lists the English docs. Follow every /_llms/ link recursively for the API reference, Chinese, and Russian. Open a page's .md URL for the endpoint schema.

# Текст-в-изображение (синхронный)

> Текст-в-изображение (синхронный) - Прямой возврат результата

Синхронный эндпоинт текст-в-изображение **Seedream API генерации изображений**. Результат возвращается напрямую.

## Описание синхронного эндпоинта

Все сценарии используют `POST /sd/api/v3/images/generations`, различаются только параметры:

| Сценарий | Параметры | Описание |
| :- | :- | :- |
| Текст-в-изображение | Только промпт | Генерация по промпту |
| Изображение-в-изображение | Промпт + image (один) | Редактирование, прозрачный фон |
| Слияние изображений | Промпт + image (2-10) | Слияние нескольких изображений |
| Разделение слоёв | Промпт + image + layer\_decomposition: true | Только 5.0 pro / flash |
| Интерактивное редактирование | Промпт + image | Только 5.0 pro / flash |

**Рекомендуется асинхронный эндпоинт** для продакшена.


## OpenAPI

````yaml openapi/ru/seedream-text-to-image-sync.json POST /sd/api/v3/images/generations
openapi: 3.1.0
info:
  title: Seedream - Текст-в-изображение (синхронный)
  version: 1.0.0
  description: >-
    Seedream Текст-в-изображение синхронный API - Генерация изображений только
    по текстовому промпту, прямой возврат результата.
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /sd/api/v3/images/generations:
    post:
      description: Текст-в-изображение (синхронный) - Прямой возврат результата
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextToImageRequest'
            example:
              model: doubao-seedream-5-0-pro-260628
              prompt: Яркий портрет-крупный план, богатые цвета
              size: 2K
              watermark: false
      responses:
        '200':
          description: Генерация успешна
          content:
            application/json:
              schema:
                type: object
                properties:
                  model:
                    type: string
                  created:
                    type: integer
                    description: Время создания (Unix timestamp)
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                        size:
                          type: string
                  usage:
                    type: object
                    properties:
                      generated_images:
                        type: integer
                      total_tokens:
                        type: integer
      security:
        - CustomApiKey: []
components:
  schemas:
    TextToImageRequest:
      type: object
      properties:
        model:
          type: string
          enum:
            - doubao-seedream-5-0-pro-260628
            - doubao-seedream-5-0-flash-260915
          description: Название модели.
        prompt:
          type: string
          description: Текстовый промпт.
        size:
          type: string
          description: >-
            Размер изображения. 5.0 pro/flash варианты: 1K, 1.5K, 2K (по
            умолчанию 2K), или значения пикселей.
          default: 2K
          enum:
            - 1K
            - 1.5K
            - 2K
        output_format:
          type: string
          description: Формат выходного изображения.
          default: jpeg
          enum:
            - png
            - jpeg
        response_format:
          type: string
          description: >-
            Формат ответа. `url` возвращает ссылку на изображение (24ч),
            `b64_json` возвращает Base64.
          default: url
          enum:
            - url
            - b64_json
        background:
          type: string
          description: >-
            Настройка прозрачности. `transparent`=прозрачный фон (только
            изображение-в-изображение), `opaque`=непрозрачный. Только 5.0
            pro/flash.
          default: opaque
          enum:
            - transparent
            - opaque
        watermark:
          type: boolean
          description: >-
            Добавить водяной знак. true=Отображать «AI Generated» в правом
            нижнем углу, false=Не добавлять.
          default: true
          enum:
            - true
            - false
          example: false
        optimize_prompt_options:
          type: object
          description: Конфигурация оптимизации промпта
          properties:
            mode:
              type: string
              enum:
                - standard
                - fast
              default: standard
              description: >-
                Режим оптимизации. standard=стандартный (качество выше),
                fast=быстрый (время короче, 5.0 flash не поддерживается)
      required:
        - model
        - prompt
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        Получите API ключ в <a href='https://dashboard.ttapi.io'
        target='_blank'>TTAPI Дашборд</a>.

````

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