Integrations
Use Nivana anywhere that speaks the OpenAI API, from the OpenAI SDKs and LangChain to coding agents, or from Claude and Cursor through MCP.
OpenAI-compatible endpoint
POST /v1/chat/completions takes the OpenAI Chat Completions request and returns its response shape, streamed or not. Point any OpenAI client at https://nivana.one/v1 with your Nivana key. The model field is accepted and ignored, because Nivana routes every request; send nivana/auto, or nivana/quality, nivana/best, nivana/speed or nivana/cost to steer it. System messages are passed on as instructions. The response’s model is the model that answered, and a nivana field carries the route. GET /v1/models lists the five names.
import OpenAI from 'openai'
const nivana = new OpenAI({ baseURL: 'https://nivana.one/v1', apiKey: process.env.NIVANA_API_KEY })
const res = await nivana.chat.completions.create({
model: 'nivana/auto',
messages: [{ role: 'user', content: 'Explain CRDTs in two paragraphs.' }],
})
console.log(res.model, res.choices[0].message.content)
- Text only: image parts are refused with
400. Tool calling, JSON mode and sampling parameters (temperature,max_tokens) are not supported yet and are ignored. - Billing, limits, long-conversation summaries and errors work as on /v1/chat; errors use OpenAI’s
{ "error": { "message", "type", "code" } }shape.
Frameworks
// Vercel AI SDK, through the OpenAI-compatible provider
import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
import { generateText } from 'ai'
const nivana = createOpenAICompatible({ name: 'nivana', baseURL: 'https://nivana.one/v1', apiKey: process.env.NIVANA_API_KEY })
const { text } = await generateText({ model: nivana('nivana/auto'), prompt: 'Name three uses for a router.' })
Coding agents and editors
Tools that accept a custom OpenAI-compatible provider can use Nivana for chat: set the base URL to https://nivana.one/v1, the API key to your Nivana key, and the model to nivana/auto. In Continue that is a model entry with provider: openai and apiBase; in Aider, --openai-api-base https://nivana.one/v1 --model openai/nivana/auto. Agent modes that rely on tool calling need tool support, which the endpoint does not have yet.
MCP server
The nivana-mcp server (being published to npm; the config below works once it is) gives Claude Desktop, Claude Code, Cursor and other MCP clients an ask_nivana tool: the client hands a question to Nivana, which routes it to the best model and returns the answer with the model that gave it.
{
"mcpServers": {
"nivana": {
"command": "npx",
"args": ["-y", "nivana-mcp"],
"env": { "NIVANA_API_KEY": "nvn_sk_…" }
}
}
}