diff --git a/docs.json b/docs.json index e7cd4e3a5..9c4f21182 100644 --- a/docs.json +++ b/docs.json @@ -2087,6 +2087,12 @@ ] } ] + }, + { + "group": "TrustedRouter", + "pages": [ + "models/providers/gateways/trustedrouter/overview" + ] } ] }, @@ -3997,6 +4003,12 @@ ] } ] + }, + { + "group": "TrustedRouter", + "pages": [ + "models/providers/gateways/trustedrouter/overview" + ] } ] }, diff --git a/models/providers/gateways/trustedrouter/overview.mdx b/models/providers/gateways/trustedrouter/overview.mdx new file mode 100644 index 000000000..8e157a75d --- /dev/null +++ b/models/providers/gateways/trustedrouter/overview.mdx @@ -0,0 +1,63 @@ +--- +title: TrustedRouter +sidebarTitle: Overview +description: Use TrustedRouter models and routing aliases with Agno agents. +--- + +TrustedRouter provides an OpenAI-compatible API for models across multiple providers. The Agno integration defaults to `trustedrouter/zdr`, a routing alias for zero-data-retention endpoints. + +## Authentication + +Create an API key in the [TrustedRouter console](https://trustedrouter.com/console/api-keys), then set the `TRUSTEDROUTER_API_KEY` environment variable. + + + +```bash Mac +export TRUSTEDROUTER_API_KEY=*** +``` + +```bash Windows +setx TRUSTEDROUTER_API_KEY *** +``` + + + +## Example + +Install Agno and the OpenAI client: + +```shell +uv pip install -U agno openai +``` + +Use `TrustedRouter` with an `Agent`: + + + +```python agent.py +from agno.agent import Agent +from agno.models.trustedrouter import TrustedRouter + +agent = Agent( + model=TrustedRouter(id="trustedrouter/zdr"), + markdown=True, +) + +agent.print_response("Share a two-sentence horror story.", stream=True) +``` + + + +Set `id` to a specific model such as `google/gemini-2.5-flash-lite`, or use a TrustedRouter alias such as `trustedrouter/auto`, `trustedrouter/zdr`, or `trustedrouter/e2e`. + +## Params + +| Parameter | Type | Default | Description | +| ---------- | --------------- | ------------------------------------ | ------------------------------------------------------------------------- | +| `id` | `str` | `"trustedrouter/zdr"` | The model ID or TrustedRouter routing alias | +| `name` | `str` | `"TrustedRouter"` | The model name | +| `provider` | `str` | `"TrustedRouter"` | The provider name | +| `api_key` | `Optional[str]` | `None` | The API key, defaulting to `TRUSTEDROUTER_API_KEY` | +| `base_url` | `str` | `"https://api.trustedrouter.com/v1"` | The TrustedRouter OpenAI-compatible API base URL | + +`TrustedRouter` extends [OpenAILike](/reference/models/openai-like) and accepts all of its parameters.