Skip to Content
API ReferenceError Reference

Error Reference

All API errors return a JSON body with an error message and a code identifier.

{ "error": "Human-readable error message", "code": "ERROR_CODE", "details": "Optional additional context" }

Error Codes

Client Errors (4xx)

HTTP StatusCodeDescriptionWhat To Do
400VALIDATION_ERRORMissing or invalid request fieldsCheck your request body matches the schema. prompt is required and must be 1–10,000 chars.
400TX_NOT_FOUNDTransaction hash not found on BaseVerify the tx hash is correct and the transaction is confirmed. Wait a few seconds if just submitted.
400TX_FAILEDTransaction failed on-chainThe USDC transfer did not succeed. Check your wallet balance and try again.
400INVALID_PAYMENTNo USDC transfer to gateway wallet found in txThe transaction doesn’t contain a USDC transfer to the correct wallet. Check the recipient address.
400INSUFFICIENT_PAYMENTTransfer amount is less than endpoint priceYou need to send at least the endpoint price in USDC. Check pricing in the agent manifest.
400TX_ALREADY_USEDThis transaction hash was already submittedEach tx can only be used once. Make a new USDC transfer for each generation.
402X402 payment challengeNormal X402 flow. Sign the payment and retry with X-PAYMENT header. Handled automatically by x402-fetch.
404NOT_FOUNDEndpoint or task not foundCheck the slug or task ID. The endpoint may have been removed or the task ID is invalid.
429Rate limitedToo many requests. Wait and retry. Check the Retry-After header for how long to wait.

Server Errors (5xx)

HTTP StatusCodeDescriptionWhat To Do
500INTERNAL_ERRORInternal server errorUnexpected failure. Try again. If persistent, the service may be down.
500EXECUTION_ERRORGeneration failedThe AI provider returned an error. Try a different prompt or try again later.

Task-Level Errors

These appear in the task status response when status: "failed":

CodeDescriptionWhat To Do
GENERATION_FAILEDAI provider failed after all retriesTry a different prompt. Some prompts may be rejected by the provider’s safety filters.

Rate Limits

EndpointLimitWindow
POST /api/x402/*10 requests60 seconds
POST /api/proxy-generate5 requests60 seconds
GET /api/task/*5 requests1 second
POST /admin/login5 attempts5 minutes

Rate limits are per IP address. When rate limited, you’ll receive HTTP 429 with a Retry-After header indicating when you can retry.

Tips

  1. Always validate your request before sending — check prompt length, tx hash format, and slug existence
  2. Handle 402 gracefully — it’s not an error, it’s the normal X402 payment negotiation
  3. Poll responsibly — use 2-second intervals for task status, not faster
  4. Budget for retries — the server retries failed generations 3 times automatically; wait for the final status before retrying yourself
Last updated on