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

# Ideogram Vector 1.0

> 根据提示词生成 SVG 矢量图，最多可带五张参考图，或把一张图片转换成 SVG。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.poyo.ai/zh/api-manual/task-management/status.md)接口获取结果。

Ideogram Vector 1.0 可以根据提示词生成可编辑的 SVG，或把一张已有图片转换成 SVG。文生矢量最多可以使用五张参考图。

## 模型

* **ideogram-vector-1.0/text-to-vector** — 根据提示词生成 SVG，可选参考图
* **ideogram-vector-1.0/image-to-vector** — 把恰好一张图片转换成 SVG

## 功能

* 根据提示词生成 1–8 张 SVG，可控制质量和宽高比。
* 文生矢量可在 `image_urls` 中带 1–5 张参考图。第一张是主参考图。
* 把恰好一张 JPEG、PNG 或 WebP 图片转换成 SVG，可选保留细节或使用更少图形。

## 必填参数

* `prompt` (string)：`ideogram-vector-1.0/text-to-vector` 必填。使用 1–9500 个字符，且须包含非空白文本。
* `image_urls` (array of strings)：`ideogram-vector-1.0/image-to-vector` 必填。恰好一个可公开访问的 HTTP(S) 图片 URL，用于转换成 SVG。支持 JPEG、PNG 或 WebP，最大 50 MB。

## 可选参数

* `image_urls` (array of strings)：`ideogram-vector-1.0/text-to-vector` 可选。1–5 个可公开访问的 HTTP(S) 参考图。支持 JPEG、PNG 或 WebP，每张最大 10 MB。第一个 URL 是主参考图。没有参考图时不要传这个字段。
* `quality` (string)：仅文生矢量。`low`、`medium` 或 `high`。默认为 `medium`。
* `n` (integer)：仅文生矢量。SVG 数量，1 到 8。默认为 1。
* `size` (string)：仅文生矢量。宽高比。默认为 `auto`。
* `mode` (string)：仅图片转矢量。`default` 保留更多细节。`simple` 使用更少图形。默认为 `default`。

图片字段也接受图片 data URI。

## 尺寸

文生矢量接受 `auto`、`1:1`、`1:4`、`1:3`、`1:2`、`9:16`、`10:16`、`2:3`、`3:4`、`4:5`、`5:4`、`4:3`、`3:2`、`16:10`、`16:9`、`2:1`、`3:1` 和 `4:1`。默认为 `auto`。

图片转矢量不接受 `size`。

## 输出

完成的任务返回 SVG 文件。每个文件的 `file_type` 为 `image`。

## 示例

OpenAPI 示例包含文生矢量、带参考图的文生矢量，以及单图转矢量。

## 注意事项

* 按任务选择模型 ID。文生矢量不接受 `mode`。图片转矢量不接受 `prompt`、`quality`、`n` 或 `size`。
* 文生矢量里的 `image_urls` 是参考图。图片转矢量里的 `image_urls` 是要转换的那一张图片。
* 生成参数放在 `input` 内。`callback_url` 属于请求顶层。


## OpenAPI

````yaml zh/api-manual/image-series/ideogram-vector-1-0.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: PoYo AI - Ideogram Vector 1.0 API
  description: 根据提示词生成 SVG 矢量图，最多可带五张参考图，或把一张图片转换成 SVG。
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
    description: 生产环境
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Ideogram Vector 1.0
      summary: 提交 Ideogram Vector 1.0 任务
      operationId: submitIdeogramVector10Task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              text-to-vector:
                summary: 根据提示词生成 SVG
                value:
                  model: ideogram-vector-1.0/text-to-vector
                  input:
                    prompt: A playful cat logo with bold outlines and flat colors
              text-with-references:
                summary: 带参考图生成 SVG
                value:
                  model: ideogram-vector-1.0/text-to-vector
                  input:
                    prompt: A flat mountain travel poster
                    image_urls:
                      - https://example.com/style.png
                    quality: high
                    size: '16:9'
                    'n': 2
              image-to-vector:
                summary: 把一张图片转换成 SVG
                value:
                  model: ideogram-vector-1.0/image-to-vector
                  input:
                    image_urls:
                      - https://example.com/source.png
                    mode: simple
      responses:
        '200':
          description: 任务提交成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: 请求参数无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
            - ideogram-vector-1.0/text-to-vector
            - ideogram-vector-1.0/image-to-vector
          description: 公开模型标识。文生矢量使用 text-to-vector，单图转矢量使用 image-to-vector。
        callback_url:
          type: string
          format: uri
          description: 任务完成或失败时接收通知的 Webhook URL。
        input:
          type: object
          additionalProperties: false
          description: 文生矢量必填 prompt。图片转矢量必填恰好一个图片 URL。文生矢量里的 image_urls 是可选参考图。
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 9500
              description: >-
                ideogram-vector-1.0/text-to-vector 必填。用 1-9500 个字符描述
                SVG，且须包含非空白文本。图片转矢量不接受这个字段。
            image_urls:
              description: >-
                ideogram-vector-1.0/text-to-vector：可选。提供 1-5 个可公开访问的 HTTP(S)
                参考图，第一个 URL 是主参考图。支持 JPEG、PNG 或 WebP，每张最大 10 MB。没有参考图时不要传这个字段。


                ideogram-vector-1.0/image-to-vector：必填。提供恰好一个可公开访问的 HTTP(S) 图片
                URL，用于转换成 SVG。支持 JPEG、PNG 或 WebP，最大 50 MB。
              oneOf:
                - title: ideogram-vector-1.0/text-to-vector
                  type: array
                  minItems: 1
                  maxItems: 5
                  items:
                    type: string
                    format: uri
                  description: >-
                    ideogram-vector-1.0/text-to-vector 可选。提供 1-5 个可公开访问的 HTTP(S)
                    参考图，第一个 URL 是主参考图。支持 JPEG、PNG 或 WebP，每张最大 10
                    MB。没有参考图时不要传这个字段。
                - title: ideogram-vector-1.0/image-to-vector
                  type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                    format: uri
                  description: >-
                    ideogram-vector-1.0/image-to-vector 必填。提供恰好一个可公开访问的 HTTP(S)
                    图片 URL，用于转换成 SVG。支持 JPEG、PNG 或 WebP，最大 50 MB。
            quality:
              type: string
              enum:
                - low
                - medium
                - high
              default: medium
              description: 文生矢量质量。默认为 medium。图片转矢量不可传。
            'n':
              type: integer
              minimum: 1
              maximum: 8
              default: 1
              description: 文生矢量输出数量，1 到 8。默认为 1。图片转矢量不可传。
            size:
              type: string
              enum:
                - auto
                - '1:1'
                - '1:4'
                - '1:3'
                - '1:2'
                - '9:16'
                - '10:16'
                - '2:3'
                - '3:4'
                - '4:5'
                - '5:4'
                - '4:3'
                - '3:2'
                - '16:10'
                - '16:9'
                - '2:1'
                - '3:1'
                - '4:1'
              default: auto
              description: 文生矢量宽高比。默认为 auto。图片转矢量不可传。
            mode:
              type: string
              enum:
                - default
                - simple
              default: default
              description: 仅用于图片转矢量。default 保留更多细节。simple 使用更少图形。默认为 default。文生矢量不可传。
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
          example: 200
          description: >-
            业务状态码。`200` 表示成功，其他值都表示请求失败。请务必检查这个字段：部分参数校验错误会以 HTTP 200 返回，响应体里的
            `code` 为 `400`。


            - `200`：成功

            - `400`：请求参数无效

            - `401`：API Key 缺失或无效

            - `402`：积分不足

            - `403`：没有权限

            - `404`：资源不存在

            - `408`：请求超时

            - `429`：请求频率超限

            - `500`：服务器内部错误

            - `502`：上游服务错误

            - `503`：服务暂不可用


            详见[错误码](/zh/api-manual/error-codes)。
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1792468800-example
            status:
              type: string
              enum:
                - not_started
                - running
                - finished
                - failed
              example: not_started
              description: >-
                任务状态。提交后立即返回时始终为
                `not_started`。后续状态请通过[查询任务状态](/zh/api-manual/task-management/status)接口或
                `callback_url` 获取。


                - `not_started`：排队中，等待处理

                - `running`：生成中

                - `finished`：已完成，结果在 `files` 或 `output` 中

                - `failed`：失败，详情见 `error_message`
            created_time:
              type: string
              format: date-time
              example: '2026-11-03T06:00:00'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: invalid_request_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        所有 API 接口都需要 Bearer Token 认证。


        创建 API Key：登录 PoYo，进入 **仪表盘 → API
        密钥**（[poyo.ai/zh/dashboard/api-key](https://poyo.ai/zh/dashboard/api-key)），点击创建
        Key。


        在请求头中添加：


        ```

        Authorization: Bearer PoYo_API_KEY

        ```

````

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