Skip to content

fix(openrouter): record billed costs and qualified model ids - #1178

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi/sdk-907-python-sdk-openrouter-integration-real
Nov 24, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi/sdk-907-python-sdk-openrouter-integration-real

Conversation

@AbhiPrasad

Copy link
Copy Markdown
Member

🤖 This text was AI-generated.

OpenRouter returns the amount it billed in usage.cost. The SDK
recorded that amount in a field Braintrust's cost queries ignore.

Before  usage.cost -> metrics.cost
After   usage.cost -> metrics.estimated_cost

Keep the full model ID and identify OpenRouter as the pricing provider
so catalog lookup can use the gateway's model when billed cost is
unavailable. OpenRouter 0.6.0 omits cost from its Chat responses.

Brainstore still needs to give reported charges precedence when a
catalog calculation is available.

Refs: https://linear.app/braintrustdata/issue/SDK-907

> 🤖 **This text was AI-generated.**

OpenRouter returns the amount it billed in `usage.cost`. The SDK
recorded that amount in a field Braintrust's cost queries ignore.

```text
Before  usage.cost -> metrics.cost
After   usage.cost -> metrics.estimated_cost
```

Keep the full model ID and identify OpenRouter as the pricing provider
so catalog lookup can use the gateway's model when billed cost is
unavailable. OpenRouter 0.6.0 omits cost from its Chat responses.

Brainstore still needs to give reported charges precedence when a
catalog calculation is available.

Refs: https://linear.app/braintrustdata/issue/SDK-907
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T23:56:12.805207Z 01efcf9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 6584a33 into main Nov 24, 2026
98 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi/sdk-907-python-sdk-openrouter-integration-real branch November 24, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant