For relay operators
A relay provider can put an “Add to AI Switch” button in its own console that points at the scheme URL below. Clicking it launches AI Switch, which shows a confirmation dialog and then creates an API account directly — no copying base URLs and keys by hand.
aiswitch://scheme, fixedv1protocol version, only v1/importpath, fixed?resource=providerresource, only provider&app=…target platform&name=…account display name&endpoint=…base URL&apiKey=…API keyThe scheme, version segment, and path are fixed values; getting any of them wrong means the link is rejected outright. Every parameter value must be percent-encoded.
resourceRequiredOnly provider is accepted. Anything else returns an unsupported-resource error.appRequiredTarget platform — see the table below. opencode / openclaw / hermes are valid platform names but do not support deep-link import, so the capability check rejects them.nameRequiredDisplay name in the account list. Trimmed, and must not be empty after trimming. Use your site name so users can identify it.endpointRequiredThe relay's API base URL; must be http or https. You may pass a comma-separated list of candidates — the first one that parses as http(s) wins and the rest are ignored.apiKeyRequiredThe API key. Must not be empty after trimming. The dialog shows a mask only (first 4 + *** + last 4), never the key itself.modelOptionalSingle model mapping, for codex / gemini / grok. Use a model ID that actually works on your relay.haikuModel · sonnetModel · opusModelOptionalClaude's three model tiers. You can pass just one or two. These are ignored when app is not claude.homepage · notesOptionalParsed, but the current dialog does not display them and import does not persist them. Passing them is not an error, it simply has no effect.The upstream protocol is not a URL parameter — app determines it, and the link cannot override it. So if your relay is only compatible with a different interface format for a given platform, deep-link import is not usable there and users have to create the account by hand.
codex · openai · chatgptCodexopenai-responsesclaude · anthropic · claude-code · claude-desktopClaude Codeanthropicgemini · google · gemini-cliGemini CLIgeminigrok · xai · x-ai · x.aiGrokopenaiAliases are matched after trimming, lowercasing, and normalizing spaces and hyphens to underscores, so Claude-Code and claude_code are equivalent.
A model parameter carries the real upstream model ID. AI Switch maps the fixed model name the client asks for onto it. Left is the client-side name, right is the value you supply.
app=claude
claude-haiku-alias→haikuModelclaude-sonnet-alias→sonnetModelclaude-opus-alias→opusModelapp=codex / gemini / grok
gpt-5→modelapp=codexgemini-2.5-flash→modelapp=geminigrok-3→modelapp=grokModel parameters are entirely optional — leave them out and the user adds mappings themselves after import. An empty mapping does not affect import.
aiswitch://v1/import?resource=provider&app=claude&name=Example%20Relay&endpoint=https%3A%2F%2Fapi.example.com%2Fv1&apiKey=sk-xxxxxxxx&sonnetModel=claude-sonnet-alias&opusModel=claude-opus-aliasaiswitch://v1/import?resource=provider&app=codex&name=Example%20Relay&endpoint=https%3A%2F%2Fapi.example.com%2Fv1&apiKey=sk-xxxxxxxx&model=gpt-5.6-sol