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

Add Prem Router as a custom provider

In your tool, choose Add provider, then select Custom, OpenAI-compatible, or OpenAI Chat Completions. Enter these values: 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.
qwen-3.7-max, qwen-3.7-plus, and qwen-3.6-plus require streaming. Enable streaming or leave it on automatic when using these models. 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, replace it with prem/<model-id> using an ID from the available models table.

Pi

Add this provider to ~/.pi/agent/models.json:
Start Pi with Prem Router:
Run a non-interactive test:
Replace kimi-k3 with any ID from the available models table. supportsStrictMode controls Pi function-tool metadata. It does not disable JSON Schema response formatting.

Codex

Codex is not supported in the current Prem Router beta. Current Codex releases require the Responses API.

Other custom-provider tools

Follow Add Prem Router as a custom provider and use the same base URL, API key, and model ID. You can use the same settings with Cline, Roo Code, and Continue if they support a custom Chat Completions endpoint.