Docs·Auto Router

Meridian Auto Router

Pass model: "auto" and Meridian picks the right model per request. Classification is based on the prompt content and an optional priority hint. The choice is recorded on the response so you can audit decisions.

How it works

  • Tags: creative, code, reasoning, fast, factual.
  • Priorities: speed, cost, accuracy (default: accuracy).
  • Pool: verified models from /api/v1/models.
  • Decision metadata: chosen id, rationale, alternates in response body.
  • Billing: same flat $1 = 1M tokens. No router surcharge.

cURL

curl -sS https://meridian.getnimbus.net/api/v1/chat/completions \
  -H "Authorization: Bearer $MERIDIAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [
      {"role": "system", "content": "You write concise TypeScript."},
      {"role": "user",   "content": "Refactor this function for readability."}
    ]
  }'

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://meridian.getnimbus.net/api/v1",
    api_key="YOUR_MERIDIAN_KEY",
)

resp = client.chat.completions.create(
    model="auto",                      # let Meridian pick
    messages=[
        {"role": "system", "content": "You are a senior engineer."},
        {"role": "user",   "content": "Find the bug in this Python snippet ..."},
    ],
)
print(resp.choices[0].message.content)

TypeScript (OpenAI SDK)

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://meridian.getnimbus.net/api/v1",
  apiKey: process.env.MERIDIAN_API_KEY!,
});

const r = await client.chat.completions.create({
  model: "auto",
  messages: [
    { role: "system", content: "You are a creative copywriter." },
    { role: "user",   content: "Draft a tagline for a developer tool." },
  ],
});
console.log(r.choices[0].message.content);

Preview a decision (no auth)

Hit POST /api/v1/router to preview which model would be chosen without burning credits.

curl -sS https://meridian.getnimbus.net/api/v1/router \
  -H "Content-Type: application/json" \
  -d '{"task":"code","priority":"accuracy"}'

Aliases

auto, router-auto, router:auto all resolve to the same router.

Tip. Use priority: "speed" for chat UIs and priority: "accuracy" for agentic / code tasks.