We're excited to share a new update for the Sonar API:
The API response JSON now includes detailed cost information for each request!
You'll now see a new structure like this in your response:
"usage": {
"prompt_tokens": 8,
"completion_tokens": 439,
"total_tokens": 447,
"search_context_size": "low",
"cost": {
"input_tokens_cost": 2.4e-05,
"output_tokens_cost": 0.006585,
"request_cost": 0.006,
"total_cost": 0.012609
}
}```
What's included?
- `input_tokens_cost`: Cost attributed to input tokens.
- `output_tokens_cost`: Cost attributed to output tokens.
- `request_cost`: Fixed cost per request.
- `total_cost`: The total cost for this API call.
**Learn more here: https://docs.perplexity.ai/changelog/changelog#july-2025**
<@&1256984878138920981>

