Skip to content

New API / One-API One-Click Import Guide

Add a single template in New API Settings → Chats so users can click from the Token console to populate gateway URL, API key, and multi-protocol endpoints straight into Octopus.

  • Zero Code
  • New API
  • One-API
  • Veloera / VoAPI
4 min readUpdated
TL;DR

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:

jsonOne click → check Claude / Codex / OpenCode / Gemini
[
  {
    "Octopus": "octopus://provider/import?v=1&baseUrl={address}&apiKey={key}&source=new-api"
  }
]

End-User Flow

  1. Browser Click

    User clicks Octopus on the Token row; the browser invokes the OS octopus:// handler and focuses Octopus Desktop.

  2. 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.

  3. 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?

For public relays serving new users, use 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:

tsToken Console Action Handler
// 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.

Local only
protocol
uriOPIP v1
octopus://provider/import?v=1&name=MyRelay&baseUrl=https%3A%2F%2Fapi.example.com&models=claude-sonnet-4-6%2Cgpt-5.4&source=new-api

Frequently 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.

Octopus WeChat group

Scan with WeChat to join the (Chinese-speaking) community group for tips, feedback and release news.

QR code expired? Let us know in a GitHub issue.