Updated
Streaming an abliterated LLM API
Set stream to true and the API sends server-sent events as the model writes. Thinking arrives in delta.reasoning_content, the answer in delta.content, and the stream ends with [DONE].
https://api.silkcompute.com
stream = client.chat.completions.create(
model="deepseek-v4.1-flash-1017-uncensored",
messages=[{"role": "user", "content": "Write a commit message for a typo fix."}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
if chunk.usage:
print("\n", chunk.usage)Example events
data: {"choices":[{"index":0,"delta":{"reasoning_content":"Short, imperative."}}]}
data: {"choices":[{"index":0,"delta":{"content":"Fix typo"}}]}
data: {"choices":[{"index":0,"delta":{"content":" in README"}}]}
data: {"choices":[],"usage":{"prompt_tokens":18,"completion_tokens":40}}
data: [DONE]const stream = await client.chat.completions.create({
model: 'deepseek-v4.1-flash-1017-uncensored',
messages: [{ role: 'user', content: 'Write a commit message for a typo fix.' }],
stream: true,
stream_options: { include_usage: true },
})
for await (const chunk of stream) {
const text = chunk.choices[0]?.delta?.content
if (text) process.stdout.write(text)
if (chunk.usage) console.log('\n', chunk.usage)
}Example events
data: {"choices":[{"index":0,"delta":{"reasoning_content":"Short, imperative."}}]}
data: {"choices":[{"index":0,"delta":{"content":"Fix typo"}}]}
data: {"choices":[{"index":0,"delta":{"content":" in README"}}]}
data: {"choices":[],"usage":{"prompt_tokens":18,"completion_tokens":40}}
data: [DONE]curl -N https://api.silkcompute.com/chat/completions \
-H "Authorization: Bearer $SILK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017-uncensored",
"stream": true,
"stream_options": {"include_usage": true},
"messages": [
{"role": "user", "content": "Write a commit message for a typo fix."}
]
}'Example events
data: {"choices":[{"index":0,"delta":{"reasoning_content":"Short, imperative."}}]}
data: {"choices":[{"index":0,"delta":{"content":"Fix typo"}}]}
data: {"choices":[{"index":0,"delta":{"content":" in README"}}]}
data: {"choices":[],"usage":{"prompt_tokens":18,"completion_tokens":40}}
data: [DONE]stream := client.Chat.Completions.NewStreaming(context.TODO(), openai.ChatCompletionNewParams{
Model: "deepseek-v4.1-flash-1017-uncensored",
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Write a commit message for a typo fix."),
},
})
defer stream.Close()
for stream.Next() {
chunk := stream.Current()
if len(chunk.Choices) > 0 {
fmt.Print(chunk.Choices[0].Delta.Content)
}
}
if err := stream.Err(); err != nil {
panic(err)
}Example events
data: {"choices":[{"index":0,"delta":{"reasoning_content":"Short, imperative."}}]}
data: {"choices":[{"index":0,"delta":{"content":"Fix typo"}}]}
data: {"choices":[{"index":0,"delta":{"content":" in README"}}]}
data: {"choices":[],"usage":{"prompt_tokens":18,"completion_tokens":40}}
data: [DONE]How it works
OrderThinking, then the answerThinking pieces arrive in
delta.reasoning_content before the answer starts in delta.content.UsageCounted in the last chunkSet
stream_options.include_usage to get token counts at the end.FormatsEvery format streamsMessages and Responses stream too, with
stream: true and their own event shapes.What each chunk carries
| Field | Holds |
|---|---|
choices[0].delta.reasoning_content | A piece of the thinking |
choices[0].delta.content | A piece of the answer |
usage | Token counts, in the last chunk with include_usage |
data: [DONE] | End of stream |