Base URL
All API requests should be made to:
https://api.chicago.global
Authentication
All API endpoints require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Keep your API key secure. Do not expose it in client-side code or public repositories.
Async Job Processing
Several endpoints (like Portfolio Analysis) use async job processing for long-running operations:
- Submit Request - POST your data to the endpoint
- Receive Job ID - Get a
job_id and check_url immediately
- Poll for Status - GET the
check_url until status is completed
- Get Results - The completed response contains your data
// 1. Submit
const { job_id, check_url } = await fetch('/v1/portfolio/analyze', {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}` },
body: JSON.stringify(payload)
}).then(r => r.json());
// 2. Poll
let result;
while (!result) {
const status = await fetch(check_url).then(r => r.json());
if (status.status === 'completed') result = status.result;
else await new Promise(r => setTimeout(r, 3000));
}
Response Codes
| Code | Description |
|---|
| 200 | Success |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not found |
| 422 | Validation error - Check request body |
| 500 | Server error |
Rate Limits
Contact support for rate limit information based on your plan.