Overview
Use Kimi K2 Thinking model for agentic conversations with function calling capabilities. This endpoint excels at reasoning and tool use, returning tool calls for the caller to execute. Important: This endpoint returns tool calls but does not execute them. The caller is responsible for executing tools and providing results back in subsequent requests. Use this when you need:- Advanced reasoning and planning
- Function/tool calling
- Multi-step problem solving
- External API integration
- Streaming or non-streaming responses
Use cases
- API integration (weather, search, databases)
- Multi-step task planning
- Data retrieval and manipulation
- External system interaction
- Complex reasoning with tools
Model details
- Model: Kimi K2 Thinking (via Fireworks)
- Advanced reasoning capabilities
- Native tool calling support
- Caller-executed tools pattern
Request example
Request Body
- messages array (required) — Conversation history with user and assistant messages
- role string — Either
"user"or"assistant" - content string — Message content
- role string — Either
- tools array (required) — List of tool definitions available to the agent
- name string — Tool name (should be descriptive)
- description string — What the tool does
- input_schema object — JSON schema defining tool inputs
- system_prompt string (optional) — System prompt to guide the agent (default: “You are a helpful assistant with access to tools.”)
- stream boolean (optional) — Enable streaming response via Server-Sent Events (default: false)
Response
Non-streaming (default)
Streaming (stream=true)
Server-Sent Events format:Tool execution pattern
This endpoint follows a “caller-executed tools” pattern:- Agent request → Returns tool calls
- Caller executes → Run the tools in your code
- Provide results → Send results back in next request as assistant message
- Agent responds → Uses tool results to answer
vs Other Endpoints
| Feature | /v1/agent | /v1/conversation | /v1/chat-completion |
|---|---|---|---|
| Tool calling | ✅ Yes (caller-executed) | ❌ No | ✅ Yes (auto-executed) |
| Reasoning | ✅ Advanced | ⚠️ Basic | ✅ Configurable |
| Model | Kimi K2 Thinking | DeepSeek v3.1 | Configurable |
| Best for | Tool use + reasoning | Fast conversations | Full agentic |
Next steps
- Auto-executing tools: Chat Completion
- Simple conversations: Conversation
- Available models: Models
Body
application/json
Conversation history with user and assistant messages
Minimum length:
1List of tool definitions available to the agent
Minimum length:
1System prompt to guide the agent. Defaults to 'You are a helpful assistant with access to tools.'
Enable streaming response via Server-Sent Events