Troubleshoot LLM provider errors
When you use your own LLM provider key with Glean, you may encounter errors during setup or ongoing operation. This guide covers the most common error codes, what they mean, and how to resolve them.
Glean sends LLM provider alert emails when your endpoint returns repeated errors. If you've received one of these alerts, use this guide to diagnose and fix the issue.
Common error codes
401: Invalid or expired API key
Issue: Glean can't authenticate with your LLM provider because the API key is invalid, expired, or was revoked.
Resolution:
- Go to your LLM provider's portal and confirm the API key is still active.
- If the key has expired or been revoked, generate a new one.
- In the admin console, go to Platform > LLMs and update the key.
- Click Validate to confirm the new key works.
403: Access denied
Issue: The request reached your LLM provider, but it was rejected. Common causes include:
- Your organization's IP isn't allowlisted in the provider's network settings.
- A web application firewall (WAF) or network policy is blocking Glean's requests.
- The API key doesn't have the required permissions for the requested model.
Resolution:
- Check your provider's network or firewall settings and confirm that Glean's traffic is allowed.
- Verify the API key has the correct permissions and role assignments for the models you've selected.
- If you use a custom gateway or proxy, confirm it's forwarding requests correctly.
404: Deployment or model not found
Issue: Glean is trying to call a model deployment that doesn't exist at the configured endpoint. This is one of the most common Azure OpenAI errors and usually means the deployment name in Glean doesn't match the deployment name in your provider's portal.
Resolution:
- In your provider's portal, find the exact deployment name:
- Azure OpenAI: Go to the Azure Portal, navigate to your Azure OpenAI resource, and select Model deployments > Manage Deployments. Copy the Deployment name exactly as shown.
- OpenAI: Check that the model name in Glean matches a model available in your OpenAI organization.
- In the admin console, go to Platform > LLMs and compare the deployment name you entered against the one in your provider's portal.
- Fix any mismatches — deployment names are case-sensitive and must match exactly.
- Click Validate to confirm the connection.
The deployment name is not the same as the model name. For example, you might deploy the model gpt-5.1 with a deployment name like gpt-51-prod. Glean needs the deployment name, not the model name.
429: Rate limit exceeded
Issue: Your LLM provider is throttling requests because you've exceeded your provisioned capacity (tokens per minute or requests per minute).
Resolution:
- Check your current quota in your provider's portal:
- Azure OpenAI: Go to Quotas in the Azure Portal.
- OpenAI: Go to Settings > Organization > Limits in the OpenAI Dashboard.
- Compare your quota against the recommended capacity requirements for your number of users.
- Request a quota increase from your provider if your current limits are too low.
- If you're using Azure OpenAI, consider deploying models across multiple regions to distribute traffic.
500: Server or gateway error
Issue: The LLM provider or an intermediary gateway returned an internal error. This indicates:
- A temporary outage on the provider's side.
- A misconfiguration in a custom LLM gateway (such as an authentication header mismatch).
Resolution:
- Check your provider's status page for any ongoing outages:
- If you use a custom gateway or proxy (such as Azure API Management), check its logs for more details. Common causes include:
- Authentication header mismatch: Azure OpenAI expects an
api-keyheader, while some gateways send anAuthorization: Bearerheader instead. Confirm your gateway forwards the correct header format. - Unsupported custom headers: Confirm your gateway isn't adding headers that the LLM provider doesn't recognize.
- Authentication header mismatch: Azure OpenAI expects an
- If the error persists and there's no provider outage, contact Glean support.
Timeout errors
Issue: Glean's request to your LLM provider didn't receive a response within the expected time frame. You might see errors such as "context deadline exceeded" or "something went wrong."
Common causes include:
- The LLM endpoint is slow or unresponsive.
- A custom gateway or proxy is adding latency.
- Network connectivity issues between Glean and the provider.
Resolution:
- Confirm the LLM endpoint is reachable and responding to other requests.
- If you use a custom gateway, check its latency metrics and logs.
- Verify there are no network issues or firewall rules that could be slowing traffic.
- If the issue persists, contact Glean support.
Verify your configuration
If you're seeing errors after initial setup or after making changes, walk through these checks:
- API key: Confirm the key is active and hasn't been rotated or revoked.
- Endpoint URL: Confirm the endpoint URL is correct and reachable. For Azure OpenAI, don't include
https://in the endpoint field. - Deployment names: Confirm every deployment name in Glean matches your provider's portal exactly (case-sensitive).
- Region support: If you're using Azure OpenAI, confirm your resource is deployed in a region that supports the Responses API.
- Quota: Confirm your provisioned capacity meets the minimum requirements for your number of users.
- Validate: In the admin console, go to Platform > LLMs and click Validate to test the connection.
When to contact Glean support
Contact Glean support if:
- You've verified your configuration and the error persists.
- You're seeing errors that aren't listed on this page.
- Your provider's status page shows no issues, but Glean still can't connect.
- You need help interpreting an LLM provider alert email.