> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiohub.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Group mechanism

> Understand how groups affect API key access, routing, and billing.

## How it works

Groups are the main routing mechanism in AIOHub. When you send an API request, AIOHub reads the groups assigned to the API key, checks the requested model, and selects a matching upstream channel.

An API key can belong to multiple groups. You can choose `auto` to let AIOHub pick from active groups based on the current routing configuration. Choose a specific group, such as `codex`, `anthropic`, `gemini`, or `opensource-economy`, when you need a fixed route family.

## What groups affect

* **Model availability**: different groups expose different model sets.
* **Channel routing**: the same model can route through different upstream channels.
* **Price differences**: the same model can have different ratios by group.
* **Resilience**: `auto` and cross-group retry can switch between available channels.

## Recommended workflow

<Steps>
  <Step title="Check available groups">
    Use the console to view current groups and the models available under each group.
  </Step>

  <Step title="Assign by use case">
    Create separate API keys for separate tools. For example, use `codex` or `codex-passthrough` for Codex CLI, `gemini` for Gemini CLI, and `anthropic` or a Claude-specific group for Claude Messages clients.
  </Step>

  <Step title="Validate availability">
    After creating the API key, call `/v1/models` and confirm the visible model list matches the client you plan to use.
  </Step>
</Steps>

## Notes

* You can update an API key's groups in the console or through the API key management endpoint without changing the `sk-` value.
* Group settings may change when upstream providers update their offerings.
* `auto` is a routing control value, not a fixed group. Actual routing still depends on visible models, channel status, and balance.
