Get started›Quickstart
Quickstart
Three steps. Install the SDK. Set your API key. Send a prompt. Cruxy picks the model.
1. Sign up and get an API key
Create a Cruxy account at cruxy.in. New accounts get ₹500 in free API credits - no card required. Once you're in, generate a key from the API keys page in your dashboard. Keys start with cruxy- and should be treated as secrets.
Set your key as an environment variable.
export CRUXY_API_KEY="cruxy-..."2. Install the Cruxy SDK
One package, one key, one API. The Cruxy SDK ships with mode: 'auto' routing built in — you write the prompt, Cruxy picks the model.
npm install @cruxy/sdk3. Make your first request
Send a prompt with mode: 'auto' and Cruxy routes it to the right model based on complexity, latency needs, and cost. The response includes which model was picked.
import { Cruxy } from '@cruxy/sdk'
const cruxy = new Cruxy({
apiKey: process.env.CRUXY_API_KEY,
})
const reply = await cruxy.generate({
prompt: 'Summarize this PDF in 3 bullets',
mode: 'auto',
})
console.log(reply.text)
// routed → vaani · 1.2s · ₹0.044. Override the auto router when you need to
Most calls should use mode: 'auto'. For cases where you know which model fits — long-context reasoning on Kavi, sub-400ms latency on Mira — pass model directly.
// Override the auto router when you need to
const reply = await cruxy.generate({
prompt: 'Plan a 4-week migration from Postgres to Cassandra',
model: 'kavi', // force Kavi for the hardest problems
})5. Already have OpenAI code? Point it at Cruxy.
Cruxy is OpenAI-compatible. Use the OpenAI SDK if you prefer — change the base_url and your existing code calls Cruxy. Pick a model name explicitly (no auto-routing on this path).
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.CRUXY_API_KEY,
baseURL: "https://api.cruxy.in/v1",
});
const response = await client.chat.completions.create({
model: "vaani",
messages: [
{ role: "user", content: "Explain GST input credit in simple Hindi." },
],
});
console.log(response.choices[0].message.content);api.cruxy.in/v1. Same SDK, same shape. Switching costs nothing.