使用 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 |