Guidelines & tips

Connect your stack the Nexus way

Short checklist for wiring Codex, IDEs, and SDKs to API Nexus — plus tips that prevent the usual setup foot-guns.

Setup checklist

Fund your wallet

Nexus meters every proxy call against your balance. Top up from the dashboard before you generate keys or hit production traffic.

Create an nx_live_ key

Open Connect or API Keys, create a key, and copy the secret immediately — Nexus only shows the full value once. Prefixes alone are not enough for clients.

Run the Connect one-liner

Paste the macOS/Linux or PowerShell command from Dashboard → Connect. It writes ~/.codex/config.toml and sets OPENAI_BASE_URL to this host’s /api/v1.

Wire Cursor (Settings → Models)

In Cursor: Cmd/Ctrl+Shift+J → Models → paste nx_live_ into OpenAI API Key → enable Override OpenAI Base URL → set …/api/v1 → Add model IDs from Dashboard → Models. Open the Cursor tab on Connect for the full checklist.

Tips that save time

Verify before you ship

Use Verify key on the Connect page, or send a tiny chat completion. A 401 means the secret is wrong or revoked; 402 means top up the wallet.

Keep secrets off the frontend

nx_live_ keys belong in server env files and local tooling only. Never embed them in public websites or mobile apps.

Match the host you open

While developing, Connect shows localhost. After you deploy, open Connect on your domain so install commands bake https://your-domain into Codex — not localhost.

Pick models from the catalog

Use Dashboard → Models for live IDs and pricing. Snippets default to gpt-4o; swap the model field to whatever your account routes.

Watch Requests after first calls

Dashboard → Requests lists tokens, cost, and status so you can confirm metering before you scale traffic.

One-liner troubleshooting

Windows: use iex (irm …) exactly as shown. If PowerShell blocks scripts, run with ExecutionPolicy Bypass for that session. Unix: ensure curl and sh are available.

Common mistakes

  • Using only the key prefix (nx_live_abcd…) instead of the full secret
  • Leaving base URL as api.openai.com instead of your Nexus /api/v1
  • In Cursor: forgetting Override OpenAI Base URL, or appending /chat/completions to the base
  • In Cursor: using Cursor built-in model names that Nexus does not list — add exact IDs from Models
  • Running Connect on localhost after go-live, then wondering why Codex still hits 127.0.0.1
  • Calling the API with a zero wallet balance
  • Putting the key in client-side JavaScript
Back to ConnectAPI reference & errorsDeveloper quickstart
Connect guidelines & tips · API Nexus