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." }] }'stream = client.chat.completions.create( model="flash", messages=[{"role": "user", "content": "Count to five."}], stream=True,)for chunk in stream: if chunk.choices and chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="")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.
Long requests
Section titled “Long requests”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.