-
Couldn't load subscription status.
- Fork 124
feat(invoice): cost, internal cost and margin #3493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Cost
GET /api/v1/billing/invoices/{"invoiceId}/lines/{lineId}/cost?windowSize=HOUR{ "cost": "2.4", "costPerUnit": "0.0000119845997893", "currency": "USD", "from": "2025-10-11T16:36:43Z", "internalCost": "2.00257", "internalCostPerUnit": "0.8344041666666667", "margin": "0.39743", "marginRate": "0.1655958333333333", "rows": [ { "cost": "1.1208477106944932", "costPerUnit": "0.0000119845997893", "groupBy": {}, "internalCost": "0.93524", "internalCostPerUnit": "0.00001", "margin": "0.1856077106944932", "marginRate": "0.1655958333353672", "usage": "93524", "windowEnd": "2025-10-11T17:00:00Z", "windowStart": "2025-10-11T16:00:00Z" }, { "cost": "1.2791522893113569", "costPerUnit": "0.0000119845997893", "groupBy": {}, "internalCost": "1.06733", "internalCostPerUnit": "0.00001", "margin": "0.2118222893113569", "marginRate": "0.1655958333353672", "usage": "106733", "windowEnd": "2025-10-11T19:00:00Z", "windowStart": "2025-10-11T18:00:00Z" } ], "to": "2025-11-11T16:36:43Z", "usage": "200257" }Feature
GET /api/v1/features/ai_gpt_5_input_tokens{ "id": "01K7A229QEBS3HXA51BCVZ38TR", "key": "ai_gpt_5_input_tokens", "name": "GPT-5 Input Tokens", "costPerUnit": "0.00000125", "createdAt": "2025-10-11T16:36:06.510673Z", "meterSlug": "tokens_total", "meterGroupByFilters": { "model": "gpt-5", "provider": "openai", "type": "input" }, "advancedMeterGroupByFilters": { "model": { "$eq": "gpt-5" }, "provider": { "$eq": "openai" }, "type": { "$eq": "input" } }, "updatedAt": "2025-10-11T16:36:06.510673Z" }