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

# Text-to-Image (Sync)

> Text-to-Image (Sync) - Return generation results directly

This is the **Seedream Image Generation API** text-to-image sync endpoint. Generate images only through `prompt` without any media files. Returns generation results directly after request, no additional query needed.

## Sync Endpoint Description

Sync endpoint returns results directly without polling. All following scenarios use the same endpoint `POST /sd/api/v3/images/generations`, only parameters differ:

| Scenario | Parameter Difference | Description |
| :- | :- | :- |
| Text-to-Image | Only prompt required | Generate images only through text prompt |
| Image-to-Image | Prompt + image (single) required | Style transfer or content editing based on single reference image, supports transparent background |
| Multi-Image Fusion | Prompt + image (2-10 array) required | Fuse and generate new image based on multiple reference images |
| Layer Decomposition | Prompt + image + layer\_decomposition: true required | Decompose image into base image and layers, only 5.0 pro / flash supported |
| Interactive Edit | Prompt + image required | Precisely edit image using coordinates and bounding boxes, only 5.0 pro / flash supported |

**Recommended: Async endpoint**: Recommended to use async endpoint in production (returns `id`, use query endpoint to get results), supports webhook callback notifications, more suitable for large-scale generation scenarios.


## OpenAPI

````yaml openapi/en/seedream-text-to-image-sync.json POST /sd/api/v3/images/generations
openapi: 3.1.0
info:
  title: Seedream - Text-to-Image (Sync)
  version: 1.0.0
  description: >-
    Seedream Text-to-Image Sync API - Generate images only through text prompt,
    return results directly.
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /sd/api/v3/images/generations:
    post:
      description: Text-to-Image (Sync) - Return generation results directly
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextToImageRequest'
            example:
              model: doubao-seedream-5-0-pro-260628
              prompt: Vibrant close-up portrait, rich colors
              size: 2K
              watermark: false
      responses:
        '200':
          description: Generation successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  model:
                    type: string
                  created:
                    type: integer
                    description: Created time (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: Model name.
        prompt:
          type: string
          description: Text prompt.
        size:
          type: string
          description: >-
            Image size. 5.0 pro/flash options: 1K, 1.5K, 2K (default 2K), or
            specify pixel values.
          default: 2K
          enum:
            - 1K
            - 1.5K
            - 2K
        output_format:
          type: string
          description: Output image format.
          default: jpeg
          enum:
            - png
            - jpeg
        response_format:
          type: string
          description: >-
            Return format. `url` returns image download link (24h valid),
            `b64_json` returns Base64 encoded data.
          default: url
          enum:
            - url
            - b64_json
        background:
          type: string
          description: >-
            Image alpha channel setting. `transparent`=transparent background
            (image-to-image only), `opaque`=opaque background. Only 5.0
            pro/flash supports.
          default: opaque
          enum:
            - transparent
            - opaque
        watermark:
          type: boolean
          description: >-
            Whether to add watermark. true=Display "AI Generated" in
            bottom-right, false=Do not add.
          default: true
          enum:
            - true
            - false
          example: false
        optimize_prompt_options:
          type: object
          description: Prompt optimization config
          properties:
            mode:
              type: string
              enum:
                - standard
                - fast
              default: standard
              description: >-
                Optimization mode. standard=standard mode (higher quality),
                fast=fast mode (shorter time, 5.0 flash not supported)
      required:
        - model
        - prompt
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        Get your API key from the <a href='https://dashboard.ttapi.io'
        target='_blank'>TTAPI Dashboard</a>.

````

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