# AgentRXI Kimi Code Chat Completions

> AgentRXI Kimi Code Chat Completions is a paid API for AI agents from agentrxi.com, paid per call via x402, $0.018422/call, status unknown (last checked 2026-10-15).

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.

## Facts

- Endpoint: GET https://agentrxi.com/v1/kimi-code/chat/completions?utm_source=zero.xyz
- Price: $0.018422/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentrxi-kimi-code-chat-completions-3f90db69
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_otYq6pDhJRN83wsjA_pK0

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentrxi-kimi-code-chat-completions-3f90db69
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentrxi-kimi-code-chat-completions-3f90db69/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentrxi.com](https://www.zero.xyz/host/agentrxi.com/llms.txt)
