Skip to main content

Error Codes

Complete reference for ASG Agent Cloud error codes.

HTTP Status Codes

CodeMeaning
200Success
400Bad Request
401Unauthorized
402Payment Required
404Not Found
429Rate Limited
500Internal Error

ASG Error Codes

Payment Errors

CodeMessageResolution
PAYMENT_REQUIREDNo payment providedInclude payment signature
QUOTE_EXPIREDQuote has expiredRequest new quote
PAYMENT_INSUFFICIENTAmount below quotePay full quoted amount
PAYMENT_INVALIDInvalid signatureCheck transaction signature
WALLET_MISMATCHWrong sender walletPay from authorized wallet

Budget Errors

CodeMessageResolution
BUDGET_EXCEEDEDRun/step budget exceededIncrease budget or start new run
QUOTA_EXCEEDEDAccount quota exceededContact support

Execution Errors

CodeMessageResolution
TOOL_NOT_FOUNDUnknown tool nameCheck tools/list
INVALID_ARGUMENTSBad tool argumentsCheck tool schema
EXECUTION_TIMEOUTExecution timed outReduce workload or increase TTL
EXECUTION_FAILEDTool execution failedCheck logs, retry

Resource Errors

CodeMessageResolution
GPU_UNAVAILABLENo GPUs availableWait and retry
LEASE_EXPIREDGPU lease expiredProvision new pod
LEASE_NOT_FOUNDUnknown lease IDCheck lease ID

Rate Limiting

CodeMessageResolution
RATE_LIMITEDToo many requestsWait and retry
CONCURRENT_LIMITToo many concurrentWait for completion

Error Response Format

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "ASG Error",
    "data": {
      "asg_code": "QUOTE_EXPIRED",
      "details": "Quote expired at 2026-02-01T12:00:00Z"
    }
  }
}

Handling Errors

try {
  await client.callTool('inference_chat', { ... });
} catch (error) {
  switch (error.data?.asg_code) {
    case 'QUOTE_EXPIRED':
      // Retry with fresh quote
      break;
    case 'RATE_LIMITED':
      // Wait and retry
      await sleep(error.data.retry_after * 1000);
      break;
    case 'BUDGET_EXCEEDED':
      // Start new run or increase budget
      break;
    default:
      // Log and escalate
      console.error(error);
  }
}