How-toUpdated November 18, 2026

Switch from the OpenAI API to a private AI API

To switch from the OpenAI API to a private AI API, change the base URL, API key and model name, since most accept the OpenAI format.

Silk Compute does not store your prompts or model outputs.

Python, with the OpenAI SDK

from openai import OpenAI

client = OpenAI(
    base_url="https://api.silkcompute.com",
    api_key="YOUR_SILK_COMPUTE_KEY",
)
reply = client.chat.completions.create(
    model="deepseek-v4.1-flash-1017-uncensored",
    messages=[{"role": "user", "content": "Summarize this contract."}],
)
print(reply.choices[0].message.content)

The same two lines work for any OpenAI-compatible API.

Node, with the OpenAI SDK

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.silkcompute.com",
  apiKey: process.env.SILK_COMPUTE_KEY,
});
const reply = await client.chat.completions.create({
  model: "glm-5.3-uncensored",
  messages: [{ role: "user", content: "Review this diff." }],
});

curl

curl https://api.silkcompute.com/chat/completions \
  -H "Authorization: Bearer $SILK_COMPUTE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "kimi-k3.1-pro-uncensored", "messages": [{"role": "user", "content": "Hello"}]}'

Anthropic SDK and Claude Code

Silk Compute also takes the Anthropic Messages format, so Claude Code works with three environment variables.

export ANTHROPIC_BASE_URL=https://api.silkcompute.com
export ANTHROPIC_AUTH_TOKEN=YOUR_SILK_COMPUTE_KEY
export ANTHROPIC_MODEL=kimi-k3.1-pro-uncensored
claude

Silk Compute has guides for Claude Code, Codex, OpenCode and Cursor.

Pick a model

ModelModel idContextPrice per 1M (in / out)
Kimi K3.1 Prokimi-k3.1-pro-uncensored1,048,576$3.00 / $8.00
DeepSeek V4.1 Flash 1017deepseek-v4.1-flash-1017-uncensored1,048,576$0.24 / $0.90
DeepSeek V4.1 Flash 1017 Fastdeepseek-v4.1-flash-1017-fast-uncensored1,048,576$0.24 / $0.90
GLM-5.3glm-5.3-uncensored1,048,576$2.00 / $4.00
GLM-5.3 Flashglm-5.3-flash-uncensored1,048,576$0.24 / $1.00
Hy4hy4-uncensored1,048,576$1.60 / $3.20

Kimi K3.1 Pro is the strongest for security research and agentic coding, and DeepSeek V4.1 Flash 1017 has the lowest blended price. Prices read November 18, 2026.

What to change in your app

  • Assistants, threads and vector stores have no stateless equivalent, so send the full conversation each time.
  • Silk Compute's /responses endpoint is stateless, so pass the full input instead of a previous response id.
  • Swap GPT model ids for the ids above, and raise max_tokens for Hy4, which thinks for thousands of tokens first.
  • Your proxy, tracing tool and error reporter still record prompts. See the checklist.

Sign up at platform.silkcompute.com, and the quickstart has the rest.