{"uid":"cap_otYq6pDhJRN83wsjA_pK0","slug":"agentrxi-kimi-code-chat-completions-3f90db69","name":"AgentRXI Kimi Code Chat Completions","description":"OpenAI-compatible chat completions on Moonshot Kimi K2.7 Code, a coding and software-agent model with tool calling (262K context). Set your OpenAI SDK base URL to https://agentrxi.com/v1/kimi-code and pay per token with x402 instead of an API key: $1.9 per million input and $8 per million output tokens, minimum $0.002 a call, at most $0.1742. The 402 quotes your request's maximum; \"upto\" payers are charged only the tokens used. Same request/response shape as OpenAI (tool call","url":"https://agentrxi.com/v1/kimi-code/chat/completions?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","description":"User message"},"system":{"type":"string","description":"Optional system message"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"id":"chatcmpl-...","model":"kimi-k2.7-code","usage":{"total_tokens":18,"prompt_tokens":14,"completion_tokens":4},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Bonjour !"},"finish_reason":"stop"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.018422","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.018422/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.018422","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.018422","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_b1aIGD7uG3lPlyT2oih4s","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.018422","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs a prompt through Moonshot AI's Kimi-K2 code-specialized LLM and returns a chat completion response, billed per call in USDC via x402.","exampleAgentPrompt":"Write me a Python function that parses a JSON file and returns all keys with null values — use the Kimi code model, keep the response focused, max 500 tokens.","exampleUseCases":[{"title":"Automated code review comment generation","prompt":"I just got a pull request diff — use the Kimi code model to write a concise code review comment pointing out any potential bugs or style issues in this snippet: `def calc(x): return x/0`"},{"title":"On-the-fly scripting for data pipeline","prompt":"Use the Kimi code LLM to write a short Bash script that watches a directory for new CSV files and moves them to an archive folder once they're older than 7 days — keep it under 300 tokens."},{"title":"Explain a complex algorithm in plain English","prompt":"Ask the Kimi code model to explain how Dijkstra's shortest-path algorithm works, step by step, in plain English suitable for a junior developer — limit the answer to 400 tokens."}],"resultDescription":"Returns an OpenAI-compatible chat completion JSON object containing the assistant's generated message content, the model name (kimi-k2.7-code), token usage breakdown (prompt, completion, total), a finish reason (e.g. 'stop'), and a unique completion ID.","failureModes":["Missing required 'prompt' query parameter returns a 400 error","Insufficient USDC balance or failed x402 payment results in 402 Payment Required","Overly long prompt exceeding context window causes truncation or 400 error","Invalid temperature or max_tokens values may cause a 422 validation error","Model unavailability on the upstream Kimi API results in a 503 or timeout response"],"whenToPreferThis":"Choose this endpoint when you need a code-specialized LLM (Kimi-K2 code variant) without API key registration or monthly subscription — ideal for agents that need pay-per-call, stateless code generation or code reasoning. Prefer over general-purpose LLMs when the task is coding-heavy (writing functions, debugging, explaining algorithms). Prefer over other AgentRXI LLM endpoints when specifically needing the Kimi code model's coding strengths.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-15T06:38:54.216Z","isFirstParty":false,"canonicalSlug":"agentrxi-kimi-code-chat-completions-3f90db69"}