Giving Your Agent the Full File: A Practical Guide to Kimi K3.1 Pro's 1M-Token Context

Many agent mistakes in knowledge work come down to missing context: the model never saw the contract clause, the earlier decision note, or the spreadsheet table that mattered. Moonshot AI's Kimi K3.1 Pro offers a 1-million-token window. Here is how to use that room well.
Kimi K3.1 Pro is Moonshot AI's open-weight, natively multimodal agentic model, post-trained from Kimi K3, and it has a 1,048,576-token context window.
Thinking is always on; you choose how much reasoning effort the model spends rather than switching reasoning on or off.
Text and image inputs go in together, so a scanned table and the memo explaining it can sit inside a single request.
Function tool definitions and structured JSON schema output make the model practical for agents that write records back into your systems.
Moonshot AI's benchmarks, mostly internal, report gains in long-horizon coding, financial workflows, and factual accuracy that are worth verifying on your own files.
Why a larger window changes how you build agents
With a narrow context window, building an agent is largely an exercise in deciding what to discard. You split documents into chunks, retrieve a few passages, and hope the qualifying clause or prior exception survived the cut. A 1,048,576-token window does not remove the need for judgment, but it moves where that judgment sits. Instead of rationing fragments, you can hand the model a complete contract set, a full quarter of meeting notes, or a project folder that fits within the window, and ask it to work across the whole collection at once.
That shift matters most for the questions knowledge workers actually ask: what changed between two full drafts, which of last month's recorded decisions a new proposal contradicts, or where in a filing a summary revenue figure originates. Those answers live in the connections across documents, which is exactly the layer that chunked retrieval tends to sever.
What Moonshot AI built the model to handle
As of November 2026, Moonshot AI describes Kimi K3.1 Pro as the first model in the K3.1 series, post-trained from Kimi K3 with substantially larger post-training compute and large-scale joint reinforcement learning across hundreds of downstream domains. Under the hood, it uses a Mixture-of-Experts architecture with 2.8T total parameters and 104B activated parameters across 93 layers, according to the Hugging Face model card.
Three of the areas Moonshot AI highlights map directly onto knowledge work. In finance, the company describes the model as capable of end-to-end delivery of complete financial workflows. It reports a score of 64.4 on OfficeQA Pro v2 for fiscal data analysis over real financial documents, along with internal benchmark gains over Kimi K3 in financial modeling, financial research, and business operations. On factual accuracy, Moonshot AI reports that on its internal Kimi Hallu Bench Hard stress test, the claim-level hallucination rate dropped from 23.4% for Kimi K3 to 8.3% for Kimi K3.1 Pro. On long-horizon coding, its internal Kimi Code Bench 3.0 Long-horizon benchmark puts K3.1 Pro at 61.2% compared with 55.95% for Kimi K3. All of these figures are Moonshot AI's own, evaluated at maximum reasoning effort on mostly internal benchmarks, so treat them as a reason to test on your own documents rather than a settled outcome.
Assemble the context pack before writing the prompt
A 1-million-token window rewards deliberate preparation. Before starting an agent run, assemble a context pack the same way you would organize a briefing folder for a new colleague:
Source documents, labeled. Place each file under a clear heading with its title, date, and owner so you can ask the model to point to the record behind each claim.
The decision log. Include the notes that capture what your team has already settled, so the agent does not reopen questions that were resolved weeks earlier.
Images where the meaning is visual. Add a chart, a scanned table, or a whiteboard photo as an image part in the same request, right beside the text that refers to it.
The task last. Put the specific question, the target output format, and what counts as finished at the end, below the source material rather than above it.
Instruct the model to quote the heading of the source document it relied on for every point it returns. When the entire working set sits inside one window, that citation habit lets a human reviewer check the output against specific sources instead of rereading the whole folder.
Matching reasoning effort to the job
Thinking cannot be turned off in Kimi K3.1 Pro, which makes reasoning effort your main lever on each request. Lower effort fits straightforward lookups inside a context pack you already know well, while higher effort is worth spending on cross-document comparisons, multi-table financial reconciliation, or multi-step tool execution. Moonshot AI ran all of its published benchmarks at its max reasoning effort setting, while Kie.ai accepts low, medium, or high, so treat those scores as a reference point rather than an expectation for your own settings.
Calling the model from an agent
The model is available through the Kimi K3.1 Pro API on Kie.ai, which exposes it on an OpenAI Responses-compatible endpoint, offers a playground, and accepts reasoning effort values of low, medium, or high. The Python script below sends a labeled context pack, requests JSON output that follows a schema, and preserves the full conversation history for a follow-up turn.
import os, json, requests
URL = "https://api.kie.ai/openai/v1/responses"
HEADERS = {
"Authorization": f"Bearer {os.environ['KIE_API_KEY']}",
"Content-Type": "application/json",
}
def load_pack(paths):
parts = []
for p in paths:
with open(p, encoding="utf-8") as f:
parts.append(f"## {os.path.basename(p)}\n{f.read()}")
return "\n\n".join(parts)
schema = {
"type": "object",
"properties": {
"conflicts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"claim": {"type": "string"},
"source_heading": {"type": "string"},
},
"required": ["claim", "source_heading"],
},
}
},
"required": ["conflicts"],
}
history = [{
"role": "user",
"content": load_pack(["decisions.md", "proposal.md"])
+ "\n\nList every point where the proposal contradicts a recorded decision.",
}]
def ask(history):
body = {
"model": "kimi-k3-1-pro",
"input": history,
"reasoning": {"effort": "high"},
"text": {"format": {"type": "json_schema", "name": "conflicts", "schema": schema}},
"stream": False,
}
r = requests.post(URL, headers=HEADERS, json=body, timeout=600)
r.raise_for_status()
return r.json()
resp = ask(history)
# Keep the full assistant output, reasoning and tool calls included, for the next turn.
history += resp.get("output", [])
print(json.dumps(resp, indent=2)[:2000])Two details in that script are deliberate. First, Moonshot AI notes that in multi-turn conversations and tool-calling workflows, the complete assistant message, including both reasoning content and tool calls, should be passed back as-is, so the script appends the full output array rather than only the final text. Second, the request sets stream to false because the caller wants a single complete JSON object; for an interactive chat interface you would set stream to true instead. The script was tested against the Kie.ai endpoint on November 6, 2026: the output array held a reasoning item followed by the message, and sending both back in a second turn worked as expected.
Limits to plan around
No built-in tools. On Kie.ai, built-in tools are ignored, per Kie.ai's Kimi documentation. When your agent needs current external information, fetch those records in your own code and add them to the context pack.
Function tools only. Tool calling works only with your own function definitions, so structure your external integrations as explicit functions that the agent can invoke.
Text and images only. On Kie.ai, the endpoint takes text and image inputs.
Reasoning is always on. Every request runs with thinking active, which is a token-budget consideration to keep in mind for high-volume, simple lookups.
A big window is not a filing system. Sending every file in your workspace on every turn is wasteful. Scope the context pack to what the task actually requires, and keep a stable preamble so repeated runs start from the same material.
A sensible first project
Pick one recurring review that currently takes a colleague an entire afternoon: checking a new proposal against recorded project decisions, reconciling a narrative report with its source tables, or summarizing a full quarter of working notes. Assemble the context pack once, run the check at high reasoning effort, and compare the model's cited document headings against what your human reviewer would have flagged. If those citations hold up reliably across a few runs, you have a practical workflow to hand to an agent. Kie.ai uses the same API key authentication across every model in its market, and because Kimi K3 uses the same endpoint format, you can compare it on the same pack by changing the model name.



