Skip to main content

Run Box’s built-in agents on Neon AI Gateway models. One Neon credential covers Claude, GPT, Gemini, and open-weight models, and usage draws down your Neon prepaid credits.


1. Get a Neon credential#

You need a Neon project in an AI Gateway region (aws-us-east-2, aws-us-east-1, aws-eu-central-1, or aws-ap-southeast-1) on a paid plan with prepaid credits.

This writes your branch’s gateway token and URL to .env:

Or open Connect → AI Gateway in the Neon Console and copy the snippet. Add your Box API key next to them:

.env

2. Save it in Upstash Box#

In the Upstash Console, open Box → Settings → Agent API Keys. Under Neon AI Gateway, paste the token and the branch gateway URL, then click Add key.

Note

A Neon credential is a token plus a branch URL, so Box only accepts it as a stored key. Boxes on Neon models use BoxApiKey.StoredKey; passing the token as apiKey is rejected.


3. Create a box#

Pick a neon/ model and a harness that can run it:

Each harness reaches Neon through a different API, so not every model runs on every harness:

ModelsHarness
Claude (neon/claude-*)Claude Code or OpenCode
GPT-5.4 and newer, GPT-5.5 Pro, GPT-5.3 CodexCodex
GPT-5 Mini, GPT-5 Nano, Grok 4.6Codex or OpenCode
Gemini, gpt-oss, and other open-weight modelsOpenCode

Box rejects a model the harness can’t run. NeonModel lists the catalog; any other model id your branch serves works as neon/<id>. Claude Code on Neon runs without the WebSearch tool, which Neon doesn’t serve.


Use Neon in a custom agent#

If you run your own custom agent, call Neon directly and let Attach Headers add the token, so it never enters the box:

box.ts

The agent sends no Authorization header; the proxy adds it on the way out:

neon-agent.mjs

The model is a plain Neon id here, without the neon/ prefix.


List models#

See what your branch serves:


Next steps#