Using the API
SDKs
There is no Openbase SDK to install. Anything that speaks the OpenAI Chat Completions API works once you change the base URL.
Python
pip install openaifrom openai import OpenAI
client = OpenAI(
base_url="https://api.openbase.ai/v1",
api_key=os.environ["OPENBASE_API_KEY"],
)Node and TypeScript
npm install openaiimport OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.openbase.ai/v1",
apiKey: process.env.OPENBASE_API_KEY,
});Vercel AI SDK
Use the OpenAI-compatible provider factory and point it at the gateway. Streaming, tool calls and structured output all behave as they would against OpenAI directly.
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { streamText } from "ai";
const openbase = createOpenAICompatible({
name: "openbase",
baseURL: "https://api.openbase.ai/v1",
apiKey: process.env.OPENBASE_API_KEY,
});
const result = streamText({
model: openbase("anthropic/claude-sonnet-5"),
prompt: "Explain failover in one paragraph.",
});LangChain
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="deepseek/deepseek-v4-pro",
base_url="https://api.openbase.ai/v1",
api_key=os.environ["OPENBASE_API_KEY"],
)LlamaIndex
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(
model="google/gemini-3.1-pro",
api_base="https://api.openbase.ai/v1",
api_key=os.environ["OPENBASE_API_KEY"],
is_chat_model=True,
)Model names are not validated locally
Some frameworks keep an allowlist of known OpenAI model names and reject anything else before a request is sent. Where that happens, use the library's generic or "openai-like" class, as shown above, so the slug reaches the gateway untouched.
Anything else
If a tool lets you set a base URL and an API key, it will work. Set them to https://api.openbase.ai/v1 and your Openbase key.