Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Setup guide - From Kimi and OpenCode docs

Use Kimi in OpenCode

Both Moonshot and OpenCode document this. OpenCode has a built-in Moonshot AI provider: you add the key with opencode auth login (or /connect), pick Kimi K3 with /models, and set reasoning effort with /variants.

Last verified 4 steps4 official sources

Steps

  1. Step 1.

    Run opencode auth login, select Moonshot AI in the provider list, then paste your Kimi Open Platform API key and press Enter.

    Terminal
    opencode auth login
  2. Step 2.

    Start OpenCode.

    Terminal
    opencode
  3. Step 3.

    Run /models, then search for and select Kimi K3.

    Snippet
    /models
  4. Step 4.

    Run /variants and select max. The status bar should show Kimi K3, Moonshot AI and max.

    Snippet
    /variants

Caveats

  • Kimi's guide was written against OpenCode 1.18.3.
  • OpenCode's own providers page still says "To use Kimi K2 from Moonshot AI" and uses the /connect command. Kimi K2 is discontinued; select Kimi K3 instead.
  • Kimi K3 needs available account balance; vouchers from new-user verification cannot be used for it.
  • The base URL and the MOONSHOT_API_KEY env var come from the moonshotai provider definition in OpenCode's models.dev registry (sst/models.dev). The setup steps themselves never ask you to enter a base URL.

FAQ

How do I use Kimi in OpenCode?

Both Moonshot and OpenCode document this. OpenCode has a built-in Moonshot AI provider: you add the key with opencode auth login (or /connect), pick Kimi K3 with /models, and set reasoning effort with /variants.

Which Kimi model ids work in OpenCode?

The official docs read for this guide list kimi-k3, kimi-k2.7-code and kimi-k2.6. Requests go to https://api.moonshot.ai/v1.

Is this an official Kimi and OpenCode setup?

The steps draw on both Kimi's and OpenCode's docs. It was last checked against 4 official pages on October 17, 2026.

Sources

Last verified against 4 official pages.

Newsletter

New models, set up the day they ship

One email per week. New model releases, the coding tools that support them and how to wire them up.