# Use your Kimi plan

Computers made from the current image have Kimi Code preinstalled, as Moonshot publishes it. You sign in to it yourself, in the computer's terminal, with your own Kimi membership or Kimi Code API key. Moonshot bills your Kimi Code usage to you.

## What is preinstalled

Kimi Code is installed in the `ubuntu-26.04` image at a version we pin and check against the npm registry's signature over Moonshot's published package before the image is used. Nothing of ours is changed in it, and every way of signing in it offers stays there. We write no settings of ours for it. The **Bring your own agent** page shows the version in the image.

Computers made before Kimi Code was added have none. Make a new computer to use it.

## Sign in

1. Open a computer and its terminal.
2. Run `kimi login`. It prints a sign in link and a one time code. Open the link in your own browser, sign in to Kimi, and enter the code there.
3. Work in `/workspace`. Kimi Code reads `AGENTS.md` there.

Nothing is pasted back into the terminal: Kimi Code, waiting inside your computer, finishes the sign in once Kimi's page takes the code.

In a chat, the **Your Kimi plan** card has a button, **Sign in to your Kimi plan in the terminal**, that opens the computer's terminal and types `kimi login` there for you. The card says Kimi Code is open only once the terminal took the command. From then on the sign in is Kimi Code's own.

Where your workspace has it on, the card also repeats the link and the code Kimi Code printed, so you can tap the link and copy the code on a phone. The card reads them from the terminal in your browser tab only. It offers a link only to Kimi's own sign in page, `https://www.kimi.com/code/authorize_device` or `https://www.kimi.ai/code/authorize_device`, and it shows only the first code Kimi Code printed: if something else in the computer prints another code later, the card says so and never shows it. It never sends the link or the code to our API, stores them or keeps them after it closes.

Using a Kimi Code API key instead? Run `kimi`, then `/login`, and pick the API key option. Kimi Code keeps the key in its `config.toml` under `/root/.kimi-code`, in memory in this computer, like a sign in.

**Save it for new computers.** Sign in once in **Settings > Your subscriptions** and every new computer you make starts with Kimi Code signed in. See [Your subscriptions](https://docs.foxdeploy.ai/your-plans.md).

## Where your sign in lives

Kimi Code keeps your sign in inside the computer, under `/root/.kimi-code` (a Kimi sign in in `credentials`, an API key in `config.toml`). The folder `/root/.kimi-code` is held in memory only, never on the computer's disk. foxdeploy never reads it:

- the Files tab, the files API, the MCP file tools, uploads and the zip download keep the whole of `/root/.kimi-code` private: it is never listed, read, written or zipped; a zip says how many private files were left out
- sign in tokens (the values of `access_token` and `refresh_token`) are masked in command output, logs, traces and chats that pass through us
- the terminal is a relay: nothing you type or see there is recorded

If you set `KIMI_CODE_HOME` to a folder of your own, that whole folder is kept private on the files routes and is removed from a new computer made from a snapshot, but it is on the computer's disk, so the snapshot itself carries it. Keep the default, which is memory only.

The masks are a second line only. A token that a program prints in another form, cut in pieces, encoded or bare, passes any mask; the private folder and this guide are what keep it in.

Your own shell is not restricted. It is your computer: your own commands can read your own file.

Kimi Code can be steered by what it reads. A web page, a file or a command's output can hold instructions that get it to send anything in the computer, your sign in included, out of the computer. Use it only on work and content you trust, and set an allow list in the computer's **Network** settings to limit where it can send anything (the hosts it needs are listed below). `/logout` in Kimi Code ends the sign in in the computer.

## Snapshots and clones

A pause keeps your sign in: the paused computer's memory is kept with the rest of it, and only Resume on the same computer reads it. A stop and start signs you out, because the sign in folder lives in memory only. Run `/logout` in Kimi Code, or remove `/root/.kimi-code/credentials`, before you pause if you want none of it kept.

**New computer from a snapshot** starts from the disk only and signed out of Kimi Code: the sign in folder is emptied before the new computer is handed to you. If it cannot be emptied, no computer is made and you are told so.

## Billing and limits

Moonshot bills your Kimi Code usage to you, under your own membership or key. foxdeploy bills the computer time and storage, as for any computer. Your membership's limits are Moonshot's. A cloud computer does not change them. foxdeploy never shows Kimi's usage, limits or quota; `/usage` in Kimi Code shows yours.

## The network

Kimi Code talks to Moonshot straight from your computer. With egress off, Kimi Code cannot work. If you set an allow list, add these hosts:

`auth.kimi.com`, `auth.kimi.ai`, `api.kimi.com`, `api.kimi.ai`, `code.kimi.com`, `code.kimi.ai`, `cdn.kimi.com`, `telemetry-logs.kimi.com`, `telemetry-logs.kimi.ai`

## The chat with Kimi Code

Where your workspace has it on, a chat can run Kimi Code in its computer: open **Use your subscription** at the end of the model menu and choose **Kimi Code**, or pick it in **Chat settings**. Until it is on, the list shows Kimi Code as **Coming soon**. Its status is what Kimi Code said in this chat: **Signed in** once a Kimi Code turn here answered, **Not signed in** before that or after Kimi Code said it is not signed in, and **Needs a computer** when the chat has none. foxdeploy runs nothing in your computer to find out. Until Kimi Code has answered here, its button is **Sign in to Kimi**, which opens the **Your Kimi plan** card; then **Use Kimi Code** puts the chat on it. Each message runs Kimi Code in `/workspace` on your own membership, and the next message goes on in the same Kimi Code session. Replies show under the header **Kimi Code**, and no foxdeploy allowance is used.

Kimi Code in a chat works without asking: it changes files and runs commands in this computer without stopping for you, whatever approval mode the chat had. Take a snapshot first if you want a way back. The chat shows what Kimi Code did by name only (it ran a command, it changed files), never the command, the change or its output.

Your message is given to Kimi Code as one argument, so it shows in the computer's own process list while the turn runs, and a message over 100,000 bytes is refused: put long text in a file in `/workspace` instead. When Kimi Code is not signed in, the chat says so and offers the terminal. When the computer restarted and the earlier session is gone, the chat says so and Kimi Code starts a new one. When the session is open in the terminal too, the chat asks you to close it there first.

## Team workspaces

Everyone in a workspace who can open a computer can use Kimi Code with the sign in inside it. Sign in only in a computer that is yours, or run `/logout` in Kimi Code when you are done. The chat with Kimi Code and the sign in card are off in team workspaces, because a Kimi membership is personal. The computer's Logs show who opened a terminal.

## Kimi's terms

Kimi Code is Moonshot's product and is governed by Kimi's terms: [Kimi Code documentation](https://www.kimi.com/code/docs/en/).

Source: https://docs.foxdeploy.ai/kimi-plan/
