The shortest possible path from "signed up" to "first response in your code."
Sign up free — you'll get an API key starting with tk_ immediately. No card required, $5 of credit included to play with.
Treat your API key like a password. Don't commit it to git. Use environment variables.
If you have OpenAI's Python SDK installed, you're already done. Two lines change.
from openai import OpenAI client = OpenAI( api_key="tk_your_key_here", base_url="https://gateway.larzpay.com/v1", ) resp = client.chat.completions.create( model="drlarz-smart", messages=[ {"role": "user", "content": "Write me a haiku about Python."} ], ) print(resp.choices[0].message.content)
import OpenAI from "openai"; const client = new OpenAI({ apiKey: "tk_your_key_here", baseURL: "https://gateway.larzpay.com/v1", }); const resp = await client.chat.completions.create({ model: "drlarz-smart", messages: [{ role: "user", content: "Hello" }], }); console.log(resp.choices[0].message.content);
Point your existing AI client at DrLarz instead. The /api/chat, /api/generate, and /api/tags endpoints all work the same way — just add your API key in the Authorization header.
curl https://gateway.larzpay.com/api/chat \ -H "Authorization: Bearer tk_your_key_here" \ -d '{ "model": "drlarz-smart", "messages": [{"role": "user", "content": "Hello"}] }'
Same as OpenAI. Set stream: true and iterate. Server-sent events. Same chunk format.
stream = client.chat.completions.create(
model="drlarz-fast",
messages=[...],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
Pass tools the same way you would with OpenAI. The response uses the same tool_calls structure. Use the drlarz-coder or drlarz-smart alias for best tool-use behavior.
resp = client.chat.completions.create(
model="drlarz-smart",
messages=[...],
tools=[{
"type": "function",
"function": {
"name": "get_weather",
"parameters": {"type": "object", ...},
},
}],
)
Standard HTTP status codes. The codes you'll actually see:
401 — your API key is wrong or revoked402 — you hit your budget cap, or your balance is empty404 — model alias doesn't exist (typo? check the list below)429 — you hit a rate limit (per second or per day)503 — temporarily can't fulfil the request, retry with backoffThe response body is always JSON: {"error": {"message": "...", "type": "..."}}. Same shape as OpenAI.
Use these as the model field. We pick the underlying provider — you don't have to.
drlarz-smart — general-purpose chat, balanced cost & qualitydrlarz-fast — speed-first chat, optimized for low TTFTdrlarz-coder — code generation, refactoring, tool-usedrlarz-max — long-context, multi-step problemsSee the pricing page for per-token rates on each.
If you've used the OpenAI SDK before, you're done reading. Get an API key and write some code.