Error Handling
BlockRun uses standard HTTP status codes and returns detailed error information.
HTTP Status Codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 402 | Payment Required - Sign and retry with payment |
| 500 | Server Error - Something went wrong |
Error Response Format
{
"error": "Error type",
"message": "Detailed error message",
"details": {}
}
Common Errors
400 - Invalid Request
{
"error": "Invalid request body",
"details": [
{"path": ["model"], "message": "Required"}
]
}
Causes:
- Missing required fields (
model,messages) - Invalid model ID
- Malformed JSON
402 - Payment Required
{
"error": "Payment Required",
"message": "This endpoint requires x402 payment",
"price": {
"amount": "0.001000",
"currency": "USD"
}
}
402 is not an error
A 402 Payment Required is part of the normal x402 flow — the gateway is quoting a price. Sign and retry with payment and the SDKs handle this round-trip automatically.
402 - Payment Rejected
{
"error": "Payment verification failed",
"details": "Insufficient balance"
}
Causes:
- Insufficient USDC balance
- Invalid signature
- Expired payment authorization
500 - Server Error
{
"error": "Internal server error"
}
Causes:
- Upstream provider error
- Temporary service issue
SDK Error Classes
Troubleshooting
"Payment verification failed"
- Check your USDC balance on Base
- Ensure your wallet is on the correct network
- Verify your private key is correct
"Unknown model"
- Check the model ID matches exactly (e.g.,
openai/gpt-5.5) - See available models for valid IDs
"Timeout"
- Increase the timeout in client options
- Try a faster model (e.g.,
gpt-5.5orgpt-5.4-miniinstead ofo1)
"Network error"
- Check your internet connection
- Verify
blockrun.ai/apiis accessible