SOPwise AI is a specialized medical assistant API that processes and analyzes Standard Operating Procedures (SOPs) documents. It helps healthcare professionals find specific medical information like drug dosages, treatment protocols, and procedural guidelines.
Base URL: https://app.sopwise.ai
Current Version: v1
All API endpoints require Bearer token authentication:
Authorization: Bearer YOUR_API_KEY
/upload_sop
Upload medical SOP documents for analysis and Q&A.
| Parameter | Type | Required | Description |
|---|---|---|---|
files |
File[] | Yes | Array of medical documents (PDF, DOCX) |
ocr_mode |
String | No | OCR processing mode: "fast" or "accurate" (default: "fast") |
POST /upload_sop Content-Type: multipart/form-data Authorization: Bearer YOUR_API_KEY files: [file1.pdf, file2.docx] ocr_mode: "fast"
{
"reply": "Uploaded 2 document(s) successfully!",
"suggestions": [
"What are the dosage recommendations?",
"What are the contraindications?"
]
}
/ask
Send questions about uploaded SOP documents and get AI-powered answers.
| Parameter | Type | Required | Description |
|---|---|---|---|
message |
String | Yes | The question about the SOPs |
stream |
Boolean | No | Whether to stream the response (default: false) |
POST /ask
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"message": "What are the dosage recommendations for vancomycin?",
"stream": false
}
{
"reply": "Based on the uploaded SOPs, vancomycin dosage recommendations are:\n\n1. Loading dose: 25-30 mg/kg IV\n2. Maintenance dose: 15-20 mg/kg every 8-12 hours\n3. Target trough levels: 15-20 mg/L for serious infections",
"suggestions": [
"What are the monitoring requirements?",
"What are the contraindications?"
]
}
/sops
Get a list of all uploaded SOP documents with metadata.
{
"sops": [
{
"id": 1,
"filename": "vancomycin-protocol-2021.pdf",
"topic": "Antibiotic Protocols",
"language": "en",
"created_at": "2024-01-15T10:30:00Z"
}
]
}
/topics
Retrieve all detected medical topics from uploaded SOPs.
{
"topics": [
"Antibiotic Protocols",
"Emergency Procedures",
"ICU Management"
]
}
/status
Check plugin operational status and current document load.
{
"status": "operational",
"documents_loaded": 5,
"available_languages": ["en", "de"]
}
/sop/{id}/view
View or download a specific SOP document by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Yes | SOP document identifier |
Returns the original document file with appropriate Content-Type headers.
import requests
# Upload documents
files = {'files': open('sop.pdf', 'rb')}
response = requests.post(
'https://app.sopwise.ai/upload_sop/',
files=files,
data={'ocr_mode': 'fast'},
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
# Ask question
response = requests.post(
'https://app.sopwise.ai/ask/',
json={'message': 'What are the dosage recommendations?'},
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
)
// Upload documents
const formData = new FormData();
formData.append('files', fileInput.files[0]);
formData.append('ocr_mode', 'fast');
const uploadResponse = await fetch('/upload_sop/', {
method: 'POST',
body: formData,
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
// Ask question
const askResponse = await fetch('/ask/', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
message: 'What are the dosage recommendations?'
})
});
# Upload document
curl -X POST "https://app.sopwise.ai/upload_sop/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "files=@sop.pdf" \
-F "ocr_mode=fast"
# Ask question
curl -X POST "https://app.sopwise.ai/ask/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message": "What are the dosage recommendations?"}'
All endpoints return JSON error responses with the following structure:
{
"error": "Error description",
"code": "ERROR_CODE"
}
| Code | Meaning | Description |
|---|---|---|
| 200 | Success | Request completed successfully |
| 400 | Bad Request | Invalid parameters or request format |
| 401 | Unauthorized | Invalid or missing API key |
| 404 | Not Found | Resource doesn't exist |
| 413 | Payload Too Large | File size exceeded limits |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server encountered an error |
| Plan | Daily Requests | File Uploads | File Size Limit |
|---|---|---|---|
| Free | 100 requests | 2 files | 5MB per file |
| Plus | 1000 requests | Unlimited | 10MB per file |
| Enterprise | Custom limits | Unlimited | Custom limits |