SkillRouter
Documentation menu

Start

Node and TypeScript

Call SkillRouter from a server-side Node application.

Install and send

Shell
npm install openai
export SKILLROUTER_API_KEY=sr_test_your_key
TypeScript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.SKILLROUTER_API_KEY,
  baseURL: "https://api.useskillrouter.com/v1",
});

const response = await client.chat.completions.create({
  model: "anthropic/claude-sonnet",
  messages: [{ role: "user", content: "Audit this page for SEO." }],
  skill: "seo-audit",
} as OpenAI.Chat.Completions.ChatCompletionCreateParamsNonStreaming & {
  skill: string;
});

console.log(response.choices[0]?.message.content);

Skill field typing

The OpenAI client does not define the SkillRouter skill extension. Use extra_body where the SDK supports it, or extend the request type locally as shown. Do not replace the client with an untyped request wrapper.