跳转到文档
打开控制台
本页内容

POST /v1/quotes

使用此 HTTP 端点文档列出的请求字段和权限。

请求示例#

curl -X POST 'https://platform.tongai.io/v1/quotes' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "tool": "tong_generation_quote",  "input": {    "body": {      "operation": "TEXT_TO_IMAGE",      "model": "tong_ea55aff4f3b5c8aba3a35569",      "routingParameters": {        "ratio": "16:9"      }    }  }}'
配置
curl --version

身份验证#

为自己的账户使用服务器端 API 密钥,为各客户的账户使用 OAuth。切勿将密钥放入提示词或工具参数。

quotes:write

参数#

Idempotency-Keystring必填

UUID,例如 e8aa0a87-6cd9-42eb-975a-b72bf43218c8。

请求正文#

application/json
toolstring必填
允许的值"tong_generation_quote""tong_director_planning_quote""tong_director_shots_quote""tong_reference_quote""tong_cast_quote""tong_locations_quote""tong_director_video_edit_quote""tong_video_selection_quote""tong_video_edit_quote""tong_video_edit_route_quote""tong_motion_quote""tong_lora_quote""tong_audio_quote""tong_generation_alternative_quote""tong_text_quote"
inputobject必填

响应架构#

JSON
{  "id": "e8aa0a87-6cd9-42eb-975a-b72bf43218c8",  "tool": "example",  "category": "example",  "channel": "api",  "state": "queued",  "status": "accepted",  "stage": "admission",  "dispatch_status": "pending",  "created_at": "2026-10-22T09:00:00.000Z",  "updated_at": "2026-10-22T09:00:00.000Z",  "detail_expires_at": "2026-10-22T09:00:00.000Z",  "detail_expired": false,  "timing": {    "dispatch_started_at": "2026-10-22T09:00:00.000Z",    "acknowledged_at": "2026-10-22T09:00:00.000Z",    "completed_at": "2026-10-22T09:00:00.000Z",    "dispatch_acknowledgement_ms": 0,    "end_to_end_ms": 0  },  "review": null,  "result": null,  "error": {    "code": "example"  },  "billing": {    "status": "none",    "usage_credits": "0.000000",    "wallet_debited_credits": "0.000000"  }}

HTTP 202

application/json
idstring必填

已保存操作的唯一 ID。

UUID,例如 e8aa0a87-6cd9-42eb-975a-b72bf43218c8。

toolstring必填
categorystring必填
channelstring必填
允许的值"api""mcp"
statestring必填

已保存任务当前的执行状态。

允许的值"queued""running""waiting""needs_review""paused""reconciling""succeeded""failed""cancelled"
statusstring必填

跟踪操作时使用的总体状态。

允许的值"accepted""running""needs_review""paused""reconciling""succeeded""failed""cancelled"
stagestring必填

操作当前所处的阶段。

允许的值"admission""dispatch""review""generation""reconciliation""complete"
dispatch_statusstring必填

表示工具是否接受了请求。确认接受并不代表生成已完成。

允许的值"pending""unknown""acknowledged"
created_atstring必填

ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。

updated_atstring必填

ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。

detail_expires_atstring | null必填

已存储操作详情的到期时间。null 表示当前未设置到期时间。

ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。

detail_expiredboolean必填

已存储的操作详情是否已到期。

timingobject必填

用于跟踪此操作的时间戳和耗时。

显示嵌套字段
dispatch_started_atstring | null必填

ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。

acknowledged_atstring | null必填

ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。

completed_atstring | null必填

ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。

dispatch_acknowledgement_msnumber | null必填

最小值:0。

end_to_end_msnumber | null必填

最小值:0。

reviewJSON | null必填

操作需要人工输入时的审核信息;否则为 null。

resultJSON | null必填

此工具返回的输出,尚无输出时为 null。

errorobject | null必填

操作失败时的公开错误代码;否则为 null。

显示嵌套字段
codestring必填
billingobject必填

客户积分用量和钱包扣费。输出就绪与账单结算是独立状态。

显示嵌套字段
statusstring必填
允许的值"none""pending""settled""released""reconciling"
usage_creditsstring必填

保留六位小数的十进制字符串,例如 1.250000。

wallet_debited_creditsstring必填

保留六位小数的十进制字符串,例如 1.250000。

released_creditsstring可选

保留六位小数的十进制字符串,例如 1.250000。

refunded_creditsstring可选

保留六位小数的十进制字符串,例如 1.250000。

unfunded_creditsstring可选

保留六位小数的十进制字符串,例如 1.250000。

pending_creditsstring可选

保留六位小数的十进制字符串,例如 1.250000。

tokensobject可选
显示嵌套字段
inputnumber可选

最小值:0。

outputnumber可选

最小值:0。

cachednumber可选

最小值:0。

cache_writenumber可选

最小值:0。

componentsobject[]可选
显示嵌套字段
idstring可选
source_idstring必填
toolstring必填
modelstring | null必填
channelstring必填
允许的值"api""mcp"
credential_idstring必填
kindstring必填
允许的值"text_pool""reasoning""generation"
usage_creditsstring必填

保留六位小数的十进制字符串,例如 1.250000。

wallet_debited_creditsstring必填

保留六位小数的十进制字符串,例如 1.250000。

evidence_atstring可选

ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。

updated_atstring可选

ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。

quoteobject可选

报价可用时返回的配置、价格和提交值。

显示嵌套字段
idstring必填

UUID,例如 e8aa0a87-6cd9-42eb-975a-b72bf43218c8。

operation_idstring必填

UUID,例如 e8aa0a87-6cd9-42eb-975a-b72bf43218c8。

toolstring必填
operationstring | null必填
modelstring | null必填
configurationobject必填
submit_valuestring必填
submit_fieldstring必填
quoted_creditsstring | null必填

保留六位小数的十进制字符串,例如 1.250000。

expires_atstring | null必填

ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。

错误与限制#

HTTP错误恢复
400无效请求REQUEST_INVALID重试前请修正错误指出的字段。
401无效凭据CREDENTIAL_INVALID检查凭据、有效期以及是否已被撤销。
402积分不足INSUFFICIENT_CREDITS为凭据所属账户充值积分,然后继续已保存的任务。
403权限被拒绝SCOPE_REQUIRED使用具有所需权限且可访问所选资源的凭据。
404资源不可用RESOURCE_UNAVAILABLE检查资源 ID,并确认其属于已授权账户。
409操作意图冲突IDEMPOTENCY_CONFLICT仅为原始请求复用意图标识。不同操作请使用新的 UUID。
429已达速率限制RATE_LIMITED等待 Retry-After 指定的时间后再重试同一请求。
503暂时不可用DEPENDENCY_UNAVAILABLE等待 Retry-After 指定时间并使用同一意图重试。超时后检查已保存的操作。