← Back to docs

Unified LLM API design

Meridian exposes one OpenAI-compatible endpoint that fronts 250+ models across Azure, Anthropic, Google, xAI, DeepSeek, and Meta. This recipe walks through the design choices that let a single request schema route to any provider without leaking provider-specific quirks into your application code.

1. Canonical request schema

Every call lands on /v1/chat/completionswith the OpenAI shape: model, messages, max_tokens, and tool fields. Provider-specific knobs ride along under extra_body so the base contract never breaks.

2. Model alias resolution

The gateway resolves modelagainst an alias table at request time. Aliases like azure/model-router fan out to the cheapest healthy deployment; explicit IDs like anthropic/claude-opus-4-7pin to one provider.

3. Streaming and error normalization

SSE chunks are rewritten into OpenAI delta frames before they leave the edge. Provider errors collapse into a small set of HTTP codes plus a stable error.type string so retry logic stays portable.

curl https://llm.getnimbus.net/v1/chat/completions \
  -H "Authorization: Bearer $MERIDIAN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "azure/model-router",
    "messages": [
      {"role": "user", "content": "Hello"}
    ],
    "max_tokens": 256
  }'
Back to all docs