Migrate

Migrate from OpenAI

Two lines of code. The OpenAI SDK works against Ollima unchanged — we expose the same chat completions, embeddings, streaming, tools, JSON mode, and image inputs at the same paths. Routing to open-weight models cuts most workloads' bills by 5-30×.

The one-line change

client = OpenAI( base_url="https://api.ollima.com/v1", # <- changed api_key="sk-t0-…", # <- your Ollima key ) # Everything else stays the same. resp = client.chat.completions.create( model="deepseek-v4", # <- changed messages=[...], )
const client = new OpenAI({ baseURL: "https://api.ollima.com/v1", // changed apiKey: "sk-t0-…", // your Ollima key }); const resp = await client.chat.completions.create({ model: "deepseek-v4", // changed messages: [...], });

Model name mapping

The biggest wins come from swapping to open-weight models. Map your current models to their closest Ollima alias:

Your current modelClosest Ollima aliasNotes
Flagship chat modeldeepseek-v4Roughly comparable for chat + tool calling, at a fraction of the cost.
Fast / mini modeldeepseek-v4-flashFast + cheap path.
Reasoning modelqwen3-32b (thinking)Open-weights reasoning model. We strip the <think> chain so your client gets clean answers.
Embedding modelnomic-embed-text768-dim embedding, drop-in for most RAG workloads.

API key mapping

Your OPENAI_API_KEY env var becomes your Ollima sk-t0-… key. Mint at app.ollima.com. Set a monthly cap on it from the same screen — a habit OpenAI doesn't make easy and that has saved customers thousands of dollars from runaway loops.

OpenAI features that work unchanged

  • Streaming (stream: true) — same SSE format, terminal [DONE], usage chunk via stream_options.include_usage.
  • Tool / function calling — see guide. Works on all our default-route models.
  • Structured outputs / JSON moderesponse_format: { "type": "json_object" }.
  • Vision / image inputs — pass image_url content blocks. Supported on models flagged with the camera badge on /models.
  • Embeddings/v1/embeddings with model alias.
  • Per-request user trackinguser field captured as a tag (see App attribution).

Differences to know

  • Assistants API / Threads / Files / Realtime audio: not on Ollima today. If you depend on them, BYOK OpenAI and we'll proxy chat completions while you keep using Assistants directly.
  • Fine-tuning: for open-weight models, do it provider-side, then route through Ollima with that custom model name.
  • Rate limits: Ollima caps RPM by plan (20 / 60 / 240). OpenAI's tiering is by per-model TPM/RPM. See Rate limits.
  • Billing currency: INR by default, with GST invoices. USD billing available on Enterprise.

How your bill typically changes

For an org spending ~$5K/mo on a flagship closed model:

PathEffective rateMonthly
Closed flagship, direct$2.50 / 1M input~$5,000
Ollima → deepseek-v4$0.59 / 1M input~$1,180
Ollima → deepseek-v4-flash$0.10 / 1M input~$200
BYOK your provider through Ollima$2.50 + ₹0.10/1k platform fee~$5,080

The savings are workload-dependent — your prompts and model choices change the picture. Try it in the dashboard to A/B real prompts side-by-side.