Updated
Abliterated API in JavaScript and TypeScript
To call an abliterated model from Node, Bun or Deno, install the openai package and pass baseURL to the client. The TypeScript version is the same call with types.
- 1
Install the SDK
Any of these package managers works.
npmnpm install openaipnpmpnpm add openaibunbun add openai - 2
Set your key
Create a key on Silk Compute's API keys page and add credits from $5. Keep it in an environment variable. Keep the key on the server, and never ship it to a browser.
Shellexport SILK_API_KEY="sk-..." - 3
Run it
Save the program below and run it with Node, Bun or Deno.
Nodenode chat.mjs
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 output
A lock only one thread can hold at a time.import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://api.silkcompute.com',
apiKey: process.env.SILK_API_KEY,
})
export async function ask(prompt: string): Promise<string> {
const reply = await client.chat.completions.create({
model: 'deepseek-v4.1-flash-1017-uncensored',
messages: [{ role: 'user', content: prompt }],
})
return reply.choices[0].message.content ?? ''
}
console.log(await ask('What is a mutex?'))Example output
A lock only one thread can hold at a time.