> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maxapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate（文生图）

> Generates images synchronously based on a given prompt and optional parameters.
根据给定的提示和可选参数同步生成图像。
返回的图像 URL 在 24 小时内有效，超过该时间将无法访问图像。
图像URL为官方原链接，请注意网络环境是否能访问。



## OpenAPI

````yaml /api-reference/openapi.json post /ideogram/generate
openapi: 3.0.1
info:
  title: MaxAPI 模型 API
  description: MaxAPI 文本、图像、视频、音频和音乐模型接口。
  version: 1.0.0
servers:
  - url: https://api.maxapi.ai
    description: MaxAPI 生产环境
security: []
tags:
  - name: 模型接口
  - name: 模型接口/绘图模型
  - name: 模型接口/绘图模型/OpenAI Dall-e 格式
  - name: 模型接口/绘图模型/Flux系列
  - name: 模型接口/绘图模型/Flux系列/OpenAI Dalle 格式
  - name: 模型接口/绘图模型/Z-image
  - name: 模型接口/绘图模型/Banana生图异步格式(未来可能兼容其他模型)
  - name: 模型接口/聊天接口（Chat）
  - name: 模型接口/视频模型
  - name: 模型接口/视频模型/谷歌veo
  - name: 模型接口/视频模型/谷歌veo/VertexAI-VEO官方格式
  - name: 模型接口/视频模型/谷歌veo/VertexAI-VEO官方格式/视频生成
  - name: 模型接口/视频模型/谷歌veo/VertexAI-VEO官方格式/任务查询
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式/视频生成
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式/任务查询
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式/下载视频(只有aistudio有这个动作)
  - name: 模型接口/视频模型/谷歌veo/GCP异步任务接口
  - name: 模型接口/视频模型/谷歌veo/官网逆向接口格式
  - name: 模型接口/视频模型/谷歌veo/官网逆向接口格式/视频生成
  - name: 模型接口/视频模型/谷歌veo/官网逆向接口格式/OpenAI官方视频格式(适配 newapi)
  - name: 模型接口/视频模型/Wan阿里万象(官方格式)
  - name: 模型接口/视频模型/豆包seedance(官方格式)
  - name: 模型接口/视频模型/Vidu官方格式
  - name: 模型接口/视频模型/Vidu官方格式/视频生成
  - name: 模型接口/视频模型/Vidu官方格式/图像生成
  - name: 模型接口/视频模型/Vidu官方格式/音频生成
  - name: 模型接口/视频模型/Vidu官方格式/其他功能
  - name: 模型接口/视频模型/Vidu官方格式/任务管理
  - name: 模型接口/视频模型/MiniMax-Hailuo官方格式
  - name: 模型接口/视频模型/MiniMax-Hailuo官方格式/视频生成
  - name: 模型接口/视频模型/MiniMax-Hailuo官方格式/任务管理
  - name: 模型接口/视频模型/MiniMax-Hailuo-OpenAI-Sora兼容格式
  - name: 模型接口/视频模型/MiniMax-Hailuo-OpenAI-Sora兼容格式/视频生成
  - name: 模型接口/视频模型/Sora-2-官方格式
  - name: 模型接口/视频模型/Sora-2-官方格式/创建角色接口
  - name: 模型接口/视频模型/Sora-2026-01-07新格式
  - name: 模型接口/自动补全接口（Completions）
  - name: 模型接口/图像接口（Images）
  - name: 模型接口/向量生成接口（Embeddings）
  - name: 模型接口/音频接口（Audio）
  - name: 模型接口/MJ图像(视频)接口
  - name: 模型接口/MJ图像(视频)接口/InsightFace任务提交
  - name: 模型接口/MJ图像(视频)接口/任务提交
  - name: 模型接口/MJ图像(视频)接口/任务查询
  - name: 模型接口/MJ图像(视频)接口/MJ视频相关
  - name: 模型接口/Suno音乐接口
  - name: 模型接口/Suno音乐接口/GoAmzAI格式
  - name: 模型接口/Suno音乐接口/GoAmzAI格式/v3.5
  - name: 模型接口/Suno音乐接口/GoAmzAI格式/v3.0
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/所有接口
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景1 生成自定义音乐(带歌词)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景 2 通过提示词直接生成音乐(带歌词)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景 4 通过提示词直接生成音乐(纯音乐)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景3 生成自定义音乐(纯音乐)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景 5 上传自定义音频并续写
  - name: 模型接口/Suno音乐接口/生成歌词
  - name: 模型接口/Suno音乐接口/NewAPI兼容格式
  - name: 模型接口/Luma视频接口
  - name: 模型接口/Luma视频接口/GoAmzAI格式
  - name: 模型接口/Luma视频接口/GoAmzAI格式/付费版
  - name: 模型接口/Luma视频接口/GoAmzAI格式/免费版
  - name: 模型接口/Luma视频接口/官网原生格式(v2)
  - name: 模型接口/SD图像接口
  - name: 模型接口/SD图像接口/SD3
  - name: 模型接口/SD图像接口/SDXL
  - name: 模型接口/Fish Audio
  - name: 模型接口/统一视频接口
  - name: 模型接口/统一视频接口/阿里Wan(万相视频
  - name: 模型接口/统一视频接口/Sora2视频
  - name: 模型接口/统一视频接口/Seedance(即梦视频
  - name: 模型接口/统一视频接口/Google-Veo
  - name: 历史接口
  - name: 历史接口/PPT类接入
  - name: 历史接口/请求示例
  - name: 历史接口/原始接口（参数需要定义后才能发送请求）
  - name: 佐糖API
  - name: MewXAI星月熊开放API
  - name: MewXAI星月熊开放API/开放API接口
  - name: MewXAI星月熊开放API/示例
  - name: Ideogram（绘画）
  - name: 可灵API
  - name: RunWay官方API
  - name: 视频生成
  - name: 任务查询
  - name: Wan官方格式
  - name: 图像生成
  - name: 音频生成
  - name: 其他功能
  - name: 任务管理
  - name: InsightFace任务提交
  - name: 任务提交
  - name: Generate
  - name: SDXL & SD1.6
paths:
  /ideogram/generate:
    post:
      tags:
        - Ideogram（绘画）
      summary: Generate（文生图）
      description: >-
        Generates images synchronously based on a given prompt and optional
        parameters.

        根据给定的提示和可选参数同步生成图像。

        返回的图像 URL 在 24 小时内有效，超过该时间将无法访问图像。

        图像URL为官方原链接，请注意网络环境是否能访问。
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
            default: '{{YOUR_API_KEY}}'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                image_request:
                  type: object
                  properties:
                    prompt:
                      type: string
                      description: The prompt to use to generate the image. 生成图像的提示。
                    aspect_ratio:
                      type: string
                      description: >-
                        (Cannot be used in conjunction with resolution) The
                        aspect ratio to use for image generation, which
                        determines the image's resolution. Defaults to
                        ASPECT_1_1. （不能与分辨率一起使用）用于图像生成的宽高比，决定图像的分辨率。默认为
                        ASPECT_1_1。
                      default: ASPECT_1_1
                    model:
                      type: string
                      description: >-
                        The model used to generate. Defaults to V_2. 用于生成的模型。默认为
                        V_2。
                      default: V_2
                      example: V_1
                    magic_prompt_option:
                      type: string
                      description: >-
                        Determine if MagicPrompt should be used in generating
                        the request or not 确定是否应该在生成请求时使用 MagicPrompt
                      default: AUTO
                      example: AUTO
                    seed:
                      type: integer
                      description: 0 to 2147483647
                    style_type:
                      type: string
                      description: >-
                        The style type to generate with; this is only applicable
                        for models V_2 and above and should not be specified for
                        model versions V_1. 生成的样式类型；这仅适用于 V_2 及以上版本的模型，不应为 V_1
                        版本的模型指定。
                      example: GENERAL
                    negative_prompt:
                      type: string
                      description: >-
                        Description of what to exclude from an image.
                        Descriptions in the prompt take precedence to
                        descriptions in the negative prompt.
                        描述从图像中排除的内容。提示中的描述优先于负提示中的描述。
                    resolution:
                      type: string
                      description: >-
                        (For model_version for 2.0 only, cannot be used in
                        conjunction with aspect_ratio) The resolution to use for
                        image generation, represented in width x height. If not
                        specified, defaults to using aspect_ratio. （仅适用于 2.0 的
                        model_version，无法与 aspect_ratio 同时使用）用于图像生成的分辨率，以宽 x
                        高表示。如果没有指定，则默认为使用 aspect_ratio。
                      example: RESOLUTION_576_1472
                  required:
                    - prompt
              required:
                - image_request
            example:
              image_request:
                model: V_2
                magic_prompt_option: AUTO
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        seed:
                          type: integer
                          description: 0 to 2147483647
                        prompt:
                          type: string
                          description: >-
                            The prompt used for the generation. This may be
                            different from the original prompt.
                            用于生成的提示。这可能与原始提示不同。
                        resolution:
                          type: string
                          description: The resolution of the final image. 最终图像的分辨率。
                        url:
                          type: string
                          description: The direct link to the image generated. 生成的图像的直接链接。
                          nullable: true
                        is_image_safe:
                          type: boolean
                          description: >-
                            Whether this request passes safety checks. If false,
                            the url field will be empty.
                            该请求是否通过安全检查。如果为假，网址字段将为空。
                      required:
                        - seed
                        - prompt
                        - resolution
                        - url
                        - is_image_safe
                  created:
                    type: string
                    description: The time the request was created. 请求创建的时间。
                required:
                  - data
                  - created
              example:
                data:
                  - seed: 12345
                    prompt: >-
                      A serene tropical beach scene. Dominating the foreground
                      are tall palm trees with lush green leaves, standing tall
                      against a backdrop of a sandy beach. The beach leads to
                      the azure waters of the sea, which gently kisses the
                      shoreline. In the distance, there's an island or landmass
                      with a silhouette of what appears to be a lighthouse or
                      tower. The sky above is painted with fluffy white clouds,
                      some of which are tinged with hues of pink and orange,
                      suggesting either a sunrise or sunset.
                    resolution: 1024x1024
                    url: >-
                      https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g
                    is_image_safe: true
                  - seed: 12345
                    prompt: >-
                      A serene tropical beach scene. Dominating the foreground
                      are tall palm trees with lush green leaves, standing tall
                      against a backdrop of a sandy beach. The beach leads to
                      the azure waters of the sea, which gently kisses the
                      shoreline. In the distance, there's an island or landmass
                      with a silhouette of what appears to be a lighthouse or
                      tower. The sky above is painted with fluffy white clouds,
                      some of which are tinged with hues of pink and orange,
                      suggesting either a sunrise or sunset.
                    resolution: 1024x1024
                    url: >-
                      https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g
                    is_image_safe: true
                created: '2000-01-23T04:56:07.000Z'
          headers: {}
      deprecated: false
      security: []

````