Wild West API

Use the OpenAI Node SDK with an uncensored LLM API

The openai package for Node and TypeScript accepts a baseURL option, so pointing it at Wild West is a two-field change. Run it on a server or in a script, not in browser code.

Works with Wild West API.

Set it up

  1. Sign in at wildwestapi.com/signup/ with the six-digit code sent to your email, open the dashboard and create an API key. It starts with sk-ww- and is shown in full once, so copy it somewhere safe.
  2. Install with npm install openai.
  3. Put WILDWEST_API_KEY in your environment or a .env file loaded by your runtime.
  4. Construct new OpenAI with baseURL set to https://wildwestapi.com/v1 and apiKey read from process.env.
  5. Call client.chat.completions.create with model outlaw-1.

A working call

The SDK source declares baseURL and apiKey as client options. If you leave them out it falls back to process.env['OPENAI_BASE_URL'] and process.env['OPENAI_API_KEY'].

import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://wildwestapi.com/v1',
  apiKey: process.env.WILDWEST_API_KEY,
});

const resp = await client.chat.completions.create({
  model: 'outlaw-1',
  messages: [{ role: 'user', content: 'Write the opening of a noir story.' }],
});
console.log(resp.choices[0].message.content);

Streaming

Add stream: true and iterate with for await. Each chunk carries a delta.

const stream = await client.chat.completions.create({
  model: 'outlaw-1',
  messages: [{ role: 'user', content: 'Tell me a short ghost story.' }],
  stream: true,
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}

Tools and Next.js

Tool calling goes through the usual tools array. In a Next.js or Express app, create the client inside a route handler or server action so the key never ships to the browser. If you use the Vercel AI SDK on top, see the separate page for it.

One limit to know

Do not construct this client in front-end code. Besides leaking the key, a browser request to wildwestapi.com is blocked because the API does not allow cross-origin calls. Proxy through your own backend route.

FAQ

Does the SDK read OPENAI_BASE_URL on its own?

Yes. The client source reads OPENAI_BASE_URL and OPENAI_API_KEY when baseURL and apiKey are not passed. The README does not mention the base URL variable, so the explicit option is the safer choice.

Can I use the Responses API method?

No. The gateway documents the Chat Completions path, so use client.chat.completions.create rather than client.responses.create.

Related

Uncensored AI models on one key

OpenAI and Anthropic compatible, pay as you go. New to it? Start with uncensored AI, explained.