TemprTempr
Docs
Guides

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.

  1. Create a virtual key

    In the Portal, create a Gateway virtual key. Keys are prefixed tvk_ and shown once at creation.

  2. Add a provider key

    Gateway is BYOK: add a key for at least one provider from the supported list.

  3. Add a custom provider

    Open Kilo Code's settings (gear icon) → Providers tab → Custom provider. Set Base URL to https://api.temprhq.io/v1 and paste your virtual key as the API key (no Bearer prefix; Kilo Code adds that automatically).

  4. Pick a model

    Kilo Code fetches the available model list automatically from GET /v1/models; choose one from your allowlist. If the only model is tempr/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.

  1. Open the indexing settings

    Go to Settings → Indexing, or click the indexing indicator at the bottom of the prompt input.

  2. 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.

  3. 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-001 or mistral/codestral-embed, and, if Kilo asks, its dimension from the embeddings models table (1536 for text-embedding-3-small). The model has to be on your virtual key's allowlist.

  4. 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-key under Headers, with your virtual key as the value. In kilo.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:

  1. 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.

  2. Send the key from an environment variable

    Put the key in TEMPR_MANAGEMENT_KEY and send it as a bearer token. The key stays out of the file, so it can go in a project's kilo.jsonc for 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