Docs · Guide

NVIDIA NIM in Claude Code, Codex and other agents

NVIDIA hosts NIM endpoints at build.nvidia.com: one nvapi- key reaches the many models it hosts. magpie's nvidia preset brings it to Claude Code, Codex, OpenCode and other agents.

Add it

  1. Get a key.Sign in at build.nvidia.com and make one under Settings → API Keys.
  2. Add it.Pick NVIDIA NIM in the app and paste the key into API key, or from the CLI:
Terminal
magpie provider add nvidia nvapi-…
magpie provider test nvidia

The preset sets Chat Completions alone, at https://integrate.api.nvidia.com/v1: NIM's /v1/responses answers for a few models and 404 for the rest, so magpie doesn't use it.

Use it in an agent

Model ids are nvidia/<NIM's model id>, from NIM's own list:

Terminal
magpie claude nvidia/
magpie codex nvidia/

Claude Code speaks Anthropic's API and Codex speaks Responses; magpie translates both to Chat Completions for NIM and the answers back to what the agent reads.

Free models

A model NIM prices at 0 is marked free beside it in agents' model pickers. The price is NIM's alone: the same model on another provider costs what it costs there, and NIM's $0 isn't taken as the maker's price.

Many keys

Importing from an app that keeps an entry per key, as CC Switch does, often brings hundreds of entries, "NVIDIA #001" to "NVIDIA #600". magpie folds entries alike in all but their key into one provider, each key an account of it; otherwise every model showed hundreds of times in every agent's picker. Each entry's old name becomes its key's name, and one that was off stays off.

Notes

Free models in Claude Code, Codex and other agents

FAQ

Does magpie support NVIDIA NIM?

Yes, with the nvidia preset. Give a build.nvidia.com API key; magpie asks Chat Completions at integrate.api.nvidia.com/v1, and a model id is nvidia/.

Can Claude Code and Codex use NIM's models?

Yes. NIM is asked on Chat Completions alone, and magpie translates Claude Code's Anthropic requests and Codex's Responses requests to Chat and the answers back.

How do I tell which models are free?

A model NIM prices at 0 is marked free beside it in agents' model pickers. That is NIM's price only; the same model costs what it costs on other providers.

I imported hundreds of NVIDIA entries. What now?

magpie folds entries alike in all but their key into one provider, each key an account of it, so models aren't repeated in the pickers.

Related: ModelScope in Claude Code and Codex, Round robin and failover across accounts, keys and providers. If something fails, see Fixing common errors: 401, 429, 502, 504 and more or ask on Discord.