Error Codes
Get3W uses two levels of error reporting:
- HTTP errors — returned as the HTTP status code with a JSON body when the request itself fails (authentication, validation, rate limits, etc.)
- Task errors — returned inside the task result object when the task was accepted but failed during execution
HTTP Error Response Format
All HTTP errors from /v1/ endpoints return the same structure:
json
{
"code": 401,
"error": "Invalid or revoked API key"
}| Field | Type | Description |
|---|---|---|
code | int | HTTP status code (matches the response status) |
error | string | Human-readable error description |
HTTP Status Codes
| Code | Name | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid parameters or request body |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient balance |
| 404 | Not Found | Endpoint or resource not found |
| 429 | Too Many Requests | Concurrent task limit exceeded for your tier |
| 500 | Internal Server Error | Unexpected server-side error |
400 — Bad Request
Returned when request validation fails.
| Error | Cause |
|---|---|
Invalid parameters | Missing required fields or wrong types |
401 — Unauthorized
Returned when authentication fails.
| Error | Cause |
|---|---|
Missing Authorization header | No Authorization header in the request |
Invalid Authorization format, expected: Bearer <api_key> | Header is not in Bearer <key> format |
Invalid or revoked API key | Key does not exist or has been deleted |
403 — Forbidden
| Error | Cause |
|---|---|
Insufficient balance | Account balance is zero — top up to continue |
404 — Not Found
| Error | Cause |
|---|---|
Not found | The requested endpoint or resource does not exist |
429 — Too Many Requests
| Error | Cause |
|---|---|
Rate limit exceeded | Too many concurrent tasks for your account tier |
500 — Internal Server Error
| Error | Cause |
|---|---|
Server error | An unexpected error occurred on the server |
Task Error Codes
When a task is accepted (HTTP 200) but fails during execution, the task result includes a code and error field:
json
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"model": "google/nano-banana-pro/text-to-image",
"status": "failed",
"code": 1200,
"outputs": null,
"error": "Content moderation: prompt contains prohibited content",
"created_at": "2024-01-01T00:00:00.000Z"
}| Code | Name | Description |
|---|---|---|
| 0 | Success | Task completed successfully |
| 1200 | Content Moderation | Prompt or input was flagged by content moderation |
| 1400 | Missing Parameter | A required parameter was not provided |
| 1401 | Invalid Parameter | A parameter value is invalid or out of range |
| 1402 | Media Access Failed | Could not download or access the provided media URL |
| 1403 | Task Execution Failed | The task encountered an error during processing |
| 1405 | Task Failed | General task failure |
| 5000 | Internal Error | An internal system error occurred |
| 5003 | Service Unavailable | The upstream model provider is temporarily unavailable |
| 5004 | Timeout | The task timed out waiting for a response from the provider |
Retry Strategy
For transient errors (HTTP 429, 500 and task codes 5000, 5003, 5004), implement exponential backoff:
python
import time
import requests
def api_request_with_retry(url, headers, json_data, max_retries=3):
for attempt in range(max_retries):
response = requests.post(url, headers=headers, json=json_data)
if response.status_code == 200:
return response.json()
elif response.status_code in (429, 500):
wait_time = 2 ** attempt
time.sleep(wait_time)
else:
response.raise_for_status()
raise Exception("Max retries exceeded")For task-level transient errors, retry by submitting a new task.
Next Steps
- Get Started with API — Make your first API call
- API Authentication — Authentication details and account tiers