OPIP v1 defines octopus://provider/import?v=1&...: supports zero-code flat query templates for New API, one-key multi-protocol fan-out (Anthropic, OpenAI Responses, OpenAI Chat, Gemini), and Base64Url/GZip JSON payloads with mandatory confirmation and OS keychain storage.
Interactive Builder & Live 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-apiURI Endpoint & Versioning
octopus://provider/import?v=1&<parameters>- Scheme / Host / Path:
octopus://(case-insensitive, trailing slash ignored).provider /import - Version:
v=1(aliasversion), defaults to1. Unsupported higher major versions are rejected cleanly. - Paste Fallback: Users can also paste any octopus://provider/import?... link or raw OPIP v1 JSON directly in Octopus Desktop under Settings → Model Providers → Import Link.
Mode A: Flat Query Parameters
Designed for systems like New API and One-API that perform plain placeholder substitution ({address}, {key}). Tolerates unencoded URLs and preserves '+' signs in API keys.
octopus://provider/import?v=1&baseUrl=https%3A%2F%2Fapi.example.com&apiKey=sk-xxxx&name=MyRelay&protocol=anthropicoctopus://provider/import?v=1&baseUrl=https://api.example.com&apiKey=sk-xxxx&name=MyRelay&protocol=anthropic,openaiResponses&source=new-api| Parameter | Aliases | Req. | Description |
|---|---|---|---|
baseUrl | endpoint, url, host, apiHost | Required | Upstream gateway URL (https:// or http://); optional only for geminiOfficialKey. |
apiKey | key, token | Optional | Provider secret key; omit to let users fill it locally (ideal for team sharing). |
name | title, provider | Optional | Display name; defaults to the baseUrl hostname. |
protocol | protocols, apiFormat, type | Optional | Single protocol, comma-separated list, all, or auto (default multi-protocol fan-out). |
models | model | Optional | Comma-separated model IDs (e.g. claude-sonnet-4-6,gpt-5.4). |
opus | flagshipModel / balancedModel / fastModel | Optional | Anthropic tier slot overrides mapped to Claude Code default slot env vars. |
authEnv | authType | Optional | ANTHROPIC_AUTH_TOKEN (default) / ANTHROPIC_API_KEY |
preset | template | Optional | Built-in preset ID (e.g. deepseek-anthropic, openrouter) to merge default models. |
pin | pinAgents | Optional | Suggested agent IDs to pin in the workspace '+' menu (e.g. claude,codex). |
externalId | id | Optional | Stable third-party identifier to match existing providers on key rotation. |
source | from | Optional | Source platform tag (e.g. new-api) displayed in the confirmation dialog. |
Protocol Values & One-Key Fan-Out
| Canonical | Aliases | Primary Agents |
|---|---|---|
anthropic | claude, anthropic-messages | Claude Code, OpenCode, Aider, Goose |
openaiResponses | openai-responses, responses, codex | Codex CLI, OpenCode |
openaiChat | openai-chat, openai, chat | OpenCode, Codex (Chat), Qwen, Aider, Goose |
gemini | gemini-native, google | Gemini CLI, OpenCode |
geminiOfficialKey | gemini-official, aistudio | Gemini CLI, Antigravity CLI (agy) |
Why omit protocol or use auto for relays?
Automatic BaseUrl Normalization
Relays only need to supply the root {address} once. During multi-protocol fan-out, Octopus adjusts /v1 suffixes per SDK convention while keeping every URL editable in the modal:
| Input baseUrl | Anthropic | OpenAI Responses / Chat | Gemini |
|---|---|---|---|
https:// | https:// | https:// | https:// |
https:// | https:// | https:// | https:// |
https:// | https:// | https:// | https:// |
Mode B: Base64Url / GZip JSON Payload
Use ?v=1&data=<base64url> when passing rich model specs (tier, efforts, contextWindow), custom headers, or multi-provider bundles. Octopus auto-detects GZip magic bytes (0x1F 0x8B) and also accepts plain Base64Url UTF-8 JSON and ?cherry={cherryConfig}.
{
"version": 1,
"source": "new-api",
"homepage": "https://relay.example.com",
"providers": [
{
"externalId": "newapi:relay.example.com:anthropic",
"name": "MyRelay (Claude)",
"protocol": "anthropic",
"baseUrl": "https://relay.example.com",
"apiKey": "sk-xxxxxxxx",
"authEnv": "ANTHROPIC_AUTH_TOKEN",
"headers": {
"X-Workspace": "team-a"
},
"isolateConfigDir": true,
"allowRemoteTunnel": true,
"enableAutoModeServer": false,
"models": [
{
"id": "claude-sonnet-4-6",
"displayName": "Claude Sonnet 4.6",
"enabled": true,
"tier": "balanced",
"efforts": ["low", "medium", "high"],
"contextWindow": 200000
}
],
"pinAgents": ["claude"]
}
]
}export function buildOctopusImportUrl(payload: Record<string, unknown>): string {
const bytes = new TextEncoder().encode(JSON.stringify(payload));
let binary = "";
for (const b of bytes) binary += String.fromCharCode(b);
const base64Url = btoa(binary)
.replace(/\+/g, "-")
.replace(/\//g, "_")
.replace(/=+$/, "");
return `octopus://provider/import?v=1&data=${base64Url}`;
}Security Contract & Hard Limits
Client-Enforced Security Invariants
- Never silently writes, never silently overwrites existing providers, never alters default agent bindings.
- Always highlights the verified target hostname and HTTPS/HTTP status; non-loopback plaintext HTTP displays a danger alert.
- No automatic outbound HTTP requests when the modal opens (prevents SSRF); network calls happen only on explicit user click.
- Startup logs and IPC forwarding redact all octopus:// queries and fragments; secrets are stored only in the OS keychain.
- Hard caps: URI ≤ 32 KiB · Decompressed JSON ≤ 64 KiB · Providers ≤ 10 · Models/provider ≤ 200 · Headers ≤ 16.
Frequently Asked Questions
- Can an octopus://provider/import link silently overwrite my existing providers?
- No. Octopus never writes or overwrites providers silently. Even when an externalId, BaseUrl, or name matches an existing provider, the dialog defaults to creating a new entry; replacing an existing provider requires explicit user opt-in, and built-in CoWork providers cannot be modified.
- Are API keys from deep links ever written to providers.json or startup logs?
- No. DeepLinkRedactor strips every octopus:// query and fragment from startup logs, crash breadcrumbs, and IPC logs before touching disk. After confirmation, API keys are stored solely in the OS keychain and never written to providers.json.
- What happens if a user clicks the import button before installing Octopus?
- Use the zero-leak bridge https://octoterm.si/import/provider#v=1&baseUrl={address}&apiKey={key}. Because parameters stay in the URL #fragment, they never hit octoterm.si servers while giving new users a smooth download and copy-link fallback.