Error Response Format
All errors return a JSON response with this structure:| Field | Type | Description |
|---|---|---|
error | string | Human-readable error message |
code | string | Machine-readable error code |
request_id | string | Request ID for support/debugging |
HTTP Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 202 | Accepted | Request accepted (async operation) |
| 204 | No Content | Request succeeded, no response body |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Authentication failed or missing |
| 403 | Forbidden | Access denied |
| 404 | Not Found | Resource not found |
| 408 | Request Timeout | Request exceeded timeout |
| 409 | Conflict | Resource conflict (e.g., already exists) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error |
| 503 | Service Unavailable | Service temporarily unavailable |
Error Codes
Authentication Errors
AUTHENTICATION_REQUIRED (401)
Authorization: Bearer $HOPX_API_KEY header.
INVALID_TOKEN (401)
Request Errors
INVALID_REQUEST (400)
RESOURCE_NOT_FOUND (404)
CONFLICT (409)
update=true.
Execution Errors
EXECUTION_TIMEOUT (408)
CODE_EXECUTION_ERROR (500)
stderr field for error details and fix your code.
Resource Errors
PAYMENT_REQUIRED (402)
RESOURCE_LIMIT_ERROR (429)
FORBIDDEN (403)
/workspace, /tmp).
Rate Limiting
RATE_LIMIT_EXCEEDED (429)
Service Errors
SERVICE_UNAVAILABLE (503)
INTERNAL_ERROR (500)
request_id if issue persists.
Error Handling Best Practices
1. Check Status Codes
2. Parse Error Responses
3. Implement Retry Logic
4. Handle Specific Errors
Getting Support
When contacting support, always include:- Request ID - From the error response
- Timestamp - When the error occurred
- API endpoint - The URL you called
- HTTP status code - The response status
- Error message - The full error response
Related
- API Introduction - Learn about the HopX API
- Rate Limits - Understand rate limit errors
- Troubleshooting - Debug common issues
- Data Model - Learn about API resources
- Python SDK Quickstart - Use the Python SDK (handles errors automatically)
- CLI Reference - Command-line interface
Next Steps
- Rate Limits - Understand rate limiting
- Data Model - Core resources and data structures
- Troubleshooting - Common issues and solutions

