diff --git a/content/docs/configuration/librechat_yaml/ai_endpoints/meta.json b/content/docs/configuration/librechat_yaml/ai_endpoints/meta.json index cfde5c3eb..6f793c743 100644 --- a/content/docs/configuration/librechat_yaml/ai_endpoints/meta.json +++ b/content/docs/configuration/librechat_yaml/ai_endpoints/meta.json @@ -18,6 +18,7 @@ "mlx", "moonshot", "nearai", + "neon", "neurochain", "ollama", "openrouter", diff --git a/content/docs/configuration/librechat_yaml/ai_endpoints/neon.mdx b/content/docs/configuration/librechat_yaml/ai_endpoints/neon.mdx new file mode 100644 index 000000000..ea98b4bf6 --- /dev/null +++ b/content/docs/configuration/librechat_yaml/ai_endpoints/neon.mdx @@ -0,0 +1,75 @@ +--- +title: Neon AI Gateway +description: Configure Neon AI Gateway as a custom endpoint in LibreChat. +--- + +Neon AI Gateway is an OpenAI-compatible inference gateway provided by Neon. A single Neon credential gives you access to models from OpenAI, Google, Meta, Databricks, and Alibaba, so you do not need separate provider accounts. + + + +Neon AI Gateway is generally available. It requires a paid Neon plan and is not available in every region; see [Regions](https://neon.com/docs/introduction/regions) for current coverage. + + + +## Get a credential + +In the [Neon Console](https://console.neon.tech/), select your branch, click **Credentials** under **APP BACKEND**, then **Create credential** and check the `ai_gateway:invoke` scope. Neon shows the credential only once, so copy it before closing the dialog. + +You can also create one through the Neon API: + +```bash +curl -X POST "https://console.neon.tech/api/v2/projects/{project_id}/branches/{branch_id}/credentials" \ + -H "Authorization: Bearer $NEON_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"scopes": ["ai_gateway:invoke"], "principal_type": "user"}' +``` + +Add the credential to your `.env` file: + +```bash filename=".env" +NEON_AI_GATEWAY_TOKEN=nt_live_your-credential-here +``` + +## Find your branch host + +Every Neon branch has its own gateway host, so there is no single URL that covers a whole account. The Neon Console shows the host for a branch on the AI Gateway page as `NEON_AI_GATEWAY_BASE_URL`, written below as `https://`. It is not the same as your database connection string. + +Chat completions live at `/v1/chat/completions`, so the `baseURL` is the branch host with `/v1` appended. + +## Configuration + +Add the endpoint under `endpoints.custom` in your `librechat.yaml`: + +```yaml filename="librechat.yaml" + - name: "Neon AI Gateway" + apiKey: "${NEON_AI_GATEWAY_TOKEN}" + baseURL: "https:///v1" + models: + default: ["gpt-5-mini"] + fetch: true + titleConvo: true + titleModel: "gpt-5-mini" + modelDisplayLabel: "Neon" +``` + +To keep the host out of `librechat.yaml`, put the full URL including `/v1` in an environment variable and reference it: + +```yaml filename="librechat.yaml" + baseURL: "${NEON_GATEWAY_URL}" +``` + +To pin a fixed model list instead of fetching the catalog, set `fetch: false` and name the models yourself: + +```yaml filename="librechat.yaml" + models: + default: ["gpt-5-mini", "gemini-3-flash", "qwen3-next-80b-a3b-instruct"] + fetch: false +``` + +## Notes + +- Neon implements `GET /v1/models`, so `fetch: true` works and returns only the models your branch can serve. The catalog is small, so fetching it does not slow down the model list. +- Model IDs are short, for example `gpt-5-mini`, `gemini-3-flash`, or `llama-4-maverick`. The [Neon model catalog](https://neon.com/docs/ai-gateway/models) lists context windows and pricing, and the same catalog is browsable on [Models.dev](https://models.dev/providers/neon/). +- Because the host is per branch, add one custom endpoint per Neon branch you want to reach, each with its own `name`. +- A `403` means the credential lacks the `ai_gateway:invoke` scope or does not cover the branch you are calling. A `429` with error code `REQUEST_LIMIT_EXCEEDED` is a Neon account quota, not a LibreChat error; check the `Retry-After` header. +- Open-weight models are available to every project immediately, while frontier models from OpenAI and Google roll out gradually, so a model listed in the catalog may not yet be enabled on your project.