Quickstart
Get your first response from InferexAI in a few minutes. LLM, TTS and STT, voice agents and Quality all use the same API key and the same INR wallet.
1
Create an account and an API key
Sign up at inferexai.in/signup with your email or Google account (with email, confirm your address from the email we send). Then open Dashboard → API Keys and choose New key. Copy the key: it starts with sk-live- and is shown only once.
Requests are paid from your INR wallet. Add money from the dashboard with
Top up; GST is added on top of the amount you choose. A one-time KYC check may be needed before your first top-up. See
Billing & Wallet.
2
Install the SDK
The InferexAI SDKs (version 0.2.0) cover chat, speech, agents, Judge and your wallet:
No SDK? Every endpoint is plain HTTPS. The base URL is https://api.inferexai.in/v1, and your key goes in the Authorization: Bearer header.
3
Pick a model
Model ids are InferexAI names such as medha. List the ones open to your account, with their type (llm, stt, tts, embedding and more):
from inferexai import InferexAI
client = InferexAI(api_key="sk-live-your-key-here")
for model in client.models.list():
print(model.id)
curl https://api.inferexai.in/v1/models \
-H "Authorization: Bearer sk-live-your-key-here"
4
Make your first request
Use a chat model from the list. The examples use medha; replace it if your list differs.
from inferexai import InferexAI
client = InferexAI(api_key="sk-live-your-key-here")
response = client.chat.completions.create(
model="medha", # any chat model id from /v1/models
messages=[{"role": "user", "content": "Namaste! GST kya hai? Ek line mein batao."}],
)
print(response.choices[0].message.content)
import InferexAI from "inferexai";
const client = new InferexAI({ apiKey: "sk-live-your-key-here" });
const response = await client.chat.completions.create({
model: "medha", // any chat model id from /v1/models
messages: [{ role: "user", content: "Namaste! GST kya hai? Ek line mein batao." }],
});
console.log(response.choices[0].message.content);
curl -i https://api.inferexai.in/v1/chat/completions \
-H "Authorization: Bearer sk-live-your-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "medha",
"messages": [{"role": "user", "content": "Namaste! GST kya hai? Ek line mein batao."}]
}'
5
See what it cost
A charged response carries X-Inferex-Charge and X-Inferex-Balance, both in rupees (the -i in the curl example prints them). Every charge is also a line in your usage. Your price for every model is on your rate card:
rates = client.wallet.rate_card() # your price for every model, in rupees per unit
balance = client.wallet.balance() # includes balance_inr
print(balance["balance_inr"])
const rates = await client.wallet.rateCard();
const { balance_inr } = await client.wallet.balance();
6
Stream the reply (optional)
Add stream=True (stream: true in Node) to receive tokens as they are generated:
stream = client.chat.completions.create(
model="medha",
messages=[{"role": "user", "content": "Tell me a short story."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)