Skip to content

图像 ​

创建图片描述任务 ​

POST/images/captions

对输入图片生成指定语言的简短描述文字。请求可同步等待结果,也可获取任务引用后轮询。

请求体

Content-Type: application/jsonRequired: true
Request Body Schema
application/json
└input_image
required
string(Input Image)

Source image input to analyze and caption. Accepts an existing relative URI path, a base64-encoded file payload (including `data:` URLs), or an HTTP/HTTPS file URL.

└language
required
string(Language)[1..64] chars

Target language for the generated caption, for example English, Chinese, or Japanese.

└options
TaskRequestOptions | null

Optional task execution controls for the task

└block
boolean | null

When true, wait for task completion and return the terminal response immediately. When false, return a task reference for polling.

└priority
integer | null[0..255]

Task dispatch priority within this client. Larger values are consumed earlier. Must not exceed the client's `mq_priority`. When omitted, defaults to the client's `mq_priority`.

响应

通用错误码说明请查看:错误处理。

Response Schema
200application/json
└task_uuid
required
string(Task Uuid)

Unique identifier for the task

└task_type
required
string(Task Type)

Logical task category used by the backend pipeline.

└model
required
string(Model)

Model or worker name assigned to the task.

└status
required
string(TaskStatus)
Enum: QUEUED PROCESSING COMPLETED FAILED
└created_at
required
integer(Created At)

Unix timestamp, in seconds, when the task was created.

└completed_at
required
integer(Completed At)

Unix timestamp, in seconds, when the task finished successfully.

└result
required
string(Result)

Short caption generated for the input image in the requested language.

└metadata
ImageCaptionMetadata | null

Additional caption metadata including description and keywords.

└description
string(Description)

Brief description of the image content.

Default: ``

└keywords
array(Keywords)

Relevant keywords describing the image.

└keywords[]
string
也可能返回 201,表示任务已接受并在后台异步执行。使用响应体中的 task_uuid 轮询对应的 GET 端点获取结果。了解同步 vs 异步 →
curl https://api.v2fun.art/api/v1/images/captions \
  -X POST \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "input_image": "<input_image>",
      "language": "<language>"
    }'
Response 200 OK
{
  "task_uuid": "<task_uuid>",
  "task_type": "<task_type>",
  "model": "<model>",
  "status": "<taskstatus>",
  "created_at": 0,
  "completed_at": 0,
  "result": "<result>"
}

获取图片描述任务 ​

GET/images/captions/{task_uuid}

获取图片描述任务的当前状态或最终结果。

参数

名称位置必填类型说明
task_uuidpath是stringTask UUID returned when the image caption job was created.

响应

通用错误码说明请查看:错误处理。

Response Schema
200application/json
└task_uuid
required
string(Task Uuid)

Unique identifier for the task

└task_type
required
string(Task Type)

Logical task category used by the backend pipeline.

└model
required
string(Model)

Model or worker name assigned to the task.

└status
required
string(TaskStatus)
Enum: QUEUED PROCESSING COMPLETED FAILED
└created_at
required
integer(Created At)

Unix timestamp, in seconds, when the task was created.

└completed_at
required
integer(Completed At)

Unix timestamp, in seconds, when the task finished successfully.

└result
required
string(Result)

Short caption generated for the input image in the requested language.

└metadata
ImageCaptionMetadata | null

Additional caption metadata including description and keywords.

└description
string(Description)

Brief description of the image content.

Default: ``

└keywords
array(Keywords)

Relevant keywords describing the image.

└keywords[]
string
curl https://api.v2fun.art/api/v1/images/captions/<task_uuid> \
  -H "Authorization: Bearer $YOUR_API_KEY"
Response 200 OK
{
  "task_uuid": "<task_uuid>",
  "task_type": "<task_type>",
  "model": "<model>",
  "status": "<taskstatus>",
  "created_at": 0,
  "completed_at": 0,
  "result": "<result>"
}

创建 Prompt 增强任务 ​

POST/images/prompt_enhancements

在用于图片生成之前,对图片提示词进行优化或扩展。请求可同步等待结果,也可获取任务引用后轮询。

请求体

Content-Type: application/jsonRequired: true
Request Body Schema
application/json
└prompt
required
string(Prompt)

User prompt to rewrite or expand before image generation.

└system_prompt
required
string(System Prompt)

System instruction that guides how the prompt should be enhanced.

└options
TaskRequestOptions | null

Optional task execution controls for the task

└block
boolean | null

When true, wait for task completion and return the terminal response immediately. When false, return a task reference for polling.

└priority
integer | null[0..255]

Task dispatch priority within this client. Larger values are consumed earlier. Must not exceed the client's `mq_priority`. When omitted, defaults to the client's `mq_priority`.

响应

通用错误码说明请查看:错误处理。

Response Schema
200application/json
└task_uuid
required
string(Task Uuid)

Unique identifier for the task

└task_type
required
string(Task Type)

Logical task category used by the backend pipeline.

└model
required
string(Model)

Model or worker name assigned to the task.

└status
required
string(TaskStatus)
Enum: QUEUED PROCESSING COMPLETED FAILED
└created_at
required
integer(Created At)

Unix timestamp, in seconds, when the task was created.

└completed_at
required
integer(Completed At)

Unix timestamp, in seconds, when the task finished successfully.

└result
required
string(Result)

Enhanced prompt returned by the prompt-improvement pipeline.

└metadata
any(Metadata)

Additional task-specific metadata returned with the result.

也可能返回 201,表示任务已接受并在后台异步执行。使用响应体中的 task_uuid 轮询对应的 GET 端点获取结果。了解同步 vs 异步 →
curl https://api.v2fun.art/api/v1/images/prompt_enhancements \
  -X POST \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "prompt": "<prompt>",
      "system_prompt": "<system_prompt>"
    }'
Response 200 OK
{
  "task_uuid": "<task_uuid>",
  "task_type": "<task_type>",
  "model": "<model>",
  "status": "<taskstatus>",
  "created_at": 0,
  "completed_at": 0,
  "result": "<result>"
}

获取 Prompt 增强任务 ​

GET/images/prompt_enhancements/{task_uuid}

获取 Prompt 增强任务的当前状态或最终结果。

参数

名称位置必填类型说明
task_uuidpath是stringTask UUID returned when the prompt enhancement job was created.

响应

通用错误码说明请查看:错误处理。

Response Schema
200application/json
└task_uuid
required
string(Task Uuid)

Unique identifier for the task

└task_type
required
string(Task Type)

Logical task category used by the backend pipeline.

└model
required
string(Model)

Model or worker name assigned to the task.

└status
required
string(TaskStatus)
Enum: QUEUED PROCESSING COMPLETED FAILED
└created_at
required
integer(Created At)

Unix timestamp, in seconds, when the task was created.

└completed_at
required
integer(Completed At)

Unix timestamp, in seconds, when the task finished successfully.

└result
required
string(Result)

Enhanced prompt returned by the prompt-improvement pipeline.

└metadata
any(Metadata)

Additional task-specific metadata returned with the result.

curl https://api.v2fun.art/api/v1/images/prompt_enhancements/<task_uuid> \
  -H "Authorization: Bearer $YOUR_API_KEY"
Response 200 OK
{
  "task_uuid": "<task_uuid>",
  "task_type": "<task_type>",
  "model": "<model>",
  "status": "<taskstatus>",
  "created_at": 0,
  "completed_at": 0,
  "result": "<result>"
}

创建图片生成任务 ​

POST/images/generations

提交文生图请求,返回可用于轮询的任务引用。

请求体

Content-Type: application/jsonRequired: true
Request Body Schema
application/json
└model
string(Model)

Image generation model to run for this request. Available values: `qwen-image`, `nano-banana-pro`, `nano-banana-2`, `nano-banana-2-lite`, `gpt-image-2`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`.

Default: `qwen-image`

└prompt
required
string(Prompt)

Natural-language prompt describing the image to generate.

└size
string(ImageSizeEnum)
Enum: 1024x1024 1152x864 864x1152 1280x720 720x1280
└background
string(BackgroundEnum)
Enum: opaque transparent
└options
TaskRequestOptions | null

Optional task execution controls for the task

└block
boolean | null

When true, wait for task completion and return the terminal response immediately. When false, return a task reference for polling.

└priority
integer | null[0..255]

Task dispatch priority within this client. Larger values are consumed earlier. Must not exceed the client's `mq_priority`. When omitted, defaults to the client's `mq_priority`.

响应

通用错误码说明请查看:错误处理。

Response Schema
200application/json
└task_uuid
required
string(Task Uuid)

Unique identifier for the task

└task_type
required
string(Task Type)

Logical task category used by the backend pipeline.

└model
required
string(Model)

Model or worker name assigned to the task.

└status
required
string(TaskStatus)
Enum: QUEUED PROCESSING COMPLETED FAILED
└created_at
required
integer(Created At)

Unix timestamp, in seconds, when the task was created.

└completed_at
required
integer(Completed At)

Unix timestamp, in seconds, when the task finished successfully.

└result
required
array(Result)

Generated, edited, or processed image URI list. Returned asset URIs are relative paths that can be reused directly in compatible input fields.

└result[]
string
└metadata
any(Metadata)

Additional task-specific metadata returned with the result.

也可能返回 201,表示任务已接受并在后台异步执行。使用响应体中的 task_uuid 轮询对应的 GET 端点获取结果。了解同步 vs 异步 →
curl https://api.v2fun.art/api/v1/images/generations \
  -X POST \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "prompt": "<prompt>"
    }'
Response 200 OK
{
  "task_uuid": "<task_uuid>",
  "task_type": "<task_type>",
  "model": "<model>",
  "status": "<taskstatus>",
  "created_at": 0,
  "completed_at": 0,
  "result": []
}

获取图片生成任务 ​

GET/images/generations/{task_uuid}

获取图片生成任务的当前状态或最终输出。

参数

名称位置必填类型说明
task_uuidpath是stringTask UUID returned when the image generation job was created.

响应

通用错误码说明请查看:错误处理。

Response Schema
200application/json
└task_uuid
required
string(Task Uuid)

Unique identifier for the task

└task_type
required
string(Task Type)

Logical task category used by the backend pipeline.

└model
required
string(Model)

Model or worker name assigned to the task.

└status
required
string(TaskStatus)
Enum: QUEUED PROCESSING COMPLETED FAILED
└created_at
required
integer(Created At)

Unix timestamp, in seconds, when the task was created.

└completed_at
required
integer(Completed At)

Unix timestamp, in seconds, when the task finished successfully.

└result
required
array(Result)

Generated, edited, or processed image URI list. Returned asset URIs are relative paths that can be reused directly in compatible input fields.

└result[]
string
└metadata
any(Metadata)

Additional task-specific metadata returned with the result.

curl https://api.v2fun.art/api/v1/images/generations/<task_uuid> \
  -H "Authorization: Bearer $YOUR_API_KEY"
Response 200 OK
{
  "task_uuid": "<task_uuid>",
  "task_type": "<task_type>",
  "model": "<model>",
  "status": "<taskstatus>",
  "created_at": 0,
  "completed_at": 0,
  "result": []
}

创建图片编辑任务 ​

POST/images/edits

基于一张或多张原始图片及可选的提示词,提交图片编辑请求。

请求体

Content-Type: application/jsonRequired: true
Request Body Schema
application/json
└model
string(Model)

Image editing model to run for this request. Available values: `qwen-image-edit`, `nano-banana-pro`, `nano-banana-2`, `nano-banana-2-lite`, `gpt-image-2`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, `gpt-multiview`.

Default: `qwen-image-edit`

└prompt
string | null

Optional prompt describing the requested edit or transformation.

└input_images
string[] | null[1..3] items

One to three source images used as editing inputs. Each item may be an existing relative URI path, a base64-encoded file payload (including `data:` URLs), or an HTTP/HTTPS file URL.

└input_images[]
string
└size
string(ImageSizeEnum)
Enum: 1024x1024 1152x864 864x1152 1280x720 720x1280
└background
string(BackgroundEnum)
Enum: opaque transparent
└options
TaskRequestOptions | null

Optional task execution controls for the task

└block
boolean | null

When true, wait for task completion and return the terminal response immediately. When false, return a task reference for polling.

└priority
integer | null[0..255]

Task dispatch priority within this client. Larger values are consumed earlier. Must not exceed the client's `mq_priority`. When omitted, defaults to the client's `mq_priority`.

响应

通用错误码说明请查看:错误处理。

Response Schema
200application/json
└task_uuid
required
string(Task Uuid)

Unique identifier for the task

└task_type
required
string(Task Type)

Logical task category used by the backend pipeline.

└model
required
string(Model)

Model or worker name assigned to the task.

└status
required
string(TaskStatus)
Enum: QUEUED PROCESSING COMPLETED FAILED
└created_at
required
integer(Created At)

Unix timestamp, in seconds, when the task was created.

└completed_at
required
integer(Completed At)

Unix timestamp, in seconds, when the task finished successfully.

└result
required
array(Result)

Generated, edited, or processed image URI list. Returned asset URIs are relative paths that can be reused directly in compatible input fields.

└result[]
string
└metadata
any(Metadata)

Additional task-specific metadata returned with the result.

也可能返回 201,表示任务已接受并在后台异步执行。使用响应体中的 task_uuid 轮询对应的 GET 端点获取结果。了解同步 vs 异步 →
curl https://api.v2fun.art/api/v1/images/edits \
  -X POST \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Response 200 OK
{
  "task_uuid": "<task_uuid>",
  "task_type": "<task_type>",
  "model": "<model>",
  "status": "<taskstatus>",
  "created_at": 0,
  "completed_at": 0,
  "result": []
}

获取图片编辑任务 ​

GET/images/edits/{task_uuid}

获取图片编辑任务的当前状态或最终输出。

参数

名称位置必填类型说明
task_uuidpath是stringTask UUID returned when the image edit job was created.

响应

通用错误码说明请查看:错误处理。

Response Schema
200application/json
└task_uuid
required
string(Task Uuid)

Unique identifier for the task

└task_type
required
string(Task Type)

Logical task category used by the backend pipeline.

└model
required
string(Model)

Model or worker name assigned to the task.

└status
required
string(TaskStatus)
Enum: QUEUED PROCESSING COMPLETED FAILED
└created_at
required
integer(Created At)

Unix timestamp, in seconds, when the task was created.

└completed_at
required
integer(Completed At)

Unix timestamp, in seconds, when the task finished successfully.

└result
required
array(Result)

Generated, edited, or processed image URI list. Returned asset URIs are relative paths that can be reused directly in compatible input fields.

└result[]
string
└metadata
any(Metadata)

Additional task-specific metadata returned with the result.

curl https://api.v2fun.art/api/v1/images/edits/<task_uuid> \
  -H "Authorization: Bearer $YOUR_API_KEY"
Response 200 OK
{
  "task_uuid": "<task_uuid>",
  "task_type": "<task_type>",
  "model": "<model>",
  "status": "<taskstatus>",
  "created_at": 0,
  "completed_at": 0,
  "result": []
}

创建图像处理任务 ​

POST/images/processes

使用 SeedVR2 对输入图片进行高清修复与细节增强。

请求体

Content-Type: application/jsonRequired: true
Request Body Schema
application/json
└model
required
string(Model)
Enum: seedvr2

Image processing operator to apply to the input image. Available values: `seedvr2`.

└input_image
required
string(Input Image)

Source image input to process. Accepts an existing relative URI path, a base64-encoded file payload (including `data:` URLs), or an HTTP/HTTPS file URL.

└options
TaskRequestOptions | null

Optional task execution controls for the task

└block
boolean | null

When true, wait for task completion and return the terminal response immediately. When false, return a task reference for polling.

└priority
integer | null[0..255]

Task dispatch priority within this client. Larger values are consumed earlier. Must not exceed the client's `mq_priority`. When omitted, defaults to the client's `mq_priority`.

响应

通用错误码说明请查看:错误处理。

Response Schema
200application/json
└task_uuid
required
string(Task Uuid)

Unique identifier for the task

└task_type
required
string(Task Type)

Logical task category used by the backend pipeline.

└model
required
string(Model)

Model or worker name assigned to the task.

└status
required
string(TaskStatus)
Enum: QUEUED PROCESSING COMPLETED FAILED
└created_at
required
integer(Created At)

Unix timestamp, in seconds, when the task was created.

└completed_at
required
integer(Completed At)

Unix timestamp, in seconds, when the task finished successfully.

└result
required
array(Result)

Generated, edited, or processed image URI list. Returned asset URIs are relative paths that can be reused directly in compatible input fields.

└result[]
string
└metadata
any(Metadata)

Additional task-specific metadata returned with the result.

也可能返回 201,表示任务已接受并在后台异步执行。使用响应体中的 task_uuid 轮询对应的 GET 端点获取结果。了解同步 vs 异步 →
curl https://api.v2fun.art/api/v1/images/processes \
  -X POST \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "model": "seedvr2",
      "input_image": "<input_image>"
    }'
Response 200 OK
{
  "task_uuid": "<task_uuid>",
  "task_type": "<task_type>",
  "model": "<model>",
  "status": "<taskstatus>",
  "created_at": 0,
  "completed_at": 0,
  "result": []
}

获取图像处理任务 ​

GET/images/processes/{task_uuid}

获取图像处理任务的当前状态或最终输出。

参数

名称位置必填类型说明
task_uuidpath是stringTask UUID returned when the image processing job was created.

响应

通用错误码说明请查看:错误处理。

Response Schema
200application/json
└task_uuid
required
string(Task Uuid)

Unique identifier for the task

└task_type
required
string(Task Type)

Logical task category used by the backend pipeline.

└model
required
string(Model)

Model or worker name assigned to the task.

└status
required
string(TaskStatus)
Enum: QUEUED PROCESSING COMPLETED FAILED
└created_at
required
integer(Created At)

Unix timestamp, in seconds, when the task was created.

└completed_at
required
integer(Completed At)

Unix timestamp, in seconds, when the task finished successfully.

└result
required
array(Result)

Generated, edited, or processed image URI list. Returned asset URIs are relative paths that can be reused directly in compatible input fields.

└result[]
string
└metadata
any(Metadata)

Additional task-specific metadata returned with the result.

curl https://api.v2fun.art/api/v1/images/processes/<task_uuid> \
  -H "Authorization: Bearer $YOUR_API_KEY"
Response 200 OK
{
  "task_uuid": "<task_uuid>",
  "task_type": "<task_type>",
  "model": "<model>",
  "status": "<taskstatus>",
  "created_at": 0,
  "completed_at": 0,
  "result": []
}