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", "deepseekv4.1-flash-1017"
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)
Sarvam 105Bsarvam-105bIndian-language reasoning, coding, and agents₹10 / ₹25 (introductory)
Sarvam 105B Conversationssarvam-105b-conversationsReal-time dialogue and voice agents₹10 / ₹25 (introductory)
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 1017deepseekv4.1-flash-1017Long documents and cost-sensitive reasoning₹14 / ₹55 (introductory)

Introductory pricing runs through the end of 2026. See Pricing.

Need a yes/no, a label, or a score instead of generated text? Sarvam Prism (sarvam-prism) is a System-1 decision model built on Sarvam 105B. On POST /v2/systemone it returns a calibrated probability for every option, at ₹4 per 1M input tokens (₹0 output).

DeepSeek V4 Pro, Kimi K3.1 Pro, Qwen 3.8 27B, Clef (a decision model that also reads images), and EmbeddingGemma 2 (text embeddings on POST /v2/embeddings) are on Provisioned Throughput and are enabled per organisation. See Pricing for rates.

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

Where to go next