Skip to main content
Beta Request a Router API key through the Contact Us form before configuration. See the Router overview for the quickstart, Models for key-specific model discovery, and API capabilities for tool calling and structured output. Set your API key before you start a coding tool:
Router is not confidential. Do not send sensitive data. During the beta, Router supports Chat Completions only. A tool that requires the Responses API cannot connect yet.

Choose the correct path

The Router key is separate from the Confidential API key. Do not substitute PREM_API_KEY for PREM_ROUTER_API_KEY or reuse Confidential Proxy KEK settings with Router.

Add Router as a custom provider

In your tool, choose Add provider, then select Custom, OpenAI-compatible, or OpenAI Chat Completions. Enter these values: Before you configure a model, call authenticated GET /v1/models with the same API key. See Models for the command. When the field is named Base URL or API base, do not append /chat/completions. The final request URL should contain /v1 exactly once. Enter kimi-k3 without a provider prefix; prem/kimi-k3 is only the OpenCode model selector. Select Chat Completions rather than the Responses API. No custom headers are required when the tool has a dedicated API key field. If it only accepts custom headers, add Authorization: Bearer <your-api-key>. Do not enter the literal text $PREM_ROUTER_API_KEY in a GUI unless that tool documents environment-variable expansion.
Streaming requirements can differ by API key. If a model returned by GET /v1/models includes "streaming_required": true, enable streaming or leave it on automatic. OpenCode and Pi support streamed model responses.
Test the custom provider outside your tool with the same connection settings:
A successful response includes "model":"kimi-k3" and an assistant message.

OpenCode

Create opencode.json in your project root:
Start OpenCode:
OpenCode uses prem/kimi-k3 as its default provider and model selector. To switch models, use prem/<model-id> with an exact ID returned by GET /v1/models for the same API key. If the response contains either additional model, you can add the matching entries to the models object:
Add only the entries returned for the active key.

OpenClaw

Add a separate Router provider to ~/.openclaw/openclaw.json. Keep the confidential provider under a different name if you use both:
The example uses kimi-k3. Confirm that the model appears in GET /v1/models for the active key. If you select another returned model, update both the model id and agents.defaults.model.primary. Set contextWindow from that model’s returned context_length. Run openclaw config validate before starting an agent. Router does not provide enclave confidentiality for the model request, and OpenClaw’s local tools remain outside the confidential runtime.

Hermes Agent

Add a named Router provider to ~/.hermes/config.yaml:
The example uses kimi-k3. Confirm that the model appears in GET /v1/models for the active key. If you select another returned model, update default_model, both model IDs, and both context-length values. Run hermes config check, then use hermes --oneshot "Reply with exactly: router ok" for the first request.

Goose

Set Goose’s built-in OpenAI provider to the Router endpoint:
The example uses kimi-k3. Confirm that the model appears in GET /v1/models for the active key. Otherwise, set GOOSE_MODEL to an exact returned model ID. Run a bounded request:

Pi

Add this provider to ~/.pi/agent/models.json:
Start Pi with Router:
Run a non-interactive test:
Replace kimi-k3 only with an exact ID returned by GET /v1/models for the same API key. If the response contains either additional model, you can add the matching entries to the models array:
Add only the entries returned for the active key. supportsStrictMode controls Pi function-tool metadata. It does not disable JSON Schema response formatting.