Skip to content

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, insufficient balance, etc.)
  • Task errors — returned inside the task result object when the task was accepted but failed during execution

HTTP Error Response Format

HTTP errors from /v1/ endpoints return code plus error:

json
{
  "code": 401,
  "error": "Invalid or revoked API key"
}
FieldTypeDescription
codeintHTTP status code (matches the response status)
errorstring | objectError description, or a nested error object

WARNING

error is usually a string, but for some errors — an unrecognized provider in the slug, and insufficient balance — it is a nested object carrying its own code and error. The outer code is always the HTTP status; the inner code is the business error code:

json
{
  "code": 400,
  "error": {
    "code": 1401,
    "error": "Invalid provider: 'notaprovider'. Please check the model slug format: {provider_id}/{model_id}/{run_type}"
  }
}

Parse defensively — check whether error is a string or an object before reading it.

Chat endpoints are the exception: POST /v1/chat/completions and GET /v1/models return the OpenAI error shape instead, so an OpenAI client can consume them unchanged:

json
{
  "error": {
    "message": "...",
    "type": "invalid_request_error",
    "param": "model"
  }
}

Authentication failures on chat endpoints still use the {"code","error"} shape above, because they are rejected before the handler runs.

HTTP Status Codes

CodeNameDescription
200OKRequest successful
400Bad RequestInvalid parameters or request body
401UnauthorizedMissing or invalid API key
402Payment RequiredInsufficient balance for the estimated cost
403ForbiddenAccount suspended, or prompt blocked by content policy
404Not FoundEndpoint or model slug does not exist
500Internal Server ErrorUnexpected server-side error

Get3W does not enforce per-minute rate limits or concurrency caps, so there is no 429. See What are Account Tiers.

400 — Bad Request

Returned when request validation fails.

ErrorCause
Invalid parametersMissing required fields or wrong types

401 — Unauthorized

Returned when authentication fails.

ErrorCause
Missing Authorization headerNo Authorization header in the request
Invalid Authorization format, expected: Bearer <api_key>Header is not in Bearer <key> format
Invalid or revoked API keyKey does not exist or has been deleted

402 — Payment Required

ErrorCause
Insufficient balance. Current: $X.XXX, required: $X.XXX. Please top up and try again.Account balance is lower than the estimated cost of the task

404 — Not Found

ErrorCause
Not foundThe requested endpoint or resource does not exist

500 — Internal Server Error

ErrorCause
Server errorAn 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": [],
  "error": "Content moderation: prompt contains prohibited content",
  "created_at": "2026-03-28T07:50:42"
}
CodeNameDescription
0SuccessTask completed successfully
1200Content ModerationPrompt or input was flagged by content moderation
1201Real Person DetectedInput image contains a real person; use illustrations or AI-generated characters instead
1202Copyright ViolationThe output may be related to copyright restrictions; avoid copyrighted characters, brands, or content
1400Missing ParameterA required parameter was not provided
1401Invalid ParameterA parameter value is invalid or out of range
1402Media Access FailedCould not download or access the provided media URL
1403Task Execution FailedThe task encountered an error during processing
1405Task FailedGeneral task failure
5000Internal ErrorAn internal system error occurred
5003Service UnavailableThe upstream model provider is temporarily unavailable
5004TimeoutThe task timed out waiting for a response from the provider

Retry Strategy

For transient errors (HTTP 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 == 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

Released under the MIT License.