New API and One-API admins need zero code changes: add one octopus://provider/import?v=1&baseUrl={address}&apiKey={key}&source=new-api line in Settings → Chats so users click once to configure Claude Code, Codex CLI, OpenCode, and Gemini CLI.
Zero-Code Admin Templates
Open New API Settings → Chats and append any of the templates below into your chat shortcut array:
[
{
"Octopus": "octopus://provider/import?v=1&baseUrl={address}&apiKey={key}&source=new-api"
}
]End-User Flow
- Browser Click
User clicks Octopus on the Token row; the browser invokes the OS octopus:// handler and focuses Octopus Desktop.
- Host Verification & Protocol Selection
The modal shows the verified hostname, masked API key, and protocol-normalized URLs (e.g. root for Anthropic, /v1 for OpenAI Responses), pre-selecting Anthropic and OpenAI Responses.
- Test & Save
User can optionally Test Connection, then Confirm Import: keys go straight to the OS keychain, /models are synced with Claude tier inference, and quick-launch presets are pinned to '+'.
Direct octopus:// vs Web Bridge
Why is the Web Bridge safe?
https:// octoterm.si /import /provider #v=1 &baseUrl={address} &apiKey={key}. Because parameters live after # (URL fragment), browsers never transmit them to the server, while giving non-installed users a smooth download and copy-link fallback.Custom Frontend Button Integration
If you maintain a custom relay dashboard or internal developer portal, pass the site name and token-scoped models directly:
// Example for New API / custom relay Token table action button
function openInOctopus(systemName: string, serverAddress: string, tokenKey: string, allowedModels?: string[]) {
const params = new URLSearchParams({
v: "1",
name: systemName || "NewAPI",
baseUrl: serverAddress,
apiKey: tokenKey,
protocol: "anthropic,openaiResponses,openaiChat,gemini",
source: "new-api",
});
if (allowedModels && allowedModels.length > 0) {
params.set("models", allowedModels.join(","));
}
window.location.href = `octopus://provider/import?${params.toString()}`;
}Generate New API Template & Test
Interactive OPIP v1 Deep-Link Builder & Tester
Computed 100% locally in your browser — your API key is never sent over the network.
protocoloctopus://provider/import?v=1&name=MyRelay&baseUrl=https%3A%2F%2Fapi.example.com&models=claude-sonnet-4-6%2Cgpt-5.4&source=new-apiFrequently Asked Questions
- Does New API need to URL-encode {address} before calling Octopus?
- No. The OPIP v1 parser handles raw unencoded https:// URLs safely, preserves '+' characters inside API keys, and automatically appends or strips /v1 per protocol.
- Should I configure one auto button or separate buttons per protocol?
- One auto button is recommended for multi-model relays: users click once and pick Anthropic (Claude Code), OpenAI Responses (Codex), OpenAI Chat, and Gemini in a single confirmation modal sharing the same API key.