Errors

HTTP status codes and common API failure modes.

FastAPI returns JSON { "detail": "..." } on errors. SSE chat streams emit an error event before closing.

HTTP status codes

CodeMeaningTypical cause
400Bad RequestInvalid tool arguments, chat persistence failure, malformed reissue proof
403ForbiddenMissing or invalid X-Agent-Access-Token on protected routes
404Not FoundAgent or conversation does not exist
410GoneAgent is soft-deleted (inactive)
422Unprocessable EntityMissing required fields (e.g. agent_id on chat)
503Service UnavailableOpenAI upstream failure or RPC service unavailable

Tool-level failures

Tools return structured JSON with success: false and a message field for RPC errors, cap violations, insufficient balance, or testnet URL rejection on write tools in production.