POST/v1/messagesUpdated
Messages API for abliterated models
POST /v1/messages is Anthropic's format, the one Claude Code and the Anthropic SDKs speak. It reaches the same models, prices and limits as Chat Completions.
https://api.silkcompute.com
import os
from anthropic import Anthropic
client = Anthropic(
base_url="https://api.silkcompute.com",
api_key=os.environ["SILK_API_KEY"],
)
message = client.messages.create(
model="deepseek-v4.1-flash-1017-uncensored",
max_tokens=2048,
messages=[{"role": "user", "content": "What is a mutex?"}],
)
print(message.content[0].text)Example response
{
"type": "message",
"role": "assistant",
"model": "deepseek-v4.1-flash-1017-uncensored",
"content": [
{"type": "text", "text": "A lock only one thread can hold at a time."}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 16,
"output_tokens": 21,
"cache_read_input_tokens": 0
}
}import Anthropic from '@anthropic-ai/sdk'
const client = new Anthropic({
baseURL: 'https://api.silkcompute.com',
apiKey: process.env.SILK_API_KEY,
})
const message = await client.messages.create({
model: 'deepseek-v4.1-flash-1017-uncensored',
max_tokens: 2048,
messages: [{ role: 'user', content: 'What is a mutex?' }],
})
console.log(message.content)Example response
{
"type": "message",
"role": "assistant",
"model": "deepseek-v4.1-flash-1017-uncensored",
"content": [
{"type": "text", "text": "A lock only one thread can hold at a time."}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 16,
"output_tokens": 21,
"cache_read_input_tokens": 0
}
}curl https://api.silkcompute.com/v1/messages \
-H "x-api-key: $SILK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017-uncensored",
"max_tokens": 2048,
"messages": [
{"role": "user", "content": "What is a mutex?"}
]
}'Example response
{
"type": "message",
"role": "assistant",
"model": "deepseek-v4.1-flash-1017-uncensored",
"content": [
{"type": "text", "text": "A lock only one thread can hold at a time."}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 16,
"output_tokens": 21,
"cache_read_input_tokens": 0
}
}message = client.messages.create(
model="deepseek-v4.1-flash-1017-uncensored",
max_tokens=16000,
thinking={"type": "enabled", "budget_tokens": 8192},
output_config={"effort": "high"},
messages=[{"role": "user", "content": "Find the race condition in this function."}],
)const message = await client.messages.create({
model: 'deepseek-v4.1-flash-1017-uncensored',
max_tokens: 16000,
thinking: { type: 'enabled', budget_tokens: 8192 },
output_config: { effort: 'high' },
messages: [{ role: 'user', content: 'Find the race condition in this function.' }],
})curl https://api.silkcompute.com/v1/messages \
-H "x-api-key: $SILK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017-uncensored",
"max_tokens": 16000,
"thinking": {"type": "enabled", "budget_tokens": 8192},
"output_config": {"effort": "high"},
"messages": [
{"role": "user", "content": "Find the race condition in this function."}
]
}'How it works
ThinkingOnly when thinking is onThe thinking comes back in
thinking blocks. output_config.effort or budget_tokens sets how much.What differsNo video, PDFs or server toolsVideo returns 400. PDFs, token counting and server tools such as web search are not available.
Caching and errorsAutomatic cachingNo cache_control markers needed. Errors use Anthropic's shape with the same status codes.Parameters
| Parameter | Type | Required | What it does |
|---|---|---|---|
model | string | A model id from the model list. More | |
max_tokens | integer | Caps the reply, thinking included. More | |
messages | array | The conversation. Images go in as base64 image blocks. Video returns a 400. More | |
thinking | object | Turn thinking on. Without it the model thinks as little as it can. More | |
output_config.effort | string | low, high or max. More | |
tools | array | Tools the model may call with tool_use blocks. More | |
stream | boolean | Streams the reply as events. More |
Thinking budget
A budget maps to an effort level.
| budget_tokens | Runs as |
|---|---|
| Under 8,192 | low |
| 8,192 to 32,767 | high |
| 32,768 or more | max |