Kompletny przewodnik po medycznym API Dr7.ai
Medyczne API Dr7.ai używa kluczy API do uwierzytelniania. Umieść swój klucz API w nagłówku Authorization:
Authorization: Bearer sk-dr7-your-api-keyUwaga: chroń swój klucz API i nigdy nie umieszczaj go w kodzie po stronie klienta. Kluczami API możesz zarządzać w panelu.
/v1/medical/chat/completionsGeneruj odpowiedzi medyczne na podstawie objawów i pytań medycznych
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 używa standardowych kodów statusu HTTP i zwraca szczegóły błędów w formacie JSON:
{
"error": {
"message": "Invalid API key provided",
"type": "authentication_error",
"code": "invalid_api_key"
}
}| Status Code | Description |
|---|---|
| 401 | Nieprawidłowy lub brakujący klucz API |
| 402 | Niewystarczające saldo konta |
| 429 | Przekroczono limit żądań |
| 500 | Wewnętrzny błąd serwera |
Nasze API ma cennik oparty na tokenach. Płacisz tylko za to, czego używasz.
| Model | Wejście | Wyjście |
|---|---|---|
| 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 |