Anthropic SDK로 Kimi API 빠르게 시작하기
Kimi는 unified router에서 Anthropic Messages protocol을 사용합니다. 기존 Anthropic client에는 custom base URL, apiToken.sale 키, 명시적 kimi/* model ID만 필요합니다.
·
curl로 첫 요청
The fastest path to a first Kimi response is a single POST to https://router.apitoken.sale/v1/messages with your apiToken.sale key in the x-api-key header and a kimi/* model ID in the body. There is no new SDK and no adapter layer — the endpoint speaks the Anthropic Messages protocol, so any client that already talks to Claude can talk to Kimi. Usage settles against the same prepaid balance as your Claude, GPT and Gemini traffic.
terminal usage가 Anthropic 형식이므로 기존 usage parser를 그대로 사용할 수 있습니다. route는 stream: true를 받지만 provider boundary의 증분성은 아직 live 검증 중입니다.
함께 보기: Kimi API 키 구매 방법
Anthropic Python SDK 사용
Because the wire protocol is Anthropic Messages, the official Anthropic Python SDK works unmodified. Two constructor arguments switch it over: api_key reads your key from the environment, and base_url points the client at the router. Keep the key in a server-side environment variable — never in client-side code or a committed file.
kimi-k2.7-code 같은 Open Platform ID로 바꾸지 마세요. public router는 GET /v1/models의 subscription alias를 받으며 OpenAI 호환 client도 unified /v1 route에서 같은 Kimi alias를 호출합니다.
자주 묻는 질문
Anthropic SDK로 Kimi를 호출할 수 있나요?
네. base_url을 https://router.apitoken.sale로 설정하고 key-scoped catalog의 kimi/* model ID를 선택하세요.
Kimi route에 stream: true를 설정할 수 있나요?
route는 이 parameter를 받지만 upstream과 public chunk의 증분성은 아직 live 검증 중입니다. chunk 도착 timing이 중요하면 non-stream mode를 사용하세요.
어떤 model ID로 시작해야 하나요?
coding 기본값은 kimi/kimi-for-coding, full 1M 없이 K3 reasoning이 필요하면 kimi/k3-256k가 적합합니다.