Skip to content

Provider Deep-Link Import Protocol (OPIP v1)

octopus://provider/import is an open protocol enabling web dashboards (New API, One-API, enterprise gateways) to launch local Octopus and prefill managed model providers, endpoints, models, and credentials safely.

  • v=1
  • Query + JSON + GZip
  • Zero Plaintext Logs
  • Multi-Protocol
8 min readUpdated
TL;DR

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.

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

URI Endpoint & Versioning

uriCanonical URI Format
octopus://provider/import?v=1&<parameters>
  • Scheme / Host / Path: octopus://provider/import (case-insensitive, trailing slash ignored).
  • Version: v=1 (alias version), defaults to 1. 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.

uriSingle Protocol Query
octopus://provider/import?v=1&baseUrl=https%3A%2F%2Fapi.example.com&apiKey=sk-xxxx&name=MyRelay&protocol=anthropic
uriMulti-Protocol Query
octopus://provider/import?v=1&baseUrl=https://api.example.com&apiKey=sk-xxxx&name=MyRelay&protocol=anthropic,openaiResponses&source=new-api
ParameterAliasesReq.Description
baseUrlendpoint, url, host, apiHostRequiredUpstream gateway URL (https:// or http://); optional only for geminiOfficialKey.
apiKeykey, tokenOptionalProvider secret key; omit to let users fill it locally (ideal for team sharing).
nametitle, providerOptionalDisplay name; defaults to the baseUrl hostname.
protocolprotocols, apiFormat, typeOptionalSingle protocol, comma-separated list, all, or auto (default multi-protocol fan-out).
modelsmodelOptionalComma-separated model IDs (e.g. claude-sonnet-4-6,gpt-5.4).
opus / sonnet / haikuflagshipModel / balancedModel / fastModelOptionalAnthropic tier slot overrides mapped to Claude Code default slot env vars.
authEnvauthTypeOptionalANTHROPIC_AUTH_TOKEN (default) / ANTHROPIC_API_KEY
presettemplateOptionalBuilt-in preset ID (e.g. deepseek-anthropic, openrouter) to merge default models.
pinpinAgentsOptionalSuggested agent IDs to pin in the workspace '+' menu (e.g. claude,codex).
externalIdidOptionalStable third-party identifier to match existing providers on key rotation.
sourcefromOptionalSource platform tag (e.g. new-api) displayed in the confirmation dialog.

Protocol Values & One-Key Fan-Out

CanonicalAliasesPrimary Agents
anthropicclaude, anthropic-messagesClaude Code, OpenCode, Aider, Goose
openaiResponsesopenai-responses, responses, codexCodex CLI, OpenCode
openaiChatopenai-chat, openai, chatOpenCode, Codex (Chat), Qwen, Aider, Goose
geminigemini-native, googleGemini CLI, OpenCode
geminiOfficialKeygemini-official, aistudioGemini CLI, Antigravity CLI (agy)

Why omit protocol or use auto for relays?

Multi-model gateways like New API expose multiple protocols behind one key. With protocol omitted or set to auto, Octopus shows all 4 endpoints and pre-selects Anthropic (Claude Code) + OpenAI Responses (Codex CLI) in one confirmation modal.

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 baseUrlAnthropicOpenAI Responses / ChatGemini
https://relay.example.comhttps://relay.example.comhttps://relay.example.com/v1https://relay.example.com
https://relay.example.com/v1https://relay.example.comhttps://relay.example.com/v1https://relay.example.com
https://api.deepseek.com/anthropichttps://api.deepseek.com/anthropichttps://api.deepseek.com/anthropichttps://api.deepseek.com/anthropic

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

jsonOPIP v1 JSON Schema
{
  "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"]
    }
  ]
}
tsZero-Dependency Browser Encoder (TypeScript)
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.

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.