Quickstart & Smart Routing Guide

Access every frontier AI model through a single standard endpoint with automatic provider failover, intelligent smart routing, and zero data retention.

1. Configure your OpenAI SDK

Nicrron is 100% drop-in compatible with the standard OpenAI SDK in Python, TypeScript/Node, Go, and cURL.

TypeScript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.nicrron.ai/v1",
  apiKey: process.env.NICRRON_API_KEY, // sk-ncr-...
});

2. Smart Auto-Routing (`nicrron/auto`)

Instead of hardcoding a specific model, pass nicrron/auto. Our gateway dynamically selects the best model based on prompt complexity and provider latency.

Smart Routing Request
const completion = await client.chat.completions.create({
  model: "nicrron/auto", // Or "nicrron/fastest" or "nicrron/cheapest"
  messages: [{ role: "user", content: "Optimize this SQL query for high concurrency" }],
});

console.log(completion.choices[0].message.content);
nicrron/auto

Smart balance between intelligence and cost based on prompt length.

nicrron/reasoning

DeepSeek V4 Pro, OpenAI o3-mini, and Claude Opus 5 for complex logic.

nicrron/coding

Claude Opus 5, Claude Sonnet 5, and Kimi K2.7 Code for software development.

nicrron/fastest

Claude Haiku 4.5, GPT-5.6 Luna, and DeepSeek V4 Flash for lowest latency.

3. Multi-Model Fallback Arrays

Guarantee 99.99% uptime for critical production workflows by specifying an ordered list of fallback models.

Fallback Array
const completion = await client.chat.completions.create({
  model: "anthropic/claude-sonnet-5",
  // If primary provider is rate-limited (429) or down (5xx), instantly cascade:
  models: [
    "anthropic/claude-sonnet-5",
    "openai/gpt-4o",
    "deepseek/deepseek-v4-flash",
  ] as any,
  messages: [{ role: "user", content: "Summarize this technical specification." }],
});

4. OpenAI-Compatible Embeddings

Generate text embeddings across OpenAI, Mistral, and Voyage through client.embeddings.create().

Embeddings Request
const embedding = await client.embeddings.create({
  model: "openai/text-embedding-3-small",
  input: "Semantic vector search with Nicrron Gateway",
});

5. Sub-Millisecond Exact Caching

When sending deterministic requests (temperature: 0), Nicrron automatically caches responses in Redis. Repeat requests return in <5ms at $0 cost with the header X-Nicrron-Cache: HIT.

Quickstart & Smart Routing Guide | Nicrron Docs