Error Reference
API error codes and troubleshooting guide.
Error Reference
All API errors return a JSON response with an error field describing the issue.
{
"error": "Error message here"
}HTTP Status Codes
| Status | Error | Cause |
|---|---|---|
| 400 | text is required and must be non-empty | Missing or empty text field |
| 400 | text must not exceed 5000 characters | Input too long |
| 400 | workspace is required because this operator token can access multiple workspaces | Token spans multiple workspaces; pass workspace |
| 400 | project_slug "..." exists in multiple accessible workspaces | Ambiguous project slug; pass workspace |
| 400 | This operator token is restricted to specific projects; pass project_slug | Token is project-narrowed |
| 401 | Missing Authorization header | No Bearer token provided |
| 401 | Invalid or expired operator token | Token not found, revoked, or expired |
| 401 | Legacy API keys are retired | Old sk- key used after the operator-token cutover |
| 403 | Workspace "..." is not in this operator token's scope | Workspace outside the token's scope |
| 403 | Only workspace owners and admins can translate with an operator token | Caller's workspace role lacks write access |
| 403 | This operator token has no accessible workspaces | Membership removed or scope emptied |
| 404 | Project "..." was not found in ... | Unknown project slug or id |
| 429 | Rate limit exceeded | Per-operator rate limit hit |
| 429 | Monthly character quota exceeded | Workspace quota used up |
| 400 | Pass either text or texts, not both. | /detect received both fields |
| 400 | texts must not contain more than 100 items | /detect batch too large |
| 400 | texts[N] must be a non-empty string | /detect batch item empty or not a string |
| 500 | Translation failed | Upstream provider error |
| 500 | Language detection failed | Unexpected detection error |
Handling Errors
Rate Limiting (429)
When you receive a 429 error, implement exponential backoff:
async function translateWithRetry(text, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const res = await fetch("/api/v1/translate", {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ text }),
});
if (res.status === 429) {
const delay = Math.pow(2, i) * 1000; // 1s, 2s, 4s
await new Promise(r => setTimeout(r, delay));
continue;
}
return res.json();
}
throw new Error("Max retries exceeded");
}Quota Exceeded
When your monthly quota is exhausted:
- Check your current usage via GET /usage
- Upgrade your plan in Settings → Billing
- Wait for the next billing period
Authentication Errors
If you receive a 401 error:
- Verify your operator token is correct
- Check if the token has been revoked or expired under Account → Operator tokens
- Ensure the
Authorizationheader format isBearer opt_your-token - Legacy
sk-keys no longer work; create an operator token instead
Scope and Permission Errors
If you receive a 403 error:
- Pass
workspacewhen the token can access multiple workspaces - Confirm you still hold the
owneroradminrole where the token translates (detection and usage only need membership) - Confirm the workspace or project is inside the token's scope