Skip to main content
These errors apply to requests sent to https://gateway.ngrok.ai with an access key. Every response carries the request’s ID in Ngrok-AIG-Request-Id, so quote that value when you contact support. See Response headers.

Request and routing errors

The gateway rejects these before it makes any upstream attempt, so the response carries no Ngrok-AIG-Attempts header and the request is not billed.

ERR_NGROK_27228

Message Invalid request: REASON HTTP Status 400 Bad Request Causes
  • The request body is not valid JSON
  • A required field is missing for the API surface you called
  • A field holds a value the surface does not accept
Solutions
  • Check the reason in the message for the offending field
  • Verify the body matches the API surface you posted to, whether Chat Completions, Responses, Messages, or the native Gemini surface

ERR_NGROK_27224

Message Unknown model “MODELID”.SUGGESTION HTTP Status 400 Bad Request Causes
  • The model ID is misspelled
  • The model is not in the model catalog and no custom provider defines it
Solutions
  • Check the suggestion in the message, which names the closest catalog match
  • Look the model up in the model catalog
  • Qualify the model with its provider, such as openai:gpt-4o. See Choose a model

ERR_NGROK_27225

Message Unknown provider “PROVIDERID”. HTTP Status 400 Bad Request Causes
  • The provider prefix is misspelled
  • The provider is a custom provider that does not exist on your account
Solutions

ERR_NGROK_27230

Message MODEL” is not a known model, and “PROVIDER” is not a recognized provider. HTTP Status 400 Bad Request Causes
  • A provider-qualified model name whose prefix is neither a known provider nor part of a real model ID
Solutions
  • Use provider:model, with the provider exactly as the Providers API reports it
  • Drop the prefix to let the gateway resolve the model from the catalog

ERR_NGROK_27229

Message Invalid model address “ADDRESS”. HTTP Status 400 Bad Request Causes
  • The model field is empty, or holds more separators than provider:model allows
Solutions
  • Send either a bare model ID or a single provider:model pair

ERR_NGROK_27204

Message Unsupported API surface “PATH”. HTTP Status 400 Bad Request Causes
  • The request path is not one the gateway serves
Solutions
  • Post to /v1/chat/completions, /v1/responses, /v1/messages, or the native Gemini path /v1beta/models/{model}:generateContent
  • Point your SDK’s base URL at https://gateway.ngrok.ai/v1 rather than a full endpoint path

ERR_NGROK_27226

Message Provider “PROVIDERID” does not support API surface “SURFACE”. HTTP Status 400 Bad Request Causes
  • The provider has no equivalent of the surface you called, such as the Responses API on a provider that only serves Chat Completions
Solutions
  • Call the surface the provider supports. See the provider’s page under Getting Started With
  • Choose a different provider for that surface

Access policy errors

ERR_NGROK_27231

Message Provider “PROVIDERID” is not allowed by the access policy. HTTP Status 403 Forbidden Causes
  • The access key’s configuration does not include the provider in its access scope
Solutions

ERR_NGROK_27232

Message Model “MODELID” is not allowed by the access policy. HTTP Status 403 Forbidden Causes
  • The configuration’s access scope excludes the model, even though the provider is allowed
Solutions

ERR_NGROK_27001

Message This account does not have access to AI Gateway access keys. HTTP Status 403 Forbidden Causes
  • The account has no AI Gateway credits
  • The AI Gateway feature is not enabled for the account
Solutions
  • Purchase credits (minimum $5.00)
  • Contact ngrok support if you believe this is an error

Credential and credit errors

ERR_NGROK_27201

Message Authentication failed: REASON HTTP Status 401 Unauthorized Causes
  • No access key in the request
  • The access key is malformed, revoked, or deleted
Solutions
  • Send your access key as Authorization: Bearer ng-xxxxx-g1-xxxxx, or as x-api-key on the Anthropic surface and X-Goog-Api-Key on the native Gemini surface
  • Confirm the key still exists with the Access Keys API

ERR_NGROK_27202

Message No keys available for provider “PROVIDERID”. HTTP Status 502 Bad Gateway Causes
  • The access key’s configuration has no routing credentials for the requested provider
  • Every provider key the configuration referenced was deleted
Solutions

ERR_NGROK_27206

Message Credit check failed: REASON HTTP Status 402 Payment Required Causes
  • The request needs an ngrok-managed key and the account’s credit check did not pass
Solutions

ERR_NGROK_4026

Message Your account has run out of credit. HTTP Status 403 Forbidden Causes
  • The AI Gateway credit balance has reached zero
  • Credits have expired
Solutions

ERR_NGROK_27233

Message Model “MODELID” is not available with an ngrok-managed key for provider “PROVIDERID”: add your own provider key to use uncataloged models. HTTP Status 400 Bad Request Causes
  • The model is not in ngrok’s catalog, so ngrok has no pricing to bill it against
Solutions

ERR_NGROK_27239

Message ngrok can’t serve “MODELID” on provider “PROVIDERID” with an ngrok-managed key right now. Add your own provider key to use it. HTTP Status 503 Service Unavailable Causes
  • ngrok’s own capacity for that model and provider is temporarily unavailable
Solutions

Upstream failures

These arrive after at least one upstream attempt, so Ngrok-AIG-Attempts tells you how many candidates the gateway tried. See Handle gateway errors for the order it tries them in.

ERR_NGROK_27208

Message All retries exhausted, last error: LASTERROR HTTP Status 502 Bad Gateway Causes
  • Every candidate failed, or the request hit the 10-attempt cap
Solutions

ERR_NGROK_27211

Message Upstream provider rejected the API key. HTTP Status 401 Unauthorized Causes
  • The provider key stored in ngrok is invalid, revoked, or rotated at the provider
Solutions

ERR_NGROK_27217

Message Upstream provider rate limit exceeded. HTTP Status 429 Too Many Requests Causes
  • Every credential and candidate the gateway tried was rate limited
Solutions
  • Attach more provider keys so the gateway has another credential to try
  • Add candidates from other providers. See Multi-provider failover
  • Slow your request rate, or raise your quota with the provider

ERR_NGROK_27207

Message Upstream request timed out. HTTP Status 504 Gateway Timeout Causes
  • A single upstream attempt exceeded the per-request timeout
Solutions
  • Raise the per-request timeout in Account Settings
  • Shorten the prompt, or choose a faster model

ERR_NGROK_3810

Message Request timed out after TIMEOUT. Try a shorter prompt or increase your timeout. HTTP Status 504 Gateway Timeout Causes
  • Every attempt together exceeded the total timeout
  • Too many slow candidates in the failover list
Solutions
  • Raise the total timeout in Account Settings
  • Lower the per-request timeout so a slow provider fails sooner and leaves budget for the next candidate
  • Reduce the number of failover candidates

ERR_NGROK_27227

Message No backend available: REASON HTTP Status 502 Bad Gateway Causes
  • No candidate remained that the gateway could dispatch to
Solutions
  • Confirm the configuration’s routing rules cover the provider you requested
  • See Handle gateway errors for how candidates are exhausted

ERR_NGROK_27237

Message Request rejected: a routing loop was detected. Double check your custom provider URLs do not cause an infinite proxy loop. HTTP Status 502 Bad Gateway Causes
  • A custom provider’s base URL points back at the AI Gateway
Solutions

Limit errors

ERR_NGROK_3811

Message Input too large: INPUTTOKENS tokens (max MAXALLOWED). Shorten your prompt. HTTP Status 413 Payload Too Large Causes
  • The prompt and context exceed the account’s max input tokens
  • Very long conversation history, or large embedded content in messages
Solutions
  • Reduce the prompt length or conversation history
  • Raise or clear maxInputTokens in Account Settings
  • Count tokens client-side before sending

Retired setup

ERR_NGROK_3820

Message
HTTP Status 403 Forbidden Causes
  • A Traffic Policy still contains the retired ai-gateway action
Solutions
  • Remove the ai-gateway action from the endpoint’s Traffic Policy
  • Send LLM traffic to https://gateway.ngrok.ai with an access key instead, and manage the gateway at app.ngrok.ai
  • Credits from the retired setup were migrated automatically. Email support@ngrok.com if your balance looks wrong

Other codes

The gateway returns one code per upstream status class, beyond the ones above. Each has a page under ngrok error codes:

SDK error handling

Handle ngrok errors in your SDK:

Next steps

Debug failed requests

Diagnose a failure from the response

Handle gateway errors

Which failures the gateway retries, and in what order