Using the API

IDEs and agents

VS Code's chat, OpenCode, and any other tool that speaks the OpenAI API, through Gatekeeper.

How-toFor developers

Every tool that accepts an OpenAI-compatible base URL works the same way: give it http://127.0.0.1:8787/v1 and your key. This page has the two the console provides a file for, and the pattern for everything else. The JSON is the console's; see Connect a client for the badge that says so.

VS Code

VS Code's chat takes custom models through its Custom Endpoint provider. In the chat model picker open the gear icon, then Add Models, then Custom Endpoint, and paste this into the chatLanguageModels.json it opens.

jsonfrom the console
[  {    "name": "Confidential Router",    "vendor": "customendpoint",    "apiKey": "sk-tee-v1-…",    "models": [      {        "id": "<model-id>",        "name": "<model-id>",        "url": "http://127.0.0.1:8787/v1/chat/completions",        "toolCalling": true,        "vision": false      }    ]  }]

url is the full chat-completions address, not a base URL; that is how the provider is specified. Keep the key out of the file with "apiKey": "${input:routerKey}" and VS Code asks for it once.

OpenCode

OpenCode takes a provider block in opencode.json. Save it in your project, or in ~/.config/opencode/ for every project. @ai-sdk/openai-compatible is its adapter for any /v1/chat/completions server, which Gatekeeper is.

jsonfrom the console
{  "$schema": "https://opencode.ai/config.json",  "provider": {    "confidential-router": {      "npm": "@ai-sdk/openai-compatible",      "name": "Confidential Router",      "options": {        "baseURL": "http://127.0.0.1:8787/v1",        "apiKey": "sk-tee-v1-…"      },      "models": {        "<model-id>": {          "name": "<model-id>"        }      }    }  }}

"{env:ROUTER_KEY}" in place of the key reads it from the environment instead. Then pick the model in OpenCode. From a shell, with the model id prefixed by the provider name:

sh
opencode run "Explain what this repository does" -m confidential-router/<model-id>

Any other OpenAI-compatible tool

Three settings, whatever they are called in the tool:

  1. Base URL: http://127.0.0.1:8787/v1.
  2. API key: your sk-tee-v1- key.
  3. Model: an id from the console's Models screen.

A tool that insists on an https:// URL can be pointed at the router directly, https://api.router.superprotocol.com/v1, at the cost of the verification Gatekeeper does for you.

While an agent works, the Gatekeeper dashboard counts its requests per endpoint, and the console's Logs shows one metered row per generation: tokens and cost, never the prompt.