Skip to main content

Error Codes

All proxy errors are returned as JSON with an error field prefixed with AISpendOps:.

Proxy errors

StatusErrorCause
400Dimensions are required (X-ASO-Dims header)Mandatory dimensions enabled but header missing
400Too many dimension pairs (max 8)More than 8 dimension key-value pairs
400Dimension key "{key}" not allowedDimension key not in the allowed list
400Dimension key too longKey exceeds max length (32 chars)
400Dimension value too longValue exceeds max length (64 chars)
401Missing X-ASO-API-KeyX-ASO-API-Key header not present
403Invalid X-ASO-API-KeyKey format invalid or not recognised
403API key is inactiveKey exists but has been deactivated
403Provider not allowed by API key policyProvider not in the key's allow-list
403Model not allowed by API key policyModel doesn't match any allowed pattern
404Unknown providerProvider name not recognised
502Upstream fetch failedCould not reach the provider's API

Example response

{
"error": "AISpendOps: Missing X-ASO-API-Key"
}

Provider errors

Errors from the upstream provider (e.g. 400 invalid model, 429 rate limit, 500 server error) are passed through to you unchanged with the provider's original status code and response body. These are not prefixed with AISpendOps:.

Distinguishing proxy vs provider errors

  • Proxy errors always have "error": "AISpendOps: ..." in the response body
  • Provider errors have the provider's native error format (varies by provider)

This makes it easy to determine whether an error came from AI SpendOps or the upstream provider.