身分驗證
所有 HydraSkill API 請求都需要透過 API key 進行身分驗證。
API Key 格式
Section titled “API Key 格式”Key 的格式為:sk- 後接 64 個十六進位字元。
sk-a1b2c3d4e5f6...身分驗證方式
Section titled “身分驗證方式”Header(建議)
Section titled “Header(建議)”curl https://api.hydraskill.ai/v1/proxy \ -H "Authorization: Bearer sk-your-key-here"SDK(自動設定)
Section titled “SDK(自動設定)”from hydraskill import ProxyClient
# 方式 1:直接傳入client = ProxyClient(api_key="sk-your-key-here")
# 方式 2:環境變數(建議)# export HYDRASKILL_API_KEY="sk-your-key-here"client = ProxyClient()Key 管理
Section titled “Key 管理”- 在 Dashboard → API Keys 建立 key
- 每個 key 都有可設定的 QPS 限制
- Key 可以停用/啟用而不必刪除
- 為了安全,請定期輪換 key
| 方案 | 每個 Key 的 QPS | 最大 Key 數量 |
|---|---|---|
| Starter | 10 | 5 |
| Pro | 50 | 10 |
| Enterprise | 自訂 | 無限制 |
// Key 無效或缺失{ "error": "unauthorized", "message": "Invalid API key" }
// Key 已停用{ "error": "forbidden", "message": "API key is disabled" }
// 觸發速率限制{ "error": "rate_limited", "message": "QPS limit exceeded", "retry_after_ms": 1000 }