1. 上传文件,统计字符并估算成本
报价或创建全文任务前,使用 action=token_estimate。试点阶段上传文件时,estimated_chars 用于预付额度校验;任务完成后会返回系统侧字符数、Token 估算等统计。
继续轮询 https://novotranslator.com/api/b2b/v1/tasks/{task_id}。估算任务完成后,可能返回 total_characters、estimated_tokens、detected_language 和 estimated credits 等字段,具体取决于文件类型。
curl https://novotranslator.com/api/b2b/v1/tasks \
-H "Authorization: Bearer nt_live_xxxxxxxxxxxxxxxxx" \
-H "Idempotency-Key: partner-estimate-001" \
-F "action=token_estimate" \
-F "target_lang=en" \
-F "estimated_chars=120000" \
-F "[email protected]"{
"success": true,
"data": {
"task_id": "TSK_EST_01HV8W...",
"status": "pending",
"action": "token_estimate",
"file_name": "novel.txt",
"target_lang": "en",
"char_count": 120000,
"estimated_credits": 120000,
"created_at": "2026-06-16T10:30:00Z"
}
}