Skip to content
API referenceDashboard

Streaming

Receive tokens as server-sent events.

Set "stream": true on any endpoint. The response is text/event-stream in that endpoint’s native event format, so SDK stream helpers work unchanged.

curl https://api.solcardinference.ai/v1/chat/completions \
-H "Authorization: Bearer $SOLCARD_INFERENCE_KEY" \
-H "Content-Type: application/json" \
-N -d '{ "model": "flash", "stream": true, "messages": [{ "role": "user", "content": "Count to five." }] }'

On Chat Completions, set "stream_options": { "include_usage": true } to get a final chunk with token usage.

Lines starting with : are SSE comments (keep-alives and progress markers). SSE parsers ignore them.

Non-streaming requests that run longer than 30 seconds receive leading whitespace every 20 seconds to keep the connection open; the JSON body that follows is still valid. Requests time out after 9 minutes with 504 upstream_timeout.