Documentation

Quickstart

Send your first request in under a minute. Works with any OpenAI or Anthropic SDK — just point it at the base URL.

1. Install the SDK

bash
npm install openai

2. Make a request

Use the OpenAI SDK against /chat/completions, or the Anthropic SDK against /messages — same key, same base URL.

openai.ts
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);
anthropic.ts
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);

Or use curl

bash
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" }]
  }'

3. Switch models freely

Every Claude model accepts the same request shape. Change one field to switch models — nothing else.

request.json
// Same code, different model — just change the string.
{ "model": "claude-opus-4-8" }
{ "model": "claude-sonnet-4-6" }
{ "model": "claude-haiku-4-5" }