# Get complete answers and request costs from OpenRouter

> Agno's OpenRouter, Perplexity and Requesty models stop capping answers at 1024 tokens, and OpenRouterResponses records the cost OpenRouter reports.

- Published: 2026-11-17
- Author: FanouZeng-TT
- Categories: Changelog
- Canonical: https://www.agno.com/blog/get-complete-answers-and-request-costs-from-openrouter
- Markdown: https://www.agno.com/blog/get-complete-answers-and-request-costs-from-openrouter.md

Agno's `OpenRouter`, `Perplexity` and `Requesty` models no longer cut long answers off at 1024 tokens when you leave `max_tokens` unset. The default is now `None`, so Agno leaves the field out of the request and the model's own output limit applies, so answers can run longer and cost more. Before, each class sent `max_tokens: 1024` by default. To keep that cap, set it yourself, since a limit you set still goes out unchanged:

```python
from agno.models.openrouter import OpenRouter

model = OpenRouter(id="anthropic/claude-sonnet-4", max_tokens=1024)
```

We captured the request body with an httpx `MockTransport` standing in for each provider's API:

```text
Before: OpenRouter() request max_tokens: 1024
Now:    OpenRouter() request max_tokens: <absent>
```

`Perplexity` and `Requesty` gave the same result, and `OpenRouter(max_tokens=4096)` sent 4096 on both releases.

`OpenRouterResponses` also dropped the `cost` that OpenRouter's Responses API returns in `usage`, so `metrics.cost` stayed `None` on every run. Agno now copies it into the message metrics, and the run metrics carry it too. A mocked Responses payload with `"cost": 3.6e-06` showed:

```text
Before: run metrics cost: None
Now:    run metrics cost: 3.6e-06
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/90_models/openrouter/responses/basic.py), and learn more about [OpenRouter](https://docs.agno.com/models/providers/gateways/openrouter/overview) and [metrics](https://docs.agno.com/sessions/metrics/overview) in the documentation.
