Text
Create a text caption task
POST
/texts/captionsGenerate a short caption for an input text in the requested language. The request can run synchronously or return a task for polling.
请求体
Request Body Schema
application/json
└
requiredinput_text└
requiredlanguage└
options└
block响应
通用错误码说明请查看:错误处理。
Response Schema
200application/json
└
requiredtask_uuid└
requiredtask_type└
requiredmodel└
requiredstatus└
requiredcreated_at└
completed_at└
requiredresult└
metadata└
description└
keywords└
keywords[]立即体验
curl -X POST 'https://api.v2fun.ai/api/v1/texts/captions' \
-H "Authorization: Bearer $V2FUN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"input_text": "<input_text>",
"language": "<language>"
}' Response 200 OK
{
"task_uuid": "<task_uuid>",
"task_type": "<task_type>",
"model": "<model>",
"status": "<taskstatus>",
"created_at": 0,
"result": "<result>"
}Get a text caption task
GET
/texts/captions/{task_uuid}Retrieve the current status or final result of a text caption task.
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
task_uuid | path | 是 | string | Task UUID returned when the text caption job was created. |
响应
通用错误码说明请查看:错误处理。
Response Schema
200application/json
└
requiredtask_uuid└
requiredtask_type└
requiredmodel└
requiredstatus└
requiredcreated_at└
completed_at└
requiredresult└
metadata└
description└
keywords└
keywords[]立即体验
curl -X GET 'https://api.v2fun.ai/api/v1/texts/captions/<task_uuid>' \
-H "Authorization: Bearer $V2FUN_API_KEY" Response 200 OK
{
"task_uuid": "<task_uuid>",
"task_type": "<task_type>",
"model": "<model>",
"status": "<taskstatus>",
"created_at": 0,
"result": "<result>"
}Create a text rank task
POST
/texts/rankingsRank candidate texts by semantic relevance to a query and return the top-N matches. The request can run synchronously or return a task for polling.
请求体
Request Body Schema
application/json
└
requiredquery└
requiredcandidates└
candidates[]└
top_n└
options└
block响应
通用错误码说明请查看:错误处理。
Response Schema
200application/json
└
requiredtask_uuid└
requiredtask_type└
requiredmodel└
requiredstatus└
requiredcreated_at└
completed_at└
requiredresult└
result[]└
metadata└
metadata[]└
requiredindex└
relevance_score立即体验
curl -X POST 'https://api.v2fun.ai/api/v1/texts/rankings' \
-H "Authorization: Bearer $V2FUN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"query": "<query>",
"candidates": []
}' Response 200 OK
{
"task_uuid": "<task_uuid>",
"task_type": "<task_type>",
"model": "<model>",
"status": "<taskstatus>",
"created_at": 0,
"result": []
}Get a text rank task
GET
/texts/rankings/{task_uuid}Retrieve the current status or final result of a text rank task.
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
task_uuid | path | 是 | string | Task UUID returned when the text rank job was created. |
响应
通用错误码说明请查看:错误处理。
Response Schema
200application/json
└
requiredtask_uuid└
requiredtask_type└
requiredmodel└
requiredstatus└
requiredcreated_at└
completed_at└
requiredresult└
result[]└
metadata└
metadata[]└
requiredindex└
relevance_score立即体验
curl -X GET 'https://api.v2fun.ai/api/v1/texts/rankings/<task_uuid>' \
-H "Authorization: Bearer $V2FUN_API_KEY" Response 200 OK
{
"task_uuid": "<task_uuid>",
"task_type": "<task_type>",
"model": "<model>",
"status": "<taskstatus>",
"created_at": 0,
"result": []
}