Wild West API

Use LangChain with an uncensored LLM API

LangChain's ChatOpenAI class accepts a base_url, so it can drive any OpenAI-compatible server. That gives you chains, agents and LangGraph on top of an uncensored model, with no change to how you write the rest of the app. Everything below runs from a server or a script.

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 the integration with pip install -U langchain-openai.
  3. Export WILDWEST_API_KEY.
  4. Create ChatOpenAI with model outlaw-1, base_url https://wildwestapi.com/v1 and the key as api_key.
  5. Call invoke, or pass the model to a chain or agent.

A working call

import os
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="outlaw-1",
    base_url="https://wildwestapi.com/v1",
    api_key=os.environ["WILDWEST_API_KEY"],
    temperature=0.9,
)

print(llm.invoke("Write the opening of a noir story.").content)

The docs say the explicit base_url (or openai_api_base) argument wins. After that LangChain checks OPENAI_API_BASE, then the SDK reads OPENAI_BASE_URL. Stray environment variables can therefore redirect a client you thought was fixed, so pass the argument.

Tool calling and streaming

Attach tools with llm.bind_tools([...]), passing Pydantic classes, dict schemas or LangChain tools. Streaming works through llm.stream(...). Token usage is not streamed by default; LangChain notes that many non-OpenAI endpoints do not support it, and you can switch it on with stream_usage=True if the endpoint answers it. Leave it off if you see errors.

One limit to know

LangChain's own docs warn that ChatOpenAI targets the official OpenAI spec and does not extract non-standard fields from third-party providers, such as reasoning_content. If a model returns reasoning in such a field, you will not see it through this class. The final answer text is unaffected.

FAQ

Which LangChain class should I use?

ChatOpenAI from the langchain-openai package, with base_url set. There is no Wild West specific package.

Does it work inside LangGraph agents?

Any agent that accepts a chat model can take this ChatOpenAI instance. Tool calling needs a model that supports tools, which most Wild West models do.

Why does my usage tracking show zero tokens when streaming?

LangChain leaves streamed usage off by default. Set stream_usage=True, or read usage from the non-streaming response.

Related

Uncensored AI models on one key

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