Documentation
Send your first request in under a minute. Works with any OpenAI or Anthropic SDK — just point it at the base URL.
npm install openaiUse the OpenAI SDK against /chat/completions, or the Anthropic SDK against /messages — same key, same base URL.
import OpenAI from "openai";
// InferDock works with any OpenAI or Anthropic SDK — just point it at our base URL.
const client = new OpenAI({
apiKey: process.env.INFERDOCK_API_KEY,
baseURL: "https://api.inferdock.xyz/v1",
});
const res = await client.chat.completions.create({
model: "claude-sonnet-4-6",
messages: [{ role: "user", content: "Hello" }],
});
console.log(res.choices[0].message.content);import Anthropic from "@anthropic-ai/sdk";
// Prefer the Anthropic SDK? Point it at the same base URL.
const client = new Anthropic({
apiKey: process.env.INFERDOCK_API_KEY, // sent as x-api-key
baseURL: "https://api.inferdock.xyz",
});
const msg = await client.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello" }],
});
console.log(msg.content[0].text);curl https://api.inferdock.xyz/v1/chat/completions \
-H "Authorization: Bearer $INFERDOCK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [{ "role": "user", "content": "Hello" }]
}'Every Claude model accepts the same request shape. Change one field to switch models — nothing else.
// Same code, different model — just change the string.
{ "model": "claude-opus-4-8" }
{ "model": "claude-sonnet-4-6" }
{ "model": "claude-haiku-4-5" }