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

# 文生图

> 文生图 - 提交异步图片生成任务，返回 id

这是 **Seedream 图片生成 API** 的文生图接口。仅通过 `prompt` 生成图片，不传入任何媒体文件。提交异步任务后返回 `id`，需通过查询接口获取结果。


## OpenAPI

````yaml openapi/cn/seedream-text-to-image.json POST /sd/api/v3/images/generations/tasks
openapi: 3.1.0
info:
  title: Seedream - 文生图
  version: 1.0.0
  description: Seedream 文生图接口 - 仅通过文本提示词生成图片，不传入参考图片。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /sd/api/v3/images/generations/tasks:
    post:
      description: 文生图 - 提交异步图片生成任务，返回 id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextToImageRequest'
            example:
              model: doubao-seedream-5-0-pro-260628
              prompt: 充满活力的特写编辑肖像，模特眼神犀利，头戴雕塑感帽子，色彩拼接丰富
              size: 2K
              output_format: png
              watermark: false
      responses:
        '200':
          description: 任务提交成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: PENDING_QUEUE
                    description: 任务状态
                  message:
                    type: string
                    example: success
                  id:
                    type: string
                    description: 任务 ID
                    example: 30d9b07d-7349-4cbc-8e11-9ba302c6d165
                required:
                  - status
                  - message
                  - id
      security:
        - CustomApiKey: []
components:
  schemas:
    TextToImageRequest:
      type: object
      description: 文生图请求参数
      properties:
        model:
          type: string
          description: |-
            模型名称。
            - `doubao-seedream-5-0-pro-260628`：专业版
            - `doubao-seedream-5-0-flash-260915`：快速版
          enum:
            - doubao-seedream-5-0-pro-260628
            - doubao-seedream-5-0-flash-260915
          example: doubao-seedream-5-0-pro-260628
        prompt:
          type: string
          description: 文本提示词，用于描述生成图像的内容。
        size:
          type: string
          description: 图像尺寸。5.0 pro/flash 可选：1K、1.5K、2K（默认 2K），或指定像素值如 `2048x1024`。
          default: 2K
          enum:
            - 1K
            - 1.5K
            - 2K
          example: 2K
        output_format:
          type: string
          description: 输出图像格式。
          default: jpeg
          enum:
            - png
            - jpeg
          example: png
        response_format:
          type: string
          description: 返回格式。`url` 返回图片下载链接（24h 有效），`b64_json` 返回 Base64 编码。
          default: url
          enum:
            - url
            - b64_json
          example: url
        watermark:
          type: boolean
          description: 是否添加水印。true=右下角显示「AI 生成」，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 不支持）
        execution_expires_after:
          type: integer
          default: 172800
          description: 任务超时阈值（秒）。范围 [3600, 259200]（1~72 小时），默认 172800（48 小时）
        priority:
          type: integer
          default: 0
          description: 执行优先级。范围 [0, 9]，数值越大优先级越高，默认 0（FIFO）
        safety_identifier:
          type: string
          description: 终端用户唯一标识符，不超过 64 字符。建议传入哈希处理后的字符串
      required:
        - model
        - prompt
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````

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