Agents & Routing

View as Markdown

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:

1Alephant-Agent-Id: agt_support_bot_8f3a
2Alephant-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 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.