Kilo Code
Last updated
Kilo Code's custom provider setting lets you supply any OpenAI-compatible base URL. Point it at Tempr Gateway and one provider entry gives you every model on your allowlist (Claude, GPT, Gemini, whatever you've configured) instead of switching providers per model.
-
Create a virtual key
In the Portal, create a Gateway virtual key. Keys are prefixed
tvk_and shown once at creation. -
Add a provider key
Gateway is BYOK: add a key for at least one provider from the supported list.
-
Add a custom provider
Open Kilo Code's settings (gear icon) → Providers tab → Custom provider. Set Base URL to
https://api.temprhq.io/v1and paste your virtual key as the API key (noBearerprefix; Kilo Code adds that automatically). -
Pick a model
Kilo Code fetches the available model list automatically from
GET /v1/models; choose one from your allowlist. If the only model istempr/add-a-provider-key, there's no provider key yet: the list shows only the providers you've added keys for in the Portal, so add one there and refresh the list. The list holds chat models only; embedding models, for indexing below, are entered by id.
Codebase indexing
Kilo Code's codebase indexing embeds your code so it can search it by meaning. It can embed through Tempr too, with the same virtual key, so it needs no separate embedding provider account.
-
Open the indexing settings
Go to Settings → Indexing, or click the indexing indicator at the bottom of the prompt input.
-
Point the embedder at Tempr
Choose the OpenAI-Compatible embedding provider, set the base URL to
https://api.temprhq.io/v1, and paste your virtual key as the API key. -
Choose an embedding model
Enter an embedding model from a provider you have a key for, such as
openai/text-embedding-3-small,google/gemini-embedding-001ormistral/codestral-embed, and, if Kilo asks, its dimension from the embeddings models table (1536 fortext-embedding-3-small). The model has to be on your virtual key's allowlist. -
Pick a vector store and start
Keep the default LanceDB store, which needs no server, or connect Qdrant, then start indexing.
Each batch Kilo sends is one Gateway request, billed at the model's input price with your own provider key, and appears in your request logs. Changing the embedding model or its dimension means re-indexing.
On a coding plan
To run Kilo Code on a coding plan, such as the Z.AI GLM Coding Plan or Kimi Code, use one of the plan's models, named by the plan: zai-coding/glm-5.3. Tempr can get the plan's key two ways:
- Stored in Tempr. Add the plan's key under Provider keys in the Portal, and keep Kilo Code's settings as they are, with your virtual key.
- Sent with each request. In your custom provider, put the plan's key in API key and add
x-tempr-keyunder Headers, with your virtual key as the value. Inkilo.jsonc: Tempr sends the plan's key only to that plan, and never stores it. An organization's keys take a key sent this way once an owner or admin turns on Plan logins.
{
"provider": {
"tempr": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://api.temprhq.io/v1",
"apiKey": "<the plan's key>",
"headers": { "x-tempr-key": "tvk_..." }
},
"models": { "zai-coding/glm-5.3": { "name": "GLM 5.3" } }
}
},
"model": "tempr/zai-coding/glm-5.3"
}
Several plans are sold only for the coding tools they support, and some refuse other tools, telling them apart by the identity each tool sends. Tempr passes Kilo Code's own along and never sends another, so check which tools each plan supports before you subscribe.
Ask Kilo Code about your Gateway
Kilo Code can also read your Gateway through the Gateway's own MCP server: usage and cost, request logs and one request's routing, keys, plan, and providers cooling down. Ask it "why did my last few requests fail?" or "which key spent the most this week?" while you work. It comes with the Gateway Pro, Scale and Enterprise plans.
The quickest way is to sign in. Add the server to kilo.jsonc; when Kilo Code connects, it opens Tempr's sign-in in the browser (from the terminal, kilo mcp auth tempr-gateway):
{
"mcp": {
"tempr-gateway": {
"type": "remote",
"url": "https://api.temprhq.io/mcp/admin"
}
}
}
Signed in this way, Kilo Code reads your own Gateway, or your organization's if you're an owner or admin. To let it make changes too, tick Also let it make changes on Tempr's consent page.
To give it a management key instead:
-
Create a management key
In the Portal, under Gateway → Keys → Management keys (or Organization → Org keys for an organization's Gateway). A management key reads and manages the Gateway but can't call models, so it's separate from the
tvk_virtual key Kilo Code uses for its model. Tick what Kilo Code may do: Read usage, Read request logs and List keys to read; Create, change and revoke keys as well if it may change keys. -
Send the key from an environment variable
Put the key in
TEMPR_MANAGEMENT_KEYand send it as a bearer token. The key stays out of the file, so it can go in a project'skilo.jsoncfor your team, each person with their own key:
"tempr-gateway": {
"type": "remote",
"url": "https://api.temprhq.io/mcp/admin",
"headers": { "Authorization": "Bearer {env:TEMPR_MANAGEMENT_KEY}" }
}
- The key's permissions decide the tools. Without Read request logs, Kilo Code gets the usage, plan and key tools but not the logs.
- Changes also need the account to allow them: turn on Changes by AI agents on the Portal's MCP connectors page. Kilo Code can then make changes that only tighten, such as creating a key that expires within 90 days or revoking one, and propose any that would loosen, such as a higher budget, for you to approve in the Portal; its permission settings decide whether it asks you first. A new key's secret never reaches it: it gets a one-time Portal link for you to copy the key from.
What's next
- The Gateway's MCP server: every tool, what it returns, and how text from your apps is marked.
- Authentication & virtual keys: scoping keys with model allowlists, budgets, and rate limits.
- Embeddings: the providers, models and dimensions codebase indexing can use.
- Models, limits & logs: how
GET /v1/modelspopulates the list Kilo Code fetches.