Kimi K3.1 Pro API: Pricing, Setup, and the Caching Math

Kimi K3.1 API on Morph: $2.50/M in, $0.29/M cached, $14.00/M out, 1M context. Claude Code and Codex setup, caching math, and how it compares to Moonshot.

November 9, 2026 · 1 min read
Per 1M tokens in / out on Morph
$2.50 / $14.00
Per 1M tokens in / out on Morph
Cached input
$0.29/M
Cached input
Measured output speed on Morph, November 9, 2026
~115 tok/s
Measured output speed on Morph, November 9, 2026
Ultra plan, no token meter
$200/mo
Ultra plan, no token meter

The Kimi K3.1 API on Morph

Last updated November 9, 2026.

Kimi K3.1 Pro is Moonshot AI's open-weight successor to Kimi K3: 2.8T parameters, 104B active, a 1M-token context, and thinking that is always on. Moonshot launched it on October 23, 2026. On Morph, call it as morph-kimik31 for $2.50 per million input tokens, $0.29 cached and $14.00 output. One Morph key works on an OpenAI-compatible endpoint and the Anthropic Messages API, so Claude Code, Codex and the OpenAI SDKs need only a base URL, a key and a model name. Moonshot's own list price is lower, $2.00 / $0.20 / $10.00, and this page shows both. What Morph adds: about 115 tokens per second measured on its public charts, 50% off with service_tier: "standby", a flat $200 Ultra plan with no token meter, and one key for K3.1, DeepSeek V4.1 Flash and GLM-5.3. On any host, pass back the full assistant message every turn, including reasoning_content and tool_calls.

Kimi K3.1 Pro API pricing (per 1M tokens)
EndpointModel IDInputCached inputOutput
Morph, default tiermorph-kimik31$2.50$0.29$14.00
Morph, standby tiermorph-kimik31 + standby$1.25$0.145$7.00
Morph Ultra ($200/month)morph-kimik31IncludedIncludedIncluded
Moonshot APIkimi-k3.1-pro$2.00$0.20$10.00
Moonshot API, Highspeedkimi-k3.1-pro-highspeed$4.00$0.20$20.00

Moonshot rows from the Kimi API pricing page, checked November 9, 2026. Moonshot bills 5-minute cache writes at the input rate and 1-hour cache writes at $4.00; Morph has no cache-write surcharge. Moonshot priced K3.1 Pro 33% below Kimi K3 on all three rates, per Artificial Analysis. Morph rows are Morph's live billing rates. Every row is flat across the full 1M context.

Morph vs Moonshot's own API

Both hosts speak both API formats. The differences are price, speed options, and what sits around the model.

Calling Kimi K3.1 Pro: Morph vs Moonshot
MorphMoonshot
OpenAI-compatible base URLhttps://api.morphllm.com/v1https://api.moonshot.ai/v1
Anthropic Messages base URLhttps://api.morphllm.comhttps://api.moonshot.ai/anthropic
Model IDmorph-kimik31kimi-k3.1-pro
Input / cached / output per 1M$2.50 / $0.29 / $14.00$2.00 / $0.20 / $10.00
Cache writesNo surchargeInput rate (5 min TTL), $4.00 (1 h TTL)
SpeedAbout 115 tok/s measured, November 9, 2026Highspeed variant: 2 to 3x K3.1 Pro, per Moonshot
Same key also servesDeepSeek V4.1 Flash, GLM-5.3Other Kimi models
Coming from morph-kimik3?

morph-kimik3 still works. It is now an alias that serves the Kimi K3.1 Pro weights at the same rates. Switch to morph-kimik31 so your config names the model you get. The original Kimi K3 API guide stays up for reference.

Use It in Claude Code

Claude Code is the harness Moonshot used for most of K3.1 Pro's published coding scores, Terminal-Bench 4.0 included. Morph serves the Anthropic Messages API directly, so Claude Code needs four environment variables and no proxy. ANTHROPIC_MODEL remaps the Sonnet and Opus slots. ANTHROPIC_SMALL_FAST_MODEL remaps Haiku, which handles background calls for titles and summaries; DeepSeek V4.1 Flash does that job at $0.12 in and $0.80 out per million tokens.

export ANTHROPIC_BASE_URL="https://api.morphllm.com"
export ANTHROPIC_AUTH_TOKEN="YOUR_MORPH_API_KEY"
export ANTHROPIC_MODEL="morph-kimik31"
export ANTHROPIC_SMALL_FAST_MODEL="morph-dsv41flash"
claude

To keep it across terminals, put the same values in ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.morphllm.com",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_MORPH_API_KEY",
    "ANTHROPIC_MODEL": "morph-kimik31",
    "ANTHROPIC_SMALL_FAST_MODEL": "morph-dsv41flash"
  }
}
  • 401 on every request: an Anthropic key is still set. Claude Code sends ANTHROPIC_AUTH_TOKEN as a bearer token, and ANTHROPIC_API_KEY also works; do not leave an Anthropic key in either.
  • Model not found: use the Morph ID morph-kimik31, not a Claude model name.

Optional: curl -fsSL https://www.morphllm.com/install.sh | bash && morph install installs the morph CLI and adds Morph's agent skills to the coding agents it detects (Claude Code, Codex, Cursor, OpenCode). It does not change which model your agent calls; the variables above do that. Full reference: Claude Code on Morph.

Use It in Codex, Cline, Cursor, OpenCode

Codex

Codex speaks only the OpenAI Responses API, which Morph serves at /v1/responses. Export MORPH_API_KEY, then add this to ~/.codex/config.toml, with the two top-level keys above the first table:

model = "morph-kimik31"
model_provider = "morph"

[model_providers.morph]
name = "Morph"
base_url = "https://api.morphllm.com/v1"
env_key = "MORPH_API_KEY"
wire_api = "responses"

Codex may warn that it has no metadata for morph-kimik31; that is expected. Run codex -m morph-dsv41flash when you want the faster model. More on this file in the Codex provider configuration guide.

OpenAI SDK (Python and TypeScript)

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.morphllm.com/v1",
    api_key=os.environ["MORPH_API_KEY"],
)

resp = client.chat.completions.create(
    model="morph-kimik31",
    messages=[{"role": "user", "content": "Find the race condition in this worker loop: ..."}],
    extra_headers={"x-session-id": "conv-8f2c1a"},  # one id per conversation
)
print(resp.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.MORPH_API_KEY,
  baseURL: "https://api.morphllm.com/v1",
  maxRetries: 5, // retries 429s and honors Retry-After
});

const resp = await client.chat.completions.create({
  model: "morph-kimik31",
  messages: [{ role: "user", content: "Write a migration that indexes users.email." }],
});
console.log(resp.choices[0].message.content);

No temperature or top_p in either request. That is on purpose; see fixed sampling below.

Anthropic SDK

import os
import anthropic

client = anthropic.Anthropic(
    api_key=os.environ["MORPH_API_KEY"],
    base_url="https://api.morphllm.com",  # no /v1 suffix
)

msg = client.messages.create(
    model="morph-kimik31",
    max_tokens=8192,
    messages=[{"role": "user", "content": "Explain this stack trace: ..."}],
)
# The response can lead with a thinking block. Read the last text block.
print([b.text for b in msg.content if b.type == "text"][-1])

OpenCode

OpenCode ships a Morph provider that reads MORPH_API_KEY, so the config is two lines in ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "morph/morph-kimik31",
  "small_model": "morph/morph-dsv41flash"
}

If opencode models morph does not list morph-kimik31, your OpenCode catalog predates K3.1; add the model under provider.morph.models in the same file.

Cline, Cursor, and other OpenAI-compatible clients

In Cline, Cursor, Roo Code or any client that accepts an OpenAI-compatible base URL, enter https://api.morphllm.com/v1, your Morph key, and morph-kimik31 as the model. No extra headers are required.

Kimi K3.1 Pricing and the Caching Math

An agent loop resends the whole conversation every turn. That makes the cached-input rate, not the input rate, the number that decides an agent bill. Here is one session worked through at each price, computed from the rates above:

  • 20,000-token system prompt and tool definitions
  • 3,000 new input tokens per turn (tool results, user text)
  • 2,000 output tokens per turn, reasoning included
  • 30 turns, ending at a 168,000-token context (well inside the 1M window)

In this model each token bills at the full input rate once, the first time it is sent, and every resend after that is a cache hit. That puts 94% of the session's 2,865,000 input tokens at the cached rate: 168,000 uncached, 2,697,000 cached, plus 60,000 output. The previous reply is counted as uncached on the next turn, which errs high.

One 30-turn Kimi K3.1 Pro agent session (USD)
BillingInputCached inputOutputSession total
Morph, default tier$0.42$0.78$0.84$2.04
Morph, standby tier$0.21$0.39$0.42$1.02
Moonshot API$0.34$0.54$0.60$1.48
Moonshot API, Highspeed$0.67$0.54$1.20$2.41
Morph rates, every turn a cache miss$7.16$0.00$0.84$8.00

Moonshot's list price wins this comparison: $1.48 against $2.04 on Morph's default tier. Morph's standby tier brings the same session to $1.02, and the Ultra plan removes the meter (next section). The last row is the real lesson: with no cache hits the session costs $8.00, about 4x more. If a K3.1 bill looks wrong, check the cache-hit ratio before the sticker price.

Real hit rates fall short of this model when a prefix changes mid-session (a timestamp in the system prompt, an edited earlier turn) or a turn lands on a worker that does not hold the prefix. Every response reports what it reused in usage.prompt_tokens_details.cached_tokens. On Morph, a session key or an Agent Run ID keeps turns on the worker holding the prefix (see agent features). Moonshot also caches automatically, with a 5-minute default TTL. The full mechanics are on the prompt caching page.

Standby and the Ultra Plan

Standby: 50% off when nobody is waiting

Add service_tier: "standby" to a request and every leg bills at half: $1.25 input, $0.145 cached and $7.00 output per million tokens. Standby runs on spare capacity. When a region is busy it returns a fast 429 with Retry-After: 15 instead of queueing, and shed requests are never billed. Caching still applies, so cached standby input gets both discounts. It fits evals, nightly jobs and background agents. It does not fit a developer waiting at the terminal.

resp = client.chat.completions.create(
    model="morph-kimik31",
    messages=messages,
    service_tier="standby",  # 50% off; fast 429 + Retry-After when busy
)

Ultra: $200 a month, no token meter

Morph Ultra is a flat $200 a month for unlimited Kimi K3.1 and DeepSeek V4.1 Flash, with no token meter on either and a cap of 1,000 subscriptions. It covers your API keys, so every setup on this page runs on the plan unchanged. Unlimited does not mean unthrottled. Each subscription has per-minute limits on uncached input and output tokens, cached input does not count toward them, and the plan does not reserve capacity, so requests can return 429 when Morph is at capacity.

Ultra rate limits per subscription (tokens per minute)
ModelUncached inputOutput
Kimi K3.172,8706,162
DeepSeek V4.1 Flash2,103,23776,559

Two numbers to size it. At Morph's default tier, $200 covers about 98 sessions like the one above; at Moonshot's list price, about 136. And 6,162 output tokens a minute is a little under one K3.1 stream running nonstop at the measured ~115 tokens a second (6,900 a minute). The plan is sized for an interactive agent loop, not a fleet of agents running in parallel; put those on per-token billing or standby.

The Thinking-Replay Gotcha

The most common K3.1 complaint, "it gets worse after a few turns," is usually a harness bug. Moonshot's model card says K3.1 Pro "requires the complete assistant message returned by the API to be passed back to messages as-is", including reasoning_content and tool_calls, "not just content". A harness that keeps only content erases the model's own reasoning from every earlier turn.

The bug and the fix
# Wrong: keeps the answer, drops reasoning_content and tool_calls
messages.append({"role": "assistant", "content": msg.content})

# Right: append every field the API returned
messages.append(msg.model_dump(exclude_none=True))

A full tool-calling loop that follows the rule:

messages = [{"role": "user", "content": "Find and fix the failing test in src/."}]

while True:
    resp = client.chat.completions.create(
        model="morph-kimik31",
        messages=messages,
        tools=TOOLS,
    )
    msg = resp.choices[0].message
    messages.append(msg.model_dump(exclude_none=True))  # reasoning_content + tool_calls intact
    if not msg.tool_calls:
        break
    for call in msg.tool_calls:
        messages.append({
            "role": "tool",
            "tool_call_id": call.id,
            "content": run_tool(call),
        })

Moonshot's quickstart states the tool half of the rule: "After executing every call, return the complete assistant message and append one tool result with the matching tool_call_id for each call." Replay adds prompt tokens, but the replayed prefix is byte-identical every turn, so it bills at the cached rate ($0.29 per million on Morph). To test a harness, log the request body at turn 3 and check that turn 2's assistant message still carries reasoning_content and tool_calls.

Fixed Sampling and Always-On Thinking

Two more K3.1 Pro rules catch API users who port a config from another model.

Leave sampling parameters out

Moonshot's quickstart: "temperature=1.0, top_p=0.95, n=1, presence_penalty=0, and frequency_penalty=0 are fixed; omit them from requests." The model card's scores use temperature 1.0 and top_p 0.95 unless noted. A temperature: 0.2 copied from another model's config moves you off the settings behind those scores. Drop the fields on any host.

Thinking cannot be turned off

"K3.1 Pro always has thinking mode enabled," per Moonshot. Reasoning tokens bill as output on Morph, and output is the expensive leg. Artificial Analysis measured 55,000 output tokens per Intelligence Index task, 14% more than Kimi K3's 48K. That much output costs $0.77 at Morph's $14.00 rate and $0.55 at Moonshot's $10.00.

Moonshot's API accepts a reasoning effort of low, high or max, with max as the default. Moonshot's own Terminal-Bench 4.0 cost chart shows the trade: high scored 52.8% at $4.16 per task, max scored 65.7% at $5.25 per task (cost data from tbench.ai).

Always on
“K3.1 Pro always has thinking mode enabled.”
Moonshot, Kimi K3.1 Pro quickstart

Two parsing rules follow. With strict JSON Schema output, Moonshot says to parse only message.content, not reasoning_content. On the Anthropic Messages API, a response can lead with a thinking block, so read the last text block, not content[0].text.

Agent Features on Morph: Dynamic Tools, Agent Runs, Session Keys

Three request fields on morph-kimik31 target long tool-calling runs, where cache placement decides both latency and cost.

Dynamic tool loading

Add tool schemas mid-conversation in a system message that has a tools array and no content key. An agent searches a large registry, then loads only what it needs instead of resending the full catalog every turn.

Agent Runs (run_id)

Tag every request in a tool-calling loop with one run_id. The run stays on the worker holding its KV cache, resumes ahead of new arrivals after a tool call, and is admitted or paused as a whole under load.

Session keys

Send one x-session-id header per conversation and each turn is placed where its prefix is cached. prompt_cache_key in the body, which Codex and OpenCode already send, steers region placement. A key changes placement, never billing.

import uuid

run_id = f"run-{uuid.uuid4().hex[:8]}"

resp = client.chat.completions.create(
    model="morph-kimik31",
    messages=messages,
    tools=TOOLS,
    extra_body={"run_id": run_id},  # same id on every turn of this run
)

# When the run ends, release it. Generates nothing, bills nothing.
client.chat.completions.create(
    model="morph-kimik31",
    messages=[{"role": "user", "content": ""}],
    extra_body={"run_id": run_id, "run_final": True},
)

Docs: dynamic tool loading, Agent Runs, session keys and caching.

Why Kimi K3.1 Pro

Moonshot describes K3.1 Pro as a post-trained version of Kimi K3 with "substantially larger post-training compute." The model card lists 2.8T total parameters, 104B active per token, and 896 experts with 16 selected per token. One architecture change from K3: the full-attention Gated MLA layers became Gated DeepSeek Sparse Attention, for 69 KDA plus 24 Gated DSA layers. Weights ship natively as MXFP4 with MXFP8 activations from quantization-aware training. Open weights went up on Hugging Face on November 2, 2026, under the Kimi K3.1 Pro License, an MIT-style grant with added terms for very large commercial deployments.

Kimi K3.1 Pro vs Claude, Moonshot-reported (max effort)
Benchmark (K3.1 harness)Kimi K3.1 ProClaude Opus 5.5Claude Fable 5.1
Terminal-Bench 4.0 (Claude Code)65.766.457.9
SWE Marathon v1.1 (Claude Code)51.746.345.6
DeepSWE v1.1 (Claude Code)75.574.267.4
Program Bench (Claude Code)31.565.053.5
HLE-Full, with tools70.067.765.6
GDPval-AA v2.1, Elo (cited from AA)184618661754

From the table on Moonshot's Hugging Face model card. K3.1 Pro ran at max effort, temperature 1.0 and top_p 0.95 unless noted. Claude columns are "max, w/ fallback" scores that Moonshot took from blog posts, technical reports and official leaderboards, not its own runs. Claude Fable 5.2 launched on November 9, 2026, after this table, so Fable 5.1 is the Fable column. Moonshot did not report SWE-bench Verified or SWE-bench Pro for K3.1 Pro.

67%
Terminal-Bench 4.0, Artificial Analysis's own run, highest of any model (Oct 23, 2026)
46
AA Intelligence Index v5, top open-weights model (Oct 27, 2026)
55
AA Intelligence Index pre-v5 at launch, 4th overall (Oct 23, 2026)

Artificial Analysis ran Terminal-Bench 4.0 itself and got 67%, up from 13% for Kimi K3. Moonshot's 65.7 comes from its own Claude Code harness run. On the Intelligence Index, K3.1 Pro scored 55 at launch on the pre-v5 index, 11 points over K3. On v5, released October 27, it scores 46, the top open-weights model, behind Claude Opus 5.5 at 58. The two index versions are not comparable. Hallucination dropped too: Artificial Analysis measured a 44% hallucination rate on AA-Omniscience, down from 53% for K3, and Moonshot's internal claim-level rate fell from 23.4% to 8.3%.

For the model itself, see the Kimi K3.1 Pro deep dive. Head-to-heads: Kimi K3.1 vs Claude, Kimi K3.1 vs Fable 5.2 and GLM-5.3 vs Kimi K3.1.

Morph or Moonshot's API?

Both serve Kimi K3.1 Pro on both API formats, so the choice comes down to billing and what sits around the model.

Choose Morph when
  • You want a flat bill: Ultra is $200 a month with no token meter on K3.1 and V4.1 Flash
  • Your work can wait: standby takes 50% off every leg
  • You run several models: one key for K3.1, DeepSeek V4.1 Flash and GLM-5.3
  • You run long tool-calling loops: run_id keeps each run on the worker holding its cache
  • You want measured speed: about 115 tok/s and 1.5 s to first token (November 9, 2026)
Choose Moonshot's API when
  • You want the lowest per-token list price: $2.00 / $0.20 / $10.00
  • Your volume is low and per-session cost is all that matters: $1.48 vs $2.04 on Morph's default tier in the worked session
  • You need the Highspeed variant, 2 to 3x faster per Moonshot, at $4.00 / $20.00

To compare every hosted price, OpenRouter lists 24 endpoints for moonshotai/kimi-k3.1-pro, Morph among them.

FAQ

How much does the Kimi K3.1 API cost?

On Morph, morph-kimik31 costs $2.50 per million input tokens, $0.29 per million cached input tokens and $14.00 per million output tokens, flat across the 1M-token context. Standby requests (service_tier "standby") cost 50% less on every leg. The Ultra plan is $200 a month with no token meter on Kimi K3.1 and DeepSeek V4.1 Flash, subject to per-minute rate limits. Moonshot's own API lists kimi-k3.1-pro lower, at $2.00 input, $0.20 cached and $10.00 output per million tokens.

Is Morph cheaper than Moonshot for Kimi K3.1 Pro?

Not per token. Moonshot's list price ($2.00 / $0.20 / $10.00 per million input, cached and output tokens) is below Morph's default rate ($2.50 / $0.29 / $14.00). In the 30-turn agent session worked through on this page, Moonshot comes to $1.48 and Morph's default tier to $2.04. Morph comes out lower on its standby tier ($1.02 for the same session) or on the flat $200 Ultra plan once you run more than about 136 sessions of that size a month.

How do I get a Kimi K3.1 API key?

Create a Morph account and make a key on the API keys page of the dashboard. Use it with base URL https://api.morphllm.com/v1 for OpenAI-compatible clients or https://api.morphllm.com for the Anthropic Messages API, and pass morph-kimik31 as the model. The same key works for DeepSeek V4.1 Flash and GLM-5.3. For Moonshot's first-party API, create a key on the Kimi API Platform and call kimi-k3.1-pro at https://api.moonshot.ai/v1.

Can I use Kimi K3.1 in Claude Code?

Yes. Set ANTHROPIC_BASE_URL to https://api.morphllm.com, ANTHROPIC_AUTH_TOKEN to your Morph key, ANTHROPIC_MODEL to morph-kimik31 and ANTHROPIC_SMALL_FAST_MODEL to morph-dsv41flash, then run claude. Morph serves the Anthropic Messages API directly, so no proxy is needed. Moonshot ran most of K3.1 Pro's published coding benchmarks, including Terminal-Bench 4.0, in the Claude Code harness.

Why does Kimi K3.1 get worse after a few turns in my agent?

Usually the harness drops the model's reasoning. Moonshot's model card says K3.1 Pro requires the complete assistant message returned by the API to be passed back as-is, including reasoning_content and tool_calls, not just content. Append the whole message object every turn and never rewrite earlier turns. The replayed prefix is identical each turn, so it bills at the cached rate ($0.29 per million on Morph).

Can I turn off thinking or set the temperature on Kimi K3.1?

No. Moonshot's quickstart says K3.1 Pro always thinks, and its API fixes temperature at 1.0, top_p at 0.95, n at 1 and both penalties at 0, with instructions to omit them from requests. Moonshot's published scores use temperature 1.0 and top_p 0.95 unless noted, so leave sampling parameters out on any host. Moonshot's API does accept a reasoning effort of low, high or max (default max). Reasoning tokens bill as output on Morph.

What is the difference between Kimi K3.1 and Kimi K3.1 Pro?

There is no separate Kimi K3.1 model. Moonshot calls K3.1 Pro the first model in the K3.1 series, so "Kimi K3.1" means K3.1 Pro. Moonshot's API also offers kimi-k3.1-pro-highspeed, which Moonshot says runs 2 to 3 times faster, at $4.00 input and $20.00 output per million tokens. Morph's morph-kimik31 serves Kimi K3.1 Pro.

How fast is the Kimi K3.1 API on Morph?

About 115 output tokens per second and about 1.5 seconds to first token. Both figures are the median of hourly medians over the 24 hours ending November 9, 2026, from Morph's public charts at ultra.morphllm.com.

Does morph-kimik3 still work?

Yes. morph-kimik3 is now an alias that serves the Kimi K3.1 Pro weights at the same rates. Use morph-kimik31 in new configs so the ID names the model you get.

Related Articles

Private deployments

The fastest endpoints are private deployments

Morph's top speeds come from dedicated deployments, not shared public endpoints: speculators trained on your traffic, caching tuned to your workload, and volume discounts over public per-token rates. Over 1 trillion tokens per day run this way.

Talk to us about a private deployment

Get your Kimi K3.1 API key

One key for Kimi K3.1 Pro, DeepSeek V4.1 Flash and GLM-5.3, on the OpenAI and Anthropic formats. Pay per token, take 50% off with standby, or go flat with Ultra at $200 a month.

Sources