Quickstart
A working chat completion in three commands and 60 seconds. We'll use deepseek-v4 — fast, cheap, OpenAI-shape.
1. Install an SDK
Use the standard OpenAI SDK. Don't install anything ollima-specific — you don't need to.
# Python pip install openai # Node npm install openai
2. Mint a key
Sign in at app.ollima.com (magic link, no password), open the Keys page, click Create key, copy the sk-t0-… value once (we never show it again).
Set a monthly spend cap right when you create the key. It's a one-line edit later but easy to forget — and a runaway loop will burn ₹3000 before you finish your coffee.
3. Make your first call
from openai import OpenAI
client = OpenAI(
base_url="https://api.ollima.com/v1",
api_key="sk-t0-…",
)
resp = client.chat.completions.create(
model="deepseek-v4",
messages=[{"role": "user", "content": "Explain DNS in one sentence."}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.ollima.com/v1",
apiKey: "sk-t0-…",
});
const resp = await client.chat.completions.create({
model: "deepseek-v4",
messages: [{ role: "user", content: "Explain DNS in one sentence." }],
});
console.log(resp.choices[0].message.content);
curl https://api.ollima.com/v1/chat/completions \
-H "Authorization: Bearer sk-t0-…" \
-H "Content-Type: application/json" \
-d {`'{"model":"deepseek-v4","messages":[{"role":"user","content":"Explain DNS in one sentence."}]}'`}
You should see a one-sentence answer in under a second. If you get 401, your key has a typo. If you get 429 on call number 21, you hit the free-plan rate limit — see Rate limits.
4. Stream the response
Add stream: true to get tokens as Server-Sent Events. Ideal for chat UIs. The response shape is identical to OpenAI's.
# Python stream = client.chat.completions.create( model="deepseek-v4-flash", messages=[{"role": "user", "content": "Write a haiku about DNS"}], stream=True, ) for chunk in stream: print(chunk.choices[0].delta.content or "", end="")