Kimi AI by Moonshot AI provides advanced multimodal reasoning models with up to 256K context windows. Use Kimi K2.5 and other models through the OpenAI-compatible Chat Completions API with Vision Agents.
Installation
uv add vision-agents[openai]
Quick Start
from vision_agents.core import Agent, User
from vision_agents.plugins import openai, getstream, deepgram, elevenlabs
agent = Agent(
edge=getstream.Edge(),
agent_user=User(name="Assistant", id="agent"),
instructions="You are a helpful assistant.",
llm=openai.ChatCompletionsLLM(
model="kimi-k2.5-preview",
base_url="https://api.moonshot.ai/v1",
api_key="your_moonshot_api_key", # or set MOONSHOT_API_KEY env var
),
stt=deepgram.STT(),
tts=elevenlabs.TTS(),
)
Set MOONSHOT_API_KEY in your environment or pass api_key directly.
Parameters
| Name | Type | Default | Description |
|---|
model | str | — | Model identifier (see available models below) |
api_key | str | None | API key (defaults to MOONSHOT_API_KEY env var) |
base_url | str | "https://api.moonshot.ai/v1" | Kimi API endpoint |
Available Models
| Model | Context | Description |
|---|
kimi-k2.5-preview | 256K | Latest multimodal model with vision and reasoning |
kimi-k2-0711-preview | 128K | 1T parameter MoE model with strong reasoning |
moonshot-v1-8k | 8K | Fast responses for shorter contexts |
moonshot-v1-32k | 32K | Balanced performance and context |
moonshot-v1-128k | 128K | Extended context for long documents |
Moonshot recommends temperature=0.6 for balanced accuracy, or temperature=1.0 for more creative responses.
Function Calling
Kimi K2.5 supports function calling with automatic tool invocation:
@agent.llm.register_function(description="Get weather for a location")
async def get_weather(location: str) -> str:
return f"The weather in {location} is sunny and 72°F"
See the Function Calling guide for details.
Next Steps