Hi there, I'm using the openrouter API (with gemini 2.5 pro) along with the mistral ocr file-parser plugin.
In the response I have information about used token, however this does not resemble the total cost because the mistral usage cost is not included (or is it? e.g. 0.01 USD per parsed page).
There is information available:
https://openrouter.ai/api/v1/generation?id=gen-...
{
"data": {
"created_at": "2025-08-14T06:58:28.513503+00:00",
"model": "google/gemini-2.5-flash",
"app_id": null,
"external_user": null,
"streamed": true,
"cancelled": false,
"latency": 258,
"moderation_latency": null,
"generation_time": 1823,
"tokens_prompt": 2087,
"tokens_completion": 361,
"native_tokens_prompt": 2227,
"native_tokens_completion": 457,
"native_tokens_reasoning": 0,
"native_tokens_cached": 0,
"num_media_prompt": null,
"num_media_completion": null,
"num_search_results": null,
"origin": "https://localhost:3000/",
"is_byok": false,
"finish_reason": "stop",
"native_finish_reason": "STOP",
"usage": 0.0078106,
"api_type": "completions",
"id": "gen-1755154704-zmSG0GZzbGN2pkVbx0U5",
"upstream_id": null,
"total_cost": 0.0078106,
"cache_discount": null,
"upstream_inference_cost": 0,
"provider_name": "Google"
}
}
But I can't access this because it seems to not be an official endpoint and I can't authenticate with my API key.
Is there a way to get the total cost for one run?
Thank you!
Best,
Jooles