Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"mlx",
"moonshot",
"nearai",
"neon",
"neurochain",
"ollama",
"openrouter",
Expand Down
75 changes: 75 additions & 0 deletions content/docs/configuration/librechat_yaml/ai_endpoints/neon.mdx
Original file line number Diff line number Diff line change
@@ -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.

<Callout type="warning" title="Paid plans and regional availability">

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.

</Callout>

## 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://<your-neon-branch-host>`. 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://<your-neon-branch-host>/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.