Skip to content

Error Handling

Common HTTP Status Codes

  • 200 OK: Request successful
  • 400 Bad Request: Invalid request format or parameters
  • 401 Unauthorized: Invalid or expired API key
  • 402 Payment Required: Insufficient balance in escrow account
  • 404 Not Found: Provider or model not found
  • 422 Unprocessable Entity: Request parameters invalid for model
  • 424 Failed Dependency: Escrow account not set up
  • 429 Too Many Requests: Rate limit exceeded or insufficient balance
  • 500 Internal Server Error: Server error

Error Response Format

{
  "error": {
    "message": "Insufficient balance in escrow account",
    "type": "insufficient_balance",
    "code": 402
  }
}

Handling Common Errors

Insufficient Balance

{
  "error": {
    "message": "Insufficient balance for estimated cost: 0.001 USDC",
    "type": "insufficient_balance"
  }
}

Solution: Top up your account with USDC at web dashboard.

Invalid Model

{
  "error": {
    "message": "Model not found: [model_name]",
    "type": "invalid_model"
  }
}

Solution: Check available models using GET /v1/models or browse at https://aimo.network/marketplace.

Invalid API Key

{
  "error": {
    "message": "Invalid API key",
    "type": "unauthorized"
  }
}

Solution: Verify your API key is correct (should start with aimo-sk-v2-) or generate a new one at the dashboard.