Claude Agent SDK (TypeScript) on Wild West API
The TypeScript Claude Agent SDK starts the Claude Code binary under the hood, so it takes the same environment variables. There is no base-URL option on the SDK itself; you pass the environment through the query options.
- Base URL
- https://wildwestapi.com
- API key
- Get one free, starts sk-ww-
- Example model
- outlaw-1-xploded
Pass the environment through options.env
The SDK has no gateway-specific option. Its options.env replaces the child process environment, so spread process.env and add the Anthropic variables:
TypeScript
// npm install @anthropic-ai/claude-agent-sdk import { query } from "@anthropic-ai/claude-agent-sdk"; for await (const message of query({ prompt: "List the files in this repo", options: { env: { ...process.env, ANTHROPIC_BASE_URL: "https://wildwestapi.com", ANTHROPIC_AUTH_TOKEN: process.env.WILDWEST_API_KEY, ANTHROPIC_MODEL: "outlaw-1-xploded", }, }, })) { console.log(message); }
Set WILDWEST_API_KEY in your own environment to a key from /chat. Every caveat from the Claude Code guide applies, including the tool-calling requirement.