NewPoint any agent at UberLLM — one key, every model, list price or less.

Use the OpenAI Python SDK and LangChain with a cheaper API (UberLLM)

Set base_url="https://api.uberllm.dev/v1" and api_key to your UberLLM key in OpenAI(...) or ChatOpenAI(...), then pass any UberLLM model id. Chat, streaming, tool calls and JSON output keep working; your other code stays the same.

Steps (OpenAI Python SDK)

  1. Make a key on your keys page and add credit.
  2. Save it as an environment variable:
export UBERLLM_API_KEY=ull_your_key
  1. Point the client at UberLLM:
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.uberllm.dev/v1",
    api_key=os.environ["UBERLLM_API_KEY"],
)

resp = client.chat.completions.create(
    model="deepseek/deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Give me three names for a coffee shop."}],
)
print(resp.choices[0].message.content)

That is the whole change. client.chat.completions.create with stream=True, tools, response_format, temperature and max_tokens works as before. The async client (AsyncOpenAI) takes the same two arguments.

Without touching the code

The OpenAI SDK also reads two environment variables, so a script that calls OpenAI() with no arguments can be moved without editing it:

export OPENAI_BASE_URL=https://api.uberllm.dev/v1
export OPENAI_API_KEY=ull_your_key
python your_script.py

You still need to change the model= string to an UberLLM id such as deepseek/deepseek-v4.1-flash.

Steps (LangChain)

pip install langchain-openai
import os
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="deepseek/deepseek-v4.1-flash",
    base_url="https://api.uberllm.dev/v1",
    api_key=os.environ["UBERLLM_API_KEY"],
)
print(llm.invoke("Say hello in one sentence.").content)

Chains, agents, bind_tools and .stream() work unchanged. Pass base_url in code rather than relying on environment variables: the argument always wins, so a stray OPENAI_API_BASE on the machine cannot send calls elsewhere.

LangChain.js is the same idea:

import { ChatOpenAI } from "@langchain/openai";

const llm = new ChatOpenAI({
  model: "deepseek/deepseek-v4.1-flash",
  apiKey: process.env.UBERLLM_API_KEY,
  configuration: { baseURL: "https://api.uberllm.dev/v1" },
});

Pick a cheaper model for each job

The point of one key for every model is that you can stop paying frontier prices for easy work. A common split:

  • Hard reasoning or customer-facing answers: a top model such as deepseek/deepseek-v4.1-flash.
  • Bulk summaries, tagging, extraction: google/gemma-3-27b-it or another model from the batch table below, often 50 to 100 times cheaper per token.

Change only the model= string to move a step from one to the other.

What is not there

UberLLM serves chat completions (/v1/chat/completions), the Responses API (client.responses.create, streaming and tool calls included) and the Anthropic messages route. It keeps no state between calls, so send the whole conversation in input instead of previous_response_id (Responses API reference). It does not serve embeddings or the Assistants API: keep those calls on their current provider.

Troubleshooting

  • openai.AuthenticationError (401): the key is wrong or empty. Print len(os.environ["UBERLLM_API_KEY"]); a key is ull_ plus 43 characters.
  • openai.NotFoundError (404) on /responses or /embeddings: those routes do not exist here, see above.
  • model_not_found: OpenAI-style ids like gpt-4o need the maker in front: openai/gpt-4o.
  • openai.RateLimitError (429): the key's per-minute limit (300 by default). Raise it on the keys page, or add retries with backoff.
  • 402 insufficient_credits: top up on the credits page.

Keep reading

Models to start with

The first one is in the code below. Each takes tool calls.

ModelModel id (paste this)Price now
DeepSeek V4.1 Flashdeepseek/deepseek-v4.1-flash$0.0070 in · $0.0783 out / 1M
Gemini 3.5 Flashgoogle/gemini-3.5-flash$0.0592 in · $0.3555 out / 1M
Claude Sonnet 5.5anthropic/claude-sonnet-5.5$0.7610 in · $3.80 out / 1M
GPT-5.5openai/gpt-5.5$0.9625 in · $5.78 out / 1M
Kimi K3moonshotai/kimi-k3$0.0032 in · $0.2475 out / 1M
GLM 5.3z-ai/glm-5.3$0.0023 in · $0.0469 out / 1M
Gemma 3 27Bgoogle/gemma-3-27b-it$0.0188 in · $0.0471 out / 1M
Qwen3 VL 235B A22Bqwen/qwen3-vl-235b-a22b-instruct$0.0022 in · $0.0199 out / 1M

Prices at the last hourly build, no fee added · every model →

For big batch jobs

Lowest price per token for summarising, tagging and extraction at volume.

ModelModel id (paste this)Price now
Gemma 3 27Bgoogle/gemma-3-27b-it$0.0188 in · $0.0471 out / 1M
GPT-OSS 120Bopenai/gpt-oss-120b$0.00014 in · $0.00060 out / 1M
DeepSeek V3.2deepseek/deepseek-v3.2$0.0026 in · $0.0038 out / 1M
Qwen 3 235B A22B Instruct 2507qwen/qwen3-235b-a22b-2507$0.00057 in · $0.0035 out / 1M
Gemini 3.1 Flash Litegoogle/gemini-3.1-flash-lite$0.0368 in · $0.2205 out / 1M
DeepSeek V4.1 Flashdeepseek/deepseek-v4.1-flash$0.0070 in · $0.0783 out / 1M

Prices at the last hourly build, no fee added · every model →

FAQ

Can I use the official OpenAI Python SDK with UberLLM?

Yes. Pass base_url="https://api.uberllm.dev/v1" and your UberLLM key to OpenAI(), or set OPENAI_BASE_URL and OPENAI_API_KEY. chat.completions with streaming, tools and JSON output works for every chat model.

Does LangChain work with UberLLM?

Yes. ChatOpenAI from langchain-openai takes base_url and api_key; chains, agents and tool binding work unchanged against any UberLLM chat model.

Does UberLLM support embeddings or the Responses API?

The Responses API yes, embeddings no. UberLLM serves /v1/chat/completions, /v1/responses (client.responses.create, without previous_response_id: send the whole conversation each call) and the Anthropic /v1/messages route. Keep embeddings on their current provider.