---
title: Use a Kimi membership (Kimi Code)
nav: Kimi
summary: Run Agent J on a Moonshot AI Kimi membership (Plus or higher): our first choice in Hong Kong and abroad, fine in mainland China too; paste the key into the phone key card, use OpenCode or Kimi's own Kimi Code; the default Kimi K3 reads screenshots.
order: 41
---
# Use a Kimi membership (Kimi Code)

Kimi is made by Moonshot AI. A Kimi membership at Plus or higher includes coding quota, called Kimi Code, and Agent J can run on it.

Not sure which vendor to pick? Start at [Choose by your model](/docs/models/). Installing and pairing your phone are the same for every vendor: see [Install](/docs/install/) and [Using it on your phone](/docs/phone/).

## Who it is for {#who}

- Hong Kong or abroad, Claude Code and Codex not available: **our first recommendation**. Of the three Chinese plans, Kimi is the only one whose overseas route Agent J supports out of the box.
- Mainland China and already a Kimi member: use it.
- Mainland China and nothing bought yet: we recommend [Volcano Ark](/docs/ark/) first; Kimi works too.

## Sign up and pick a plan {#plan}

1. Open https://www.kimi.com/ . kimi.com is Moonshot's main site and is also used in mainland China; the overseas site is https://www.kimi.ai/ .
2. Subscribe to **Plus or higher**. **Go has no coding quota and cannot be connected.**

The official pages are authoritative for prices: [kimi.com membership pricing](https://www.kimi.com/en/help/membership/membership-pricing), [kimi.ai membership pricing](https://www.kimi.ai/help/membership/membership-pricing). Opened from outside the mainland on 2026-10-16, both pages showed the same prices in US dollars; opened from mainland China, kimi.com shows prices in yuan. Coding usage starts with the Plus plan; the page has the current prices.

When the Agent on your computer runs `agentj agent route`, it also prints a link to subscribe. That is Agent J's official invite link, and a sentence explaining it always follows the link; see [Set up AI command-line tools](/docs/setup-agents/).

## Get the key {#key}

1. Open the Kimi Code console: https://www.kimi.com/code/console for a kimi.com membership, https://www.kimi.ai/code/console for a kimi.ai membership.
2. Create a key. It is shown once. **Do not copy it to anyone yet**: wait for the key card on your phone and paste it there.

With Kimi Code you can also sign in instead of using a key; see [AI coding tools](/docs/kimi/#tools) below.

## Hand the key to Agent J {#hand-over}

Tell the Agent on your computer: connect my Kimi membership. It will:

1. Run the line below. On a computer where Claude Code and Codex are not available, it prints Kimi's key card command and the next steps.

```bash
agentj agent route
```

2. Run that key card command. A key card named `KIMI_API_KEY` opens on your phone; paste the key there and nowhere else. Agent J checks it right away against Kimi's read-only endpoint.
3. Restart the background service, see which tools it can switch to, then switch to Kimi K3:

```bash
agentj service restart
```

```bash
agentj agent switch --scan
```

```bash
agentj agent switch opencode --model kimi-code-plan-cn/k3
```

For a membership bought on kimi.ai, write the model as `kimi-code-plan-global/k3`.

How the key card works: [Admin rights and API keys, from your phone](/docs/phone-admin/).

## AI coding tools {#tools}

Both work on the same membership:

- **OpenCode (the default)**: the steps above. OpenCode already knows Kimi; there is nothing else to configure. OpenCode not installed yet? See [Set up AI command-line tools](/docs/setup-agents/#opencode).
- **Kimi Code (Moonshot's own `kimi`, MIT open source)**: version 2.2.0 or newer. Install:

```bash
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
```

Sign in either way: in **your own terminal** run `kimi login --region mainland-cn` (kimi.com membership) or `kimi login --region global` (kimi.ai membership) and confirm on a device signed in to Kimi; or use the `KIMI_API_KEY` key card above. Then switch:

```bash
agentj agent switch kimi
```

For a kimi.ai membership add `--region global`:

```bash
agentj agent switch kimi --region global
```

Kimi Code runs in independent sessions only. Every permission request goes to your phone, and an approval counts for that one request only. More: [Switch to Kimi Code](/docs/switch-harness/#kimi).

## Models and screenshots {#models}

| Use | Model in OpenCode | Reads screenshots |
|---|---|---|
| Main model | `kimi-code-plan-cn/k3` | Yes (tested) |
| Fast, light tasks | `kimi-code-plan-cn/kimi-for-coding` | Yes (tested) |
| K3 with a 256k context, uses less quota | `kimi-code-plan-cn/k3-256k` | Kimi says yes |

For a kimi.ai membership, replace the prefix `kimi-code-plan-cn/` with `kimi-code-plan-global/`. Tested means: on 2026-10-16 we sent a software screenshot and asked for the dialog title, the error code, the button text and an amount in a table; in OpenCode and in Kimi Code it got all of them right. Kimi says K3's 1M context needs Pro or higher.

## Common problems {#pitfalls}

- **401 after a while**: usually not a broken key but used-up quota. Kimi counts quota per 5 hours and per month, does not publish the numbers, and shares it with the Kimi app. Wait for it to refill, or upgrade.
- **Bought Go and it does not connect**: Go has no coding quota; you need Plus or higher.
- **kimi.com or kimi.ai**: choose the site you bought on. In our 2026-10-16 test a kimi.com membership key worked on both the China and the overseas endpoint; a key bought on kimi.ai has not been tested.
- **Scheduled tasks, support bots**: membership quota is for you, working interactively in a coding tool; Agent J never hands this key to them.

## Switch back {#switch-back}

Tell the Agent at any time: switch back to Claude Code (or Codex). It checks first and switches only if that works. Or run it on the computer yourself:

```bash
agentj agent switch claude
```

To go straight back to the tool you used before the last switch:

```bash
agentj agent switch --undo
```

Details: [Switch AI coding tool](/docs/switch-harness/).

<details>
<summary>Technical details: addresses and names</summary>

- OpenCode provider: `kimi-code-plan-cn` for a kimi.com membership, `kimi-code-plan-global` for a kimi.ai membership.
- Coding endpoints: China `https://api.kimi.com/coding/v1`, overseas `https://api.kimi.ai/coding/v1`. The key card's read-only check uses their model list.
- Key variable: `KIMI_API_KEY`. With Kimi Code, Agent J hands this key over in memory only, and only when Kimi itself is not signed in; nothing is written to Kimi's settings.

</details>
