K31 / API
Kimi K31 Pro API guide
Use your account API key to call Kimi K31 Pro from your own application. Browser playground and API calls share a credit balance.
- Sign in with Google, then create an API key in account settings.
- Send your model ID and messages to the endpoint below. Keep stream set to false.
- For images use image_url; for audio use input_audio with raw base64 data and a format. Audio is transcribed before Kimi inference and included in billing.
- Read usage and credits_used in the response. The service reserves credits before inference, settles actual usage and releases unused credits.
curl https://k31.pro/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "moonshotai/kimi-k3.1-pro",
"messages": [
{
"role": "user",
"content": "Explain this idea clearly."
}
],
"max_completion_tokens": 64,
"stream": false
}'Request limits
Up to 40 messages, 256 KiB text, 8 embedded files, 4 MiB per file and 8 MiB total. Responses are capped at 8,192 tokens. A 64-token response limit is the playground default; increase it for longer answers.
Audio is transcribed before Kimi inference. Transcription costs are included in billing.
Explore model details