Errors & limits

When something goes wrong.

Errors come back as a JSON envelope with a stable type, a human message, and a request_id you can send us when reporting an issue.

Actual response - invalid key (HTTP 401)
{"type": "error", "error": {
   "type": "authentication_error",
   "message": "Invalid or revoked API key.",
   "request_id": "063f8b83-eee2-4383-a5cf-11e4bcd29d7c"
 }}
HTTPMeaningWhat to do
400Malformed body (missing/wrong-type field)The message names the exact field - fix and retry.
401Invalid or revoked API keyCheck the key; issue a new one in the console.
402Out of balance, no card on file, or a tier capTop up or add a card in the console. The response carries balance_cents and floor_cents, so you can tell which one stopped you.
404No such memory, store, or imageCheck the id. get_image also answers 404 when the memory exists but carries no image.
409That name is already takenStore and workspace names are unique within an account - pick another one.
413Request body over 10MBBase64 runs about 33% larger than the file it encodes, so resize the image before encoding it.
429Rate limitedThe SDK already retries these for you, with backoff and jitter, honouring Retry-After. Getting one means the retries ran out - lower your concurrency rather than wrapping a loop of your own around it.
501This model's engine does not implement that endpointImages and revision history need a newer engine. GET /api/v1/models lists which models serve what.
5xxServer-side problemRetry with backoff, but not blindly. The SDK does not auto-retry a 5xx here, because every call on this API is a POST and the server may have stored your request already. Resend with an idempotency key so a repeat cannot double-write, and include request_id if you contact us.

Every error is a WosError, and each status also has a class of its own - BadRequestError, AuthenticationError, PaymentRequiredError, NotFoundError, ConflictError, RateLimitError, ServerError, APIConnectionError. Catch the one you mean to handle instead of comparing numbers.

# SDK error handling (Python)
from wontopos import Client, WosError, RateLimitError, PaymentRequiredError

try:
    mem.search("...", user_id="alice")
except PaymentRequiredError: ...      # 402 - top up
except RateLimitError: ...            # 429 - the SDK already retried; slow down
except WosError as e: ...            # e.status, e.message, e.request_id
except (ValueError, TypeError): ...    # never left the client

Some mistakes never reach us. The API key, the store id, the idempotency key and the image are all checked before the request goes out, and those raise ValueError or TypeError - not WosError. An except WosError on its own will not catch them.

Key safety. Your key is shown once at creation and stored only as a hash on our side. Keep it in an environment variable; if it leaks, revoke it in the console - revocation is immediate.

Rate limits are per account, shared across all your keys, and scale with your tier - see Usage tiers. Your account's usage is shown in the console.