magpie
magpie
magpie is a desktop app that lets coding agents such as Claude Code, Codex, OpenCode and Gemini CLI share one provider. After you import your 上上之钥 key, each tool talks to the API it speaks natively: Claude Code uses Anthropic Messages, Codex uses OpenAI Responses, and other tools use Chat Completions. magpie reads the available models during import.
The fastest way: on the API Keys page of the console, click Import to magpie next to your key. All endpoints and the key are filled in for you.
Step 1: Install magpie
Download magpie for your OS (macOS, Windows or Linux) from the magpie website. You need version 0.1.8 or later; Install it: macOS: drag magpie into the Applications folder; Windows: run the installer; Linux: follow the package instructions; a desktop entry is created; Open magpie at least once.
magpie registers the magpie:// link handler on first launch. Until then, one-click import does nothing or reports "magpie is not installed or is outdated".
Step 2: Import your key
Sign in to the console and open API Keys. If you don't have a key yet, click Create API Key first; Click Import to magpie next to the key (or click Use Key and then Import to magpie in the dialog); Pick the tool you want to use from the list (Claude Code, Codex, Gemini CLI, OpenCode, Pi, Hermes Agent, Grok Build and more); When the browser asks whether to open magpie, click Allow / Open; magpie shows a confirmation dialog with the provider name, the hosts your key will be sent to, and the model list. Check that the address is this site (https://upupkey.com) and click Add.
The page then shows the next step: on magpie's Agents page, set the model for the tool you picked, using the model name it gives you (for example zerotoken/claude-sonnet-5-5). magpie only needs one import; other tools can pick the same provider on the Agents page.
The key in the import link is only handed to magpie on your computer; it never passes through magpie's servers.
Depending on the key's group, magpie receives these endpoints:
Importing the same provider again turns the button into Replace and overwrites the old settings. After changing your key or group, just import again.
Step 3: Use it in your coding tools
In magpie, select the imported 上上之钥 provider and a model for Claude Code, Codex and so on, then start the tool as usual:
Tools that take a provider/model value use provider-id/model-name. The provider ID is the name in lowercase with spaces and symbols replaced by dashes; for example ZeroToken becomes zerotoken. You can check it in the provider details in magpie.
Run Codex on a Claude group
Keys from a Claude group also work in Codex: magpie sends Codex requests straight to this site's /v1/responses. Just pick a Claude model such as claude-sonnet-5-5.
If you imported the provider before this was supported, Codex may still fail with Claude models. Delete the provider in magpie and import it again from the console.
Add it manually
Create a new provider in magpie with these values:
magpie only accepts https addresses. A wrong URL (for example adding /v1 to the Anthropic URL) leads to 404 errors on /v1/v1/....