> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.alephant.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.alephant.io/_mcp/server.

# Agents & Routing

> How to create and manage AI Agents within Alephant

Agents represent the applications or services consuming AI models through Alephant. By creating an Agent, you generate an isolated Virtual Key (VK) for that specific use case.

## Creating an Agent

When you create an Agent, you define:

1. **Basic Info:** Name and description of the application.
2. **Configuration:** The desired LLM provider, target model, and environment (e.g., production, staging).
3. **Routing:** The underlying Master Key (Provider Key) to process the requests.

Upon creation, Alephant automatically generates a Virtual Key bound to this Agent.

## Agent ID

Each Agent has a stable Agent ID. Use that ID when sending gateway traffic so Alephant can attribute requests, runs, cost, policies, and logs to the correct agent.

For new integrations, send:

```http
Alephant-Agent-Id: agt_support_bot_8f3a
Alephant-Run-Id: run_<your-run-id>
```

Use the same Agent ID for every request from that agent. Use a new Run ID for each task execution.

## Agent Observability

Agent metrics (request volume, latency, cost, tokens) are deeply tracked in the dashboard. While the Agent count itself does not affect your subscription billing, tracking per-Agent performance is crucial for optimization and identifying anomalies (like latency spikes or abnormal costs).

Agent observability is strongest when requests include Agent ID and Run ID context. See [Agent IDs And Run IDs](/docs/overview/core-concepts/agent-i-ds-and-run-i-ds) for usage examples.

## Smart Routing

With Alephant, you can implement smart routing policies (on supported plans) to configure fallback models. If a primary provider experiences downtime, the gateway can seamlessly route traffic to a secondary provider without any code changes on your end.