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

# Recraft V4.1 Pro 文生矢量图

> Recraft V4.1 Pro 文生矢量图 API 每个提示词生成一个细节丰富、可编辑的 SVG 文件，支持 5 种宽高比和最多 10 个首选配色。

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

Recraft V4.1 Pro 文生矢量图以 Pro 档位根据文本提示词生成一个 SVG 文件，Recraft 称 Pro 模型“分辨率更高、细节更精细”。按 Recraft 的说法，Vector 模型“输出可完整导出的矢量图，可以随意调整形状、重新配色和微调，直到满意为止”。适合细节丰富的矢量插画、印刷图形和需要任意缩放的品牌素材。

Recraft V4.1 是 Recraft 于 2026 年 5 月 14 日发布的图像模型系列。Vidgo 提供 5 个输入字段相同的模型 ID：[V4.1 Flash 文生图](https://docs.vidgo.ai/zh/api-manual/image-series/recraft-v4-1-flash-text-to-image.md)、[V4.1 文生图](https://docs.vidgo.ai/zh/api-manual/image-series/recraft-v4-1-text-to-image.md)、[V4.1 Pro 文生图](https://docs.vidgo.ai/zh/api-manual/image-series/recraft-v4-1-pro-text-to-image.md)、[V4.1 文生矢量图](https://docs.vidgo.ai/zh/api-manual/image-series/recraft-v4-1-text-to-vector.md)和[V4.1 Pro 文生矢量图](https://docs.vidgo.ai/zh/api-manual/image-series/recraft-v4-1-pro-text-to-vector.md)。

## 模型

* **recraft/v4.1-pro/text-to-vector** — Recraft V4.1 Pro Vector 文生 SVG，每次一个细节丰富的 SVG 文件。

## 功能

* 根据最多 10,000 个字符的提示词生成 SVG。
* Pro 档位的细节，配合可编辑的矢量形状，适合印刷图形和品牌素材。
* 5 种宽高比：`1:1`、`4:3`、`3:4`、`16:9`、`9:16`。
* 最多 10 个 RGB 颜色的首选配色，以及首选背景色。
* 每次请求一个 SVG 文件，按次固定计费。

## 必填参数

* `prompt` (string)：描述所需矢量图。1–10,000 个字符，至少包含一个非空白字符。

## 可选参数

* `size` (string)：宽高比，`1:1`、`4:3`、`3:4`、`16:9` 或 `9:16`。默认 `1:1`。
* `colors` (object\[])：首选配色，最多 10 个颜色。每个颜色是一个对象，例如 `{"r": 18, "g": 52, "b": 86}`，取值为 0–255 的整数。
* `background_color` (object)：首选背景色，一个包含 0–255 整数 `r`、`g`、`b` 的 RGB 对象。

## 输出

任务完成后，[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)和回调内容的 `files` 数组中返回一个 SVG 文件。可在任意矢量编辑器中调整形状或重新配色，也可以直接嵌入网页。

## 示例

* **精细插画**：俯视的锦鲤池，`3:4`。
* **带配色和回调的横幅**：`16:9` 夜市街景，3 个 `colors`、深色 `background_color`，并设置 `callback_url`。

## 注意事项

* 每次请求只返回一个 SVG 文件。`input` 接收上文列出的字段，其他字段返回 400。`model` 和 `callback_url` 放在请求根级，与 `input` 并列。
* 每个 RGB 对象只包含 `r`、`g`、`b` 三个键，取值均为 0–255 的整数。其他颜色值或 `colors` 超过 10 项会返回 400。
* 每次请求按该模型 ID 的固定费率计费，`size`、`colors` 和 `background_color` 不影响价格。提交时预扣积分，任务失败会全额退还。当前费率见[定价页](https://vidgo.ai/apis/api-pricing)。


## OpenAPI

````yaml zh/api-manual/image-series/recraft-v4-1-pro-text-to-vector.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Recraft V4.1 Pro 文生矢量图
  description: Recraft V4.1 Pro 文生矢量图 API 每个提示词生成一个细节丰富、可编辑的 SVG 文件，支持 5 种宽高比和最多 10 个首选配色。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: 生产环境服务器
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Recraft V4.1 Pro Text to Vector
      summary: 提交 Recraft V4.1 Pro 文生矢量图 任务
      operationId: submitRecraftV41ProTextToVectorTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              basic:
                summary: 3:4 精细插画
                value:
                  model: recraft/v4.1-pro/text-to-vector
                  input:
                    prompt: >-
                      Detailed vector illustration of a koi pond seen from
                      above, lily pads, ripples and fallen maple leaves, clean
                      layered shapes
                    size: '3:4'
              palette:
                summary: 带配色和回调的横幅
                value:
                  model: recraft/v4.1-pro/text-to-vector
                  callback_url: https://your-domain.com/callback
                  input:
                    prompt: >-
                      Wide vector banner of a night market street with paper
                      lanterns, food stalls and a cyclist passing by
                    size: '16:9'
                    colors:
                      - r: 33
                        g: 33
                        b: 72
                      - r: 255
                        g: 112
                        b: 67
                      - r: 255
                        g: 214
                        b: 102
                    background_color:
                      r: 33
                      g: 33
                      b: 72
      responses:
        '200':
          description: 任务提交结果。任务 ID 标识一项异步任务；生成可能仍在进行中。
          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
          example: recraft/v4.1-pro/text-to-vector
        callback_url:
          type: string
          format: uri
          description: 可选的 Webhook URL，用于接收完成或失败通知。
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - prompt
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 10000
              description: 描述所需矢量图的提示词。1–10,000 个字符，至少包含一个非空白字符。
            size:
              type: string
              enum:
                - '1:1'
                - '4:3'
                - '3:4'
                - '16:9'
                - '9:16'
              default: '1:1'
              description: 输出的宽高比。
            colors:
              type: array
              maxItems: 10
              items:
                $ref: '#/components/schemas/RGBColor'
              description: >-
                首选配色，最多 10 个 RGB 颜色，用于引导结果的用色。每个颜色是一个对象，包含 0–255 的整数
                `r`、`g`、`b`。
            background_color:
              allOf:
                - $ref: '#/components/schemas/RGBColor'
              description: 首选背景色，一个包含 0–255 整数 `r`、`g`、`b` 的 RGB 对象。
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-example-001
            status:
              type: string
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-11-25T10:30:00'
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: 错误信息。参见[错误码](/zh/api-manual/error-codes)。
          example: prompt is required
    RGBColor:
      type: object
      required:
        - r
        - g
        - b
      additionalProperties: false
      description: RGB 颜色。
      properties:
        r:
          type: integer
          minimum: 0
          maximum: 255
          description: 红色分量，0–255。
        g:
          type: integer
          minimum: 0
          maximum: 255
          description: 绿色分量，0–255。
        b:
          type: integer
          minimum: 0
          maximum: 255
          description: 蓝色分量，0–255。
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: '使用 `Authorization: Bearer VIDGO_API_KEY`。'

````

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