# Kimi K3 API Complete API reference for Kimi K3 LLM models powered by Moonshot AI. ## Model Variants This API supports one model variant: | Model | ID | Description | |-------|----|-------------| | **Kimi K3 Text to Text** | `kimi-k3-text-to-text` | General text reasoning and writing | ## Quick Comparison | Feature | Text to Text | |---------|--------------| | Text input | Required ✅ | | Image input | Not supported ❌ | | File input | Not supported ❌ | | Streaming response | SSE | | `max_tokens` | Optional | | `top_k` | Optional | ## Kimi K3 Text to Text ### Endpoint ```http POST /api/v1/chat/completions ``` ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model` | string | Must be `"kimi-k3-text-to-text"` | | `messages` | array | Ordered messages. See LLM API for the message structure. | | `stream` | boolean | `true` for SSE, `false` for a single JSON response. | #### Message Support | Field | Text | File | Image | |-------|------|------|-------| | `messages` | Required ✅ | Not supported ❌ | Not supported ❌ | #### Optional | Parameter | Type | Range | Description | |-----------|------|-------|-------------| | `max_tokens` | integer | `> 0` | Maximum output tokens. No default maximum. | | `top_k` | integer | `> 0` | Limits the number of candidate tokens. | ### Example Request ```javascript const response = await fetch('https://api.flaq.ai/api/v1/chat/completions', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'text/event-stream', 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'kimi-k3-text-to-text', messages: [ { role: 'user', content: 'Write a concise Java beginner tutorial outline.' } ], stream: true, max_tokens: 2000, top_k: 50 }) }); ``` ## Response Format Kimi K3 returns OpenAI-compatible completion responses. With `stream: true`, the response is Server-Sent Events; with `stream: false`, the response is a single JSON object. ## Best Practices - Kimi K3 currently supports text-only input through this route. - Use concise system instructions for task-specific behavior. - Tune `top_k` only when you need stricter or more varied output.