Conversation
Add a Weave integration guide for Neon AI Gateway, an OpenAI-compatible inference endpoint provided by Neon. Weave's existing OpenAI SDK autopatching traces these calls, so the guide only changes `api_key` and `base_url` on a standard `openai.OpenAI` client. The page follows the structure of the sibling OpenRouter and Together AI guides, and adds the two things that are specific to Neon: the gateway host is per database branch rather than a single shared hostname, and the catalog reports `pricing` as `null`, so traces show token counts without cost. Also add the page to the LLM Providers group in docs.json, between mistral and nvidia_nim.
`gpt-5-2-codex`, `gpt-5-1-codex-max` and `gpt-5-1-codex-mini` are not in Neon's model catalog. The models served only through the Responses endpoint are `gpt-5-3-codex` and `gpt-5-5-pro`.
…odels The set of models Neon serves only through the Responses API changes as models are added and retired, so a list written into this page goes stale without anyone noticing. Point at the Endpoints column in Neon's model catalog, which is the published source for it, and keep the current models as an example rather than as the definition.
There was a problem hiding this comment.
🟡 Changes recommended
Several Neon requirements and behaviors are outdated, and one internal link targets a nonexistent anchor.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds documentation for tracing Neon AI Gateway requests through Weave’s OpenAI SDK integration.
Changes:
- Adds setup, tracing, branch attribution, and model guidance.
- Adds the guide to Weave integration navigation.
File summaries
| File | Description |
|---|---|
weave/guides/integrations/neon.mdx |
Adds the Neon AI Gateway guide. |
docs.json |
Registers the guide in navigation. |
Review details
Suppressed comments (2)
weave/guides/integrations/neon.mdx:90
- This fragment does not exist in the OpenAI guide, so the link lands at the top of the page rather than the intended custom-functions section. Link to the actual
Tracing custom functionsheading.
While this is a basic example to get started, see the [OpenAI](/weave/guides/integrations/openai#track-your-own-ops) guide for more details on how to integrate Weave with your own functions for more complex use cases.
weave/guides/integrations/neon.mdx:88
- Inference is no longer free during the beta. Neon's current billing documentation says requests consume prepaid credits, so this sentence gives users an incorrect cost expectation.
Neon does not return a cost field and reports `pricing` as `null` in `GET /v1/models`, so traces show token counts without cost. Inference is free during the beta.
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Update access requirements and clarify Weave project naming. Remove the stale response-shape warning and replace the outdated free-beta claim with current prepaid-credit guidance.
mdlinville
left a comment
There was a problem hiding this comment.
Thanks, and sorry that it has taken a while to get to this. Here are some suggestions to keep the content from going out of date and to avoid re-documenting too many specifics of a third-party platform in the W&B docs.
| [Neon AI Gateway](https://neon.com/docs/ai-gateway/overview) is an OpenAI-compatible inference endpoint provided by Neon. A single Neon credential reaches models from OpenAI, Google, Meta, Databricks, and Alibaba, with no provider API keys. Weave detects the OpenAI SDK, so existing OpenAI code works after changing the API key and base URL. | ||
|
|
||
| <Note> | ||
| Neon AI Gateway is in beta. It requires a paid Neon plan with prepaid credits and a project in AWS US East (Ohio) (`aws-us-east-2`) or AWS Europe (Frankfurt) (`aws-eu-central-1`). |
There was a problem hiding this comment.
| Neon AI Gateway is in beta. It requires a paid Neon plan with prepaid credits and a project in AWS US East (Ohio) (`aws-us-east-2`) or AWS Europe (Frankfurt) (`aws-eu-central-1`). | |
| Neon AI Gateway is in beta. It requires a paid Neon plan with prepaid credits and a project in a supported AWS region. See [Neon AI Gateway](https://neon.com/docs/ai-gateway/overview) for detailed requirements. |
This will immediately go out of date, how about removing the specifics in favor of the Neon docs?
There was a problem hiding this comment.
We just went GA so you were right. Ill rework this section!
|
|
||
| ## Trace a Neon AI Gateway call | ||
|
|
||
| Set `api_key` to your Neon credential, set `base_url` to the branch host plus `/v1`, and use a short Neon model ID such as `gpt-5-mini`. `weave.init()` requires a project name for your traces. You can optionally prefix it with a W&B entity as `<entity>/<project>`; if you omit the entity, Weave uses your default entity. To find or update your default entity, refer to [User Settings](https://docs.wandb.ai/platform/app/settings-page/user-settings/#default-team) in the W&B Models documentation. |
There was a problem hiding this comment.
| Set `api_key` to your Neon credential, set `base_url` to the branch host plus `/v1`, and use a short Neon model ID such as `gpt-5-mini`. `weave.init()` requires a project name for your traces. You can optionally prefix it with a W&B entity as `<entity>/<project>`; if you omit the entity, Weave uses your default entity. To find or update your default entity, refer to [User Settings](https://docs.wandb.ai/platform/app/settings-page/user-settings/#default-team) in the W&B Models documentation. | |
| Set `api_key` to your Neon credential, set `base_url` to the branch host plus `/v1`, and use a short Neon model ID such as `gpt-5-mini`. `weave.init()` requires a project name for your traces. You can optionally prefix it with a W&B entity as `<entity>/<project>`; if you omit the entity, Weave uses your default entity. To find or update your default entity, refer to [Default team](/platform/app/settings-page/user-settings/#default-team). |
| ) | ||
| ``` | ||
|
|
||
| ## Choosing a model |
There was a problem hiding this comment.
| ## Choosing a model | |
| ## Choose a model |
|
|
||
| ## Choosing a model | ||
|
|
||
| Neon uses short model IDs, for example `gpt-5-mini`, `gemini-3-flash`, `llama-4-maverick`, and `qwen3-next-80b-a3b-instruct`. List what a branch can serve: |
There was a problem hiding this comment.
| Neon uses short model IDs, for example `gpt-5-mini`, `gemini-3-flash`, `llama-4-maverick`, and `qwen3-next-80b-a3b-instruct`. List what a branch can serve: | |
| Neon uses short model IDs like `gpt-5-mini`, `gemini-3-flash`, `llama-4-maverick`, and `qwen3-next-80b-a3b-instruct`. List what a branch can serve: |
| Neon uses short model IDs, for example `gpt-5-mini`, `gemini-3-flash`, `llama-4-maverick`, and `qwen3-next-80b-a3b-instruct`. List what a branch can serve: | ||
|
|
||
| ```bash | ||
| curl "$NEON_AI_GATEWAY_BASE_URL/v1/models" \ |
There was a problem hiding this comment.
| curl "$NEON_AI_GATEWAY_BASE_URL/v1/models" \ | |
| curl "${NEON_AI_GATEWAY_BASE_URL}/v1/models" \ |
This isn't a safe shell expansion mixed into the URL string like this.
|
|
||
| Neon does not return a cost field and reports `pricing` as `null` in `GET /v1/models`, so traces show token counts without cost. AI Gateway usage draws down your prepaid credit balance; see [AI Gateway pricing](https://neon.com/docs/ai-gateway/overview#pricing). | ||
|
|
||
| While this is a basic example to get started, see the [OpenAI](/weave/guides/integrations/openai#track-your-own-ops) guide for more details on how to integrate Weave with your own functions for more complex use cases. |
There was a problem hiding this comment.
| While this is a basic example to get started, see the [OpenAI](/weave/guides/integrations/openai#track-your-own-ops) guide for more details on how to integrate Weave with your own functions for more complex use cases. | |
| See the [OpenAI integration guide](/weave/guides/integrations/openai#track-your-own-ops) for more details about integrating Weave with your own functions for more complex use cases. |
| --- | ||
| title: "Neon AI Gateway" | ||
| description: "Trace calls to Neon AI Gateway, the OpenAI-compatible inference endpoint provided by Neon" | ||
| keywords: ["Neon", "Neon AI Gateway", "OpenAI SDK compatibility", "branch-scoped credentials"] |
There was a problem hiding this comment.
| keywords: ["Neon", "Neon AI Gateway", "OpenAI SDK compatibility", "branch-scoped credentials"] |
We don't use keywords for SEO.
Description
Adds a Weave integration guide for Neon AI Gateway, an OpenAI-compatible inference endpoint provided by Neon, plus the matching navigation entry in
docs.json.Why this needs no new Weave code. Neon AI Gateway is reached with the standard
openaiPython SDK pointed at a differentbase_url, so Weave's existing OpenAI SDK autopatching already traces these calls. The guide only changesapi_keyandbase_urlon anopenai.OpenAIclient. It follows the same shape as the siblingopenrouter.mdxandtogether_ai.mdxpages, including the closing pointer to the OpenAI guide.What is Neon-specific. Two things do not fit the single-shared-hostname pattern the other OpenAI-compatible pages assume:
NEON_AI_GATEWAY_BASE_URLandNEON_AI_GATEWAY_TOKENenvironment variables instead of a literal URL, and adds a short "Trace across branches" section on telling branches apart in traces.GET /v1/modelsreportspricingasnulland no cost field comes back on a response, so the page states plainly that traces show token counts without cost, rather than letting a reader assume the cost column will populate.The page also names the two model constraints a reader hits first: the Codex variants are served only on Neon's Responses API path and return
400on chat completions, and several models returnmessage.contentas an array of content blocks rather than a string.Scope is deliberately narrow, chat completions through the OpenAI SDK. The page makes no tool-calling, structured-output, embeddings, image, or audio claim, and it does not claim Weave has a native Neon provider integration.
Files:
weave/guides/integrations/neon.mdx(new, 90 lines)docs.json(one line,weave/guides/integrations/neoninserted betweenmistralandnvidia_nim)The diff is insertion-only: 91 added lines, 0 removed. English only;
fr,ja, andkoare left to the repo'sgt.config.jsontranslation pipeline.Testing
mint validatereportedsuccess build validation passed. This is the command.github/workflows/validate-mdx.ymlruns; I did not separately runmint dev.mint broken-linksreportedsuccess no broken links found.Also checked locally:
docs.jsonparses and the nav entry sits alphabetically betweenmistralandnvidia_nim; both Python snippets compile and thebashsnippet passesbash -n; frontmatter parses, code fences are even, and<Note>balances; the five external links each return200.Limitation worth stating up front. Neon AI Gateway is in beta and needs a paid Neon plan and an
aws-us-east-2project, and I did not issue live requests against a gateway branch while preparing this PR. The product statements on the page (the beta and region constraints, the credential scope and branch-lineage behaviour, the Responses-only Codex IDs, the array content-block shape, andpricing: null) come from Neon's published documentation and the documentedGET /v1/modelsresponse shape, not from a fresh live run. The snippets are syntax-checked, not executed end to end.One thing to flag for a maintainer. The closing sentence links
/weave/guides/integrations/openai#track-your-own-ops. The page resolves, but that heading anchor does not exist inopenai.mdx. I kept the sentence verbatim becauseopenrouter.mdxandtogether_ai.mdxboth use the identical sentence and anchor, so changing it here alone would make this page the odd one out. Happy to fix just this page, or all three, whichever you prefer.