AI Gateway

Errors and limits

Status codes the gateway returns, and the capabilities it doesn't offer
View as Markdown

The gateway returns standard OpenAI-style error responses. Common cases:

StatusMeaningWhat to do
401Missing/invalid ASTRO_GATEWAY_API_KEY.Redeploy so the key is re-injected; don’t hardcode it.
404Wrong path.Ensure your base URL ends in /v1.
429Rate or usage limit reached.Back off and retry; the OpenAI SDKs retry 429/5xx automatically.

What the gateway doesn’t cover

  • Provider-native SDKs and prefixes (except Anthropic). Call models through the OpenAI-compatible API by their gateway id (for example claude-sonnet-4-6), not with a provider prefix such as anthropic/. The one exception is the native Anthropic Messages API, served on the /anthropic passthrough for Claude Code / Claude Agent SDK agents. See Anthropic API.
  • Anthropic server-side tools. web_search, web_fetch, code execution, and computer use aren’t available on the Claude models. Client-defined tools work normally, and the gpt-* models have their own web search.
  • Image generation. No image-generation models are offered. Image input is supported: see Vision.
  • Bring-your-own-model. Adding new models or fine-tunes to the gateway isn’t self-serve; contact support.

Next steps

  • Usage limits: cap what an account can spend before it hits 429
  • Usage: see what your account has spent on model calls this period