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

Parameters

ParameterTypeRequiredWhat it does
modelstringA model id from the model list. More
messagesarrayThe conversation so far. Image parts go in as base64 image_url, and video as video_url. More
reasoning_effortstringnone, low, high or max. Other names map to the nearest level. More
max_tokensintegerCaps the reply, thinking included. If thinking uses it up, the reply is empty. More
streambooleanSends server-sent events as the model writes, ending with [DONE]. More
stream_options.include_usagebooleanAdds token usage to the last chunk. More
toolsarrayFunction definitions the model may call. More

The reply

FieldHolds
choices[0].message.contentThe answer
choices[0].message.reasoning_contentThe thinking
choices[0].message.tool_callsFunctions the model wants run
choices[0].finish_reasonlength means max_tokens ran out
usage.prompt_tokens_details.cached_tokensInput billed at the cached rate