slug: concepts

Core Concepts

OAR organises the world into five concepts: platforms, models, groups, agents and projects. Understanding how they relate is the key to using the router effectively.

Platforms

A platform type is a protocol and source classification — OpenCode Go, Anthropic, OpenAI, MiniMax and so on.

A platform instance is a concrete configuration: a single platform type can have multiple instances, each with its own base_url and API key pool.

Platform type: OpenCode Go  (protocol: OpenAI)
├─ instance "primary"   — base_url + Key #1 + Key #2
│   ├─ model: GLM-5.2
│   └─ model: DeepSeek V4
├─ instance "secondary" — base_url + Key #1
│   └─ model: GLM-5.2
└─ instance "tertiary"  — base_url + Key #1
    └─ model: DeepSeek V4

Models

The lowest unit. Every model lives under a platform instance and inherits that instance's key pool.

OpenCode Go primary → GLM-5.2       ← uses Key #1 + Key #2
OpenCode Go primary → DeepSeek V4   ← uses Key #1 + Key #2
OpenCode Go secondary → GLM-5.2     ← uses Key #1

The same model can appear under different instances and draw from different key pools.

Model mapping

The model name an agent sends may differ from the upstream real name. An alias table maps them automatically.

claude-sonnet-4   →  claude-sonnet-4-20250514
gpt-4o            →  gpt-4o-2024-08-06
glm-5.2           →  frank/GLM-5.2

Groups (pools)

A group aggregates multiple models. A single group can mix different protocols and platforms.

coding group
├─ Claude Sonnet 4   (Anthropic,     Anthropic protocol)
├─ GLM-5.2           (OpenCode #1,   OpenAI protocol)
└─ DeepSeek V4       (OpenCode #1,   OpenAI protocol)

Groups carry a routing strategy (sequential, weighted, lowest-latency) and retry policies (retry on failure, cross-model retry).

Agents

An agent preset defines the default group and supported protocols for a given agent.

Claude Code → default group: coding    (protocol: Anthropic Messages)
Codex       → default group: coding    (protocol: Codex Responses)
Hermes      → default group: general   (protocol: OpenAI Chat Completions)

Projects

A project binds an agent and a group, overriding the agent's global default. Projects that aren't configured inherit the agent's global setting.

/web/gz-project   → Claude Code → coding group
/ai/snow-agent    → Hermes      → cheap group

Once a project's group is pinned, global group updates don't affect it. This is what makes the base_url stable forever.

Project vs global

A project with a pinned group is fixed — global group changes leave it alone. A project without a pinned group inherits the agent's global default.

How they fit together

Project  →  Agent   →  Group   →  Model  →  Platform instance  →  Key pool
(name)      (preset)    (pool)     (alias)   (base_url)            (rotation)

Read the Routing Methods page to see the four ways a request can enter this pipeline.