| 形态 | JSONL 上传 → 创建批任务 → 轮询状态 → 取结果 |
|---|---|
| 时限 | 通常要求 24 小时内完成(各家不同) |
| 折扣 | 按标准价打折计费(以厂商官网为准) |
| 限制 | 不支持流式,部分高级特性缺席 |
批任务 JSONL 与提交(OpenAI 风格)
批任务 JSONL 与提交(OpenAI 风格)
# 每行一个请求
{"custom_id":"q-001","method":"POST","url":"/v1/chat/completions",
"body":{"model":"gpt-4o-mini","messages":[{"role":"user","content":"分类:…"}]}}
curl https://api.openai.com/v1/batches -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d '{"input_file_id":"file-xxx","endpoint":"/v1/chat/completions","completion_window":"24h"}'批处理适合“今天提交、明天要结果”的活:数据清洗、打标、历史数据回填、离线评测——这些不占实时预算还省钱。