发送请求
curl -X POST https://www.hitheo.ai/api/v1/completions \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "What are the three laws of thermodynamics? Explain each in one sentence.",
"mode": "auto"
}'
响应
{
"id": "comp_abc123",
"object": "completion",
"created": "2026-04-10T12:00:00Z",
"content": "1. **Zeroth Law**: If two systems are each in thermal equilibrium with a third, they are in equilibrium with each other...",
"mode": "auto",
"resolved_mode": "fast",
"model": {
"id": "theo-1-flash",
"label": "Theo Flash",
"engine": "theo-core"
},
"tools_used": [],
"artifacts": [],
"follow_ups": [
{ "label": "Explain entropy", "prompt": "Explain entropy in simple terms" },
{ "label": "Real-world examples", "prompt": "Give real-world examples of each law" }
],
"usage": {
"cost_cents": 0.02
}
}
刚刚发生了什么
- Theo 将你的提示词判定为简单的问答任务(
resolved_mode: "fast") - 为了追求速度,请求被路由到
theo-1-flash - 由于不需要调用任何工具,代理循环被跳过
- 响应结果被缓存、计费(0.02 美分)并记录审计日志
尝试不同的模式
# Code generation — routes to Theo Code
curl -X POST https://www.hitheo.ai/api/v1/completions \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Write a TypeScript function that debounces any callback", "mode": "code"}'
# Deep reasoning — routes to Theo Reason
curl -X POST https://www.hitheo.ai/api/v1/completions \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Compare microservices vs monolith architecture for a 10-person startup", "mode": "think"}'
结合技能使用
通过传入技能 slug 来激活相应的领域专业能力:curl -X POST https://www.hitheo.ai/api/v1/completions \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Check current inventory for SKU-1234 across all warehouses",
"skills": ["inventory-check"]
}'
