Skip to navigation

Token Factory

View as Markdown

Token Factory serves leading open-weight LLMs on Sarvam infrastructure through one OpenAI-compatible API. It uses the same API key, SDK, and credits as every other Sarvam API: there is nothing new to sign up for. Switching models is a one-line change to the model field.

Switch from OpenAI in two lines

Point your client at https://api.sarvam.ai/v2, pass your Sarvam key, and pick a model.

import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.sarvam.ai/v2", # was https://api.openai.com/v1
api_key=os.environ["SARVAM_API_KEY"],
)
response = client.chat.completions.create(
model="glm5.3", # or "glm5.3-flash", "gemma4"
messages=[{"role": "user", "content": "Explain UPI in two sentences."}],
max_tokens=1000,
)
print(response.choices[0].message.content)

Models

ModelModel IDBest forInput / output price (₹ per 1M tokens)
GLM-5.3glm5.3Coding and long-horizon agents₹126 / ₹390
GLM-5.3 Flashglm5.3-flashFast reasoning with image input₹13.5 / ₹45
Gemma 4 31Bgemma4Images and low-latency answers₹35 / ₹90

DeepSeek V4.1 Flash 1017, DeepSeek V4 Pro, Kimi K3, MiMo V2.6 Flash, and MiMo V2.6 Pro are in beta and are enabled per API key. See Pricing for their rates and for cached-input rates.

Moving from another provider? Follow the guide for OpenRouter, Fireworks AI, or Together AI.

Looking for Sarvam’s own LLM? Sarvam 105B is listed with the other Sarvam Models and uses the same Chat Completions API.

Where to go next