Error Codes
Comprehensive reference for all API error responses.
Trying to fix a specific symptom? The Troubleshooting guide walks through the most common failures (401/403/429, empty results, tiles not rendering, CORS) with step-by-step fixes.
Error response format
Most error responses follow this JSON structure:
{
"error": "error_code",
"message": "Human-readable description of the error.",
"details": {} // Optional additional context
}The plan-gate 403s below are the exception: they carry the code under code or error, the prose under detail rather than message, and add plan — the team's current plan id:
{
"code": "offline_requires_pro_plan",
"plan": "free",
"detail": "CHRToffline requires the Pro plan or above. Upgrade at https://platform.chrt.co/plans."
}If you use the SDK you don't need to care: it normalizes both shapes into a typed .code you can switch on.
HTTP status codes
Client errors (4xx)
| Code | Error | Description | Action |
|---|---|---|---|
400 | bad_request | Missing or invalid query parameters | Check parameter types and required fields |
401 | unauthorized | Missing or invalid API key | Verify your x-api-key header |
403 | forbidden | Key lacks required scope or coverage access | Check key scopes and team coverage plan |
403 | offline_requires_pro_plan | CHRToffline requires the Pro plan or above | Upgrade at /plans, or drop the offline:download scope |
403 | offline_not_enabled | The key lacks the offline:download scope (separate from the plan gate) | Add the scope to the key on an entitled plan |
403 | interact_not_enabled | CHRTinteract requires the Dev plan or above | Upgrade at /plans; see CHRTinteract |
403 | style_requires_dev_plan | Binding a custom style requires the Dev plan or above | Upgrade, or use the free S-52 / S-101 / CHRT / INT-1 / U.S. Chart No. 1 families via ?symbols= |
429 | monthly_limit_exceeded | The plan's monthly tile or feature allowance is spent | Wait for the next billing cycle, upgrade, or enable overage billing |
404 | not_found | Resource does not exist (cell, tileset group) | Verify the endpoint URL and resource ID |
429 | rate_limit_exceeded | Too many requests in the current window | Wait for Retry-After seconds, implement backoff |
Server errors (5xx)
| Code | Error | Description | Action |
|---|---|---|---|
500 | internal_error | Unexpected server error | Retry after a brief delay; contact support if persistent |
502 | upstream_error | Upstream tile provider returned an error | Retry; the upstream service may be temporarily unavailable |
503 | service_unavailable | API is temporarily down for maintenance | Retry after the maintenance window |
Common error scenarios
Invalid API key
// 401 Unauthorized
{
"error": "unauthorized",
"message": "Invalid or missing API key."
}Coverage not available
// 403 Forbidden
{
"error": "forbidden",
"message": "Your coverage plan does not include this chart source.",
"details": {
"required_coverage": "CA",
"current_coverage": ["US"]
}
}Invalid bounding box
// 400 Bad Request
{
"error": "bad_request",
"message": "Invalid bbox parameter. Expected format: west,south,east,north",
"details": {
"param": "bbox",
"received": "invalid"
}
}Monthly limit reached
// 429 Too Many Requests
{
"error": "monthly_limit_exceeded",
"message": "You have exceeded your monthly tile serve limit.",
"details": {
"limit": 5000,
"used": 5000,
"resets_at": "2026-04-01T00:00:00Z"
}
}Handling errors
async function fetchFeatures(bbox: string) {
const res = await fetch(
`https://api.chrt.co/v1/features?bbox=${bbox}`,
{ headers: { 'x-api-key': API_KEY } }
);
if (!res.ok) {
const error = await res.json();
switch (res.status) {
case 429:
const retryAfter = res.headers.get('Retry-After');
console.log(`Rate limited. Retry after ${retryAfter}s`);
break;
case 401:
console.error('Invalid API key');
break;
case 403:
console.error('Coverage access denied:', error.details);
break;
default:
console.error('API error:', error.message);
}
throw new Error(error.message);
}
return res.json();
}For situational awareness only — not for primary navigation. CHRT is not an ECDIS and is not SOLAS-compliant.