POST/chat/completionsUpdated
Chat Completions API for abliterated models
POST /chat/completions takes a model id and a messages array and returns the reply, its thinking and token usage. It is OpenAI's format, so any OpenAI SDK works after a base URL change.
https://api.silkcompute.com
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.silkcompute.com",
api_key=os.environ["SILK_API_KEY"],
)
reply = client.chat.completions.create(
model="deepseek-v4.1-flash-1017-uncensored",
messages=[{"role": "user", "content": "What is a mutex?"}],
)
print(reply.choices[0].message.content)Example response
{
"object": "chat.completion",
"model": "deepseek-v4.1-flash-1017-uncensored",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"reasoning_content": "Define it in one line.",
"content": "A lock only one thread can hold at a time."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 16,
"completion_tokens": 48,
"prompt_tokens_details": {"cached_tokens": 0}
}
}import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://api.silkcompute.com',
apiKey: process.env.SILK_API_KEY,
})
const reply = await client.chat.completions.create({
model: 'deepseek-v4.1-flash-1017-uncensored',
messages: [{ role: 'user', content: 'What is a mutex?' }],
})
console.log(reply.choices[0].message.content)Example response
{
"object": "chat.completion",
"model": "deepseek-v4.1-flash-1017-uncensored",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"reasoning_content": "Define it in one line.",
"content": "A lock only one thread can hold at a time."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 16,
"completion_tokens": 48,
"prompt_tokens_details": {"cached_tokens": 0}
}
}curl 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",
"messages": [
{"role": "user", "content": "What is a mutex?"}
]
}'Example response
{
"object": "chat.completion",
"model": "deepseek-v4.1-flash-1017-uncensored",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"reasoning_content": "Define it in one line.",
"content": "A lock only one thread can hold at a time."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 16,
"completion_tokens": 48,
"prompt_tokens_details": {"cached_tokens": 0}
}
}package main
import (
"context"
"fmt"
"os"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
)
func main() {
client := openai.NewClient(
option.WithBaseURL("https://api.silkcompute.com"),
option.WithAPIKey(os.Getenv("SILK_API_KEY")),
)
reply, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
Model: "deepseek-v4.1-flash-1017-uncensored",
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("What is a mutex?"),
},
})
if err != nil {
panic(err)
}
fmt.Println(reply.Choices[0].Message.Content)
}Example response
{
"object": "chat.completion",
"model": "deepseek-v4.1-flash-1017-uncensored",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"reasoning_content": "Define it in one line.",
"content": "A lock only one thread can hold at a time."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 16,
"completion_tokens": 48,
"prompt_tokens_details": {"cached_tokens": 0}
}
}How it works
The replyAnswer and thinking apart
Toolstool_calls outmessage.content holds the answer and message.reasoning_content the thinking.message.tool_calls lists the functions the model wants run.StreamingDeltas until [DONE]Chunks carry delta.reasoning_content and delta.content, and the stream ends with [DONE].Parameters
| Parameter | Type | Required | What it does |
|---|---|---|---|
model | string | A model id from the model list. More | |
messages | array | The conversation so far. Image parts go in as base64 image_url, and video as video_url. More | |
reasoning_effort | string | none, low, high or max. Other names map to the nearest level. More | |
max_tokens | integer | Caps the reply, thinking included. If thinking uses it up, the reply is empty. More | |
stream | boolean | Sends server-sent events as the model writes, ending with [DONE]. More | |
stream_options.include_usage | boolean | Adds token usage to the last chunk. More | |
tools | array | Function definitions the model may call. More |
The reply
| Field | Holds |
|---|---|
choices[0].message.content | The answer |
choices[0].message.reasoning_content | The thinking |
choices[0].message.tool_calls | Functions the model wants run |
choices[0].finish_reason | length means max_tokens ran out |
usage.prompt_tokens_details.cached_tokens | Input billed at the cached rate |