> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hitheo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 第一次補全請求

> 使用 curl 發起你的第一次 API 調用，並查看完整的響應結果。

## 發送請求

```bash theme={null}
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"
  }'
```

## 響應

```json theme={null}
{
  "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
  }
}
```

## 剛剛發生了什麼

1. Theo 將你的提示詞判定為簡單的問答任務（`resolved_mode: "fast"`）
2. 為了追求速度，請求被路由到 `theo-1-flash`
3. 由於不需要調用任何工具，代理循環被跳過
4. 響應結果被緩存、計費（0.02 美分）並記錄審計日誌

## 嘗試不同的模式

```bash theme={null}
# 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 來激活相應的領域專業能力：

```bash theme={null}
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"]
  }'
```

該技能的系統提示擴展和工具定義會被自動注入到處理管道中。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.