Streaming API — Server-Sent Events (SSE)

Stream AI responses token-by-token in real time. SSE format, error handling, and production-ready code examples for Python and Node.js. TokenMix is an OpenAI-compatible AI API relay using Base URL https://api.tokenmix.ai/v1.

TokenMix API endpoint

  • Base URL: https://api.tokenmix.ai/v1
  • Use one TokenMix API key to call the current supported model catalog.
  • OpenAI SDK compatible; usually only base_url needs to change.
curl https://api.tokenmix.ai/v1/chat/completions \  -H "Authorization: Bearer $TOKENMIX_API_KEY" \  -H "Content-Type: application/json" \  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'

Back to documentation