使用 Dr7.ai 醫療 API 的完整指南
Dr7.ai 醫療 API 使用 API 金鑰進行身份驗證。請在 Authorization 標頭中包含您的 API 金鑰:
Authorization: Bearer sk-dr7-your-api-key注意:請保護好您的 API 金鑰,切勿在客戶端程式碼中暴露。您可以在控制台中管理您的 API 金鑰。
/v1/medical/chat/completions基於症狀和醫療查詢生成醫療回應
curl https://dr7.ai/api/v1/medical/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-dr7-your-api-key" \
-d '{
"model": "medgemma-4b-it",
"messages": [
{
"role": "user",
"content": "Patient reports headache for 3 days with fever of 38.5°C"
}
],
"max_tokens": 1000,
"temperature": 0.7
}'{
"id": "med-1234567890",
"object": "medical.chat.completion",
"created": 1677652288,
"model": "medgemma-4b-it",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Based on the symptoms you described, the patient presents with headache accompanied by fever. The following diagnoses should be considered..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 150,
"total_tokens": 175
}
}API 使用標準 HTTP 狀態碼並以 JSON 格式返回錯誤詳情:
{
"error": {
"message": "Invalid API key provided",
"type": "authentication_error",
"code": "invalid_api_key"
}
}| Status Code | Description |
|---|---|
| 401 | 無效或缺失的 API 金鑰 |
| 402 | 帳戶餘額不足 |
| 429 | 超出速率限制 |
| 500 | 內部伺服器錯誤 |
我們的 API 使用基於令牌的定價。您只需為使用的部分付費。
| 模型 | 輸入 | 輸出 |
|---|---|---|
| med-palm-2 | $0.001 / 1K tokens | $0.002 / 1K tokens |
| biogpt | $0.001 / 1K tokens | $0.002 / 1K tokens |
| chexagent | $0.002 / 1K tokens | $0.004 / 1K tokens |
| llava-med | $0.002 / 1K tokens | $0.004 / 1K tokens |
| meditron | $0.001 / 1K tokens | $0.002 / 1K tokens |
| pmc-llama | $0.001 / 1K tokens | $0.002 / 1K tokens |
| med-flamingo | $0.002 / 1K tokens | $0.004 / 1K tokens |
| biomedlm | $0.001 / 1K tokens | $0.002 / 1K tokens |
| biomedclip | $0.002 / 1K tokens | $0.004 / 1K tokens |
| clinical-camel | $0.001 / 1K tokens | $0.002 / 1K tokens |
| medgemma-4b-it | $0.001 / 1K tokens | $0.002 / 1K tokens |
| medgemma-27b-it | $0.003 / 1K tokens | $0.006 / 1K tokens |
| medsiglip-v1 | $0.005 / 1K tokens | $0.002 / 1K tokens |
| alphagenome | $0.002 / 1K tokens | $0.004 / 1K tokens |
| baichuan-m3 | $0.001 / 1K tokens | $0.002 / 1K tokens |