Live endpoint
https://api.minimax.chat/v1/text/chatcompletion_v2
curl https://api.minimax.chat/v1/text/chatcompletion_v2 \
-H "Authorization: Bearer $MINIMAX_API_KEY" \
-d '{
"model": "MiniMax-Text-01",
"messages": [{"role":"user","content":"Hello, 4M context!"}],
"temperature": 0.7,
"max_tokens": 512
}'
Example response
{
"id": "5cff1c5e-d09f-4a7d-9f8c-2f2d6b4c3a1e",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I can help with that. π"
},
"finish_reason": "stop"
}],
"usage": { "total_tokens": 18 }
}
Settings hint
Set the MINIMAX_API_KEY secret in your Space settings and toggle useLiveApi = true at the top of the script to hit the real endpoint. Note: browsers may hit CORS β use the Gradio/curl path for production deployments.