One OpenAI-compatible key for Claude, Gemini, DeepSeek, GLM and Kimi: the base_url swap, and what still differs Alex, who runs the MartLLM gateway, demonstrated that developers can call Claude, Gemini, DeepSeek, GLM and Kimi models through the existing OpenAI SDK by swapping only the base_url and api_key, with model IDs in a maker/model format and a usage.cost_usd field added to every response. The endpoint also translates Anthropic's Messages API, letting tools like Claude Code run on non-Claude models. MartLLM's published pricing table shows live seller prices and seven-day average billed rates running well below list prices for several models. Disclosure: I'm Alex, and I run MartLLM, the endpoint in these examples. The base url pattern works with any OpenAI-compatible gateway. The routing fields near the end are MartLLM's own. Most LLM code in production is written against the OpenAI Python or TypeScript SDK, even when the model isn't OpenAI's. The SDK is good, the wire format is everywhere, and every framework LangChain, LlamaIndex, LiteLLM, the Vercel AI SDK, Pydantic AI can talk to it. So the cheapest way to try Claude, Gemini or DeepSeek in an existing codebase usually isn't a new SDK. It's a different base url . This post shows that swap against one endpoint that serves all of them, then covers the parts that don't carry over cleanly. MartLLM implements the OpenAI Chat Completions API at https://api.martllm.com/v1 . The OpenAI SDK guide https://martllm.com/docs/openai-sdk puts it plainly: set base url and api key , and messages, tools, response format , stream , max tokens and temperature stay the same. python import os from openai import OpenAI client = OpenAI base url="https://api.martllm.com/v1", the trailing /v1 is required api key=os.environ "MARTLLM API KEY" , MODELS = "anthropic/claude-sonnet-5.5", "google/gemini-3.8-flash", "deepseek/deepseek-v4.1-flash", "z-ai/glm-5.3", "moonshotai/kimi-k3", for model in MODELS: resp = client.chat.completions.create model=model, messages= {"role": "user", "content": "In one sentence: what is a vector database?"} , max tokens=120, u = resp.usage cost = getattr u, "cost usd", None MartLLM adds usage.cost usd to every reply print f"{resp.model:32} {u.prompt tokens: 4} in {u.completion tokens: 4} out ${cost}" print " ", resp.choices 0 .message.content.strip :160 Five makers, one client, one loop. Model ids are maker/model . GET /v1/models returns the ones you can call right now, in the OpenAI list shape. TypeScript is the same two settings: python import OpenAI from "openai"; const client = new OpenAI { baseURL: "https://api.martllm.com/v1", apiKey: process.env.MARTLLM API KEY, } ; const resp = await client.chat.completions.create { model: "anthropic/claude-sonnet-5.5", messages: { role: "user", content: "Explain idempotency keys in two sentences." } , } ; console.log resp.choices 0 .message.content ; The same endpoint also speaks Anthropic's Messages API. Note the base URL has no /v1 here, because the SDK adds /v1/messages itself: python from anthropic import Anthropic client = Anthropic base url="https://api.martllm.com", api key=os.environ "MARTLLM API KEY" msg = client.messages.create model="google/gemini-3.8-flash", any catalog model, not only Claude max tokens=256, messages= {"role": "user", "content": "Say hello in one sentence."} , print msg.content 0 .text The gateway translates between the two shapes, streaming included Anthropic SDK guide https://martllm.com/docs/anthropic-sdk . That's also how tools like Claude Code can run on non-Claude models. Read from the public catalog on 2026-11-28 at 03:51 UTC, per million tokens input / output . "List" is the maker's official price. "Cheapest offer now" is the lowest live seller price at that moment. "Paid, last 7 days" is the average buyers were actually billed over the previous week, which is the more honest number for budgeting. | Model | List | Cheapest offer now | Paid, last 7 days | |---|---|---|---| | anthropic/claude-sonnet-5.5 | $2.00 / $10.00 | $1.008 / $5.04 | $1.07 / $5.37 | | google/gemini-3.8-flash | $0.75 / $3.75 | $0.126 / $0.63 | $0.120 / $0.602 | | deepseek/deepseek-v4.1-flash | $0.21 / $0.78 | $0.1345 / $0.4996 | $0.0208 / $0.0771 | | z-ai/glm-5.3 | $1.40 / $4.40 | $0.0243 / $0.0901 | $0.0492 / $0.1827 | | moonshotai/kimi-k3 | $3.00 / $15.00 | $0.2764 / $1.4175 | $0.1064 / $0.5457 | Each request is sent to a third-party provider serving that model and billed what the provider charged, so the price moves with the market. The full board is at martllm.com/llm-api-pricing https://martllm.com/llm-api-pricing . If you need a hard ceiling, set one per request below . Carries over unchanged: messages, system prompts, stream , max tokens , temperature , response format , tool definitions. A reply that calls a tool always ends with finish reason: "tool calls" , whichever provider served it. The reply shape is normalized too. You get the standard fields id , model , choices , usage , and provider-specific extras are stripped, so code that parses resp.choices 0 .message doesn't need per-model branches. Needs care: extra content field, and the model needs it back on the next turn. If you rebuild tool-call messages by hand from only name and arguments , multi-step tool use on Gemini degrades. Append the assistant message you received as is. reasoning and reasoning content , with the same text, so a client that reads either works. Models that don't reason have neither field. Don't assume it exists. 400 rather than a silent drop. Check input modalities in GET /v1/models before you route pictures, audio or files to a model. Of the five models above, the catalog lists Claude Sonnet 5.5, Gemini 3.8 Flash, DeepSeek V4.1 Flash and Kimi K3 as taking images Gemini also takes audio and video . GLM 5.3 is text only. top k , verbosity , thinking and similar are dropped for providers that refuse them instead of failing the call. If your evals depend on one of them, confirm the model supports it supported parameters in the model list . client.responses.create works on every chat model. previous response id and stored conversations need saving turned on for the key. Otherwise send the full conversation each call. These are MartLLM extensions, passed through the OpenAI SDK's extra body details in models and routing https://martllm.com/docs/models-and-routing : resp = client.chat.completions.create model="deepseek/deepseek-v4.1-flash", messages= {"role": "user", "content": "Summarize this ticket: ..."} , extra body={ Tried in order only if nobody can serve the first model right now. "models": "z-ai/glm-5.3", "google/gemini-3.8-flash" , Never pay more than this per million tokens; refused and free if nobody sells that low. "provider": {"max price": {"prompt": 0.5, "completion": 1.5}}, }, print resp.model the model that actually answered models provider.max price prompt and completion set, the request is never billed above those rates for the tokens it used. If no provider sells that low right now, you get 400 max price exceeded and pay nothing. One OpenAI-compatible key is a good fit when you want to compare models on your own prompts, keep one code path, and pay one prepaid balance. It's a worse fit when you need a maker's newest feature on day one, if it only exists in their native SDK, or when a contract requires you to buy from the maker directly. In those cases, keep the native SDK for that one model and route everything else through the shared client. For everything in between, the change really is two lines. Alex, CEO, MartLLM