You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 43b6ff6
Browse filesBrowse the repository at this point in the historyBrowse files
feat(api): add model and token category to organization costs (#4365)
## Summary
Adds billed model and token category details to organization cost line
items.
## Changes
- Read the billed model and token category when they are available.
Co-authored-by: dpiet-oai <326640584+dpiet-oai@users.noreply.github.com>
description: API source (agents_api or unlabeled) when grouped by api_source; otherwise null. Unlabeled includes records without published source attribution.
description: The model associated with the billed product, including purchased capacity. This may differ from the model ID used in a request, including fine-tuned model IDs. Null when line_item is null or a model association is unavailable or not applicable.
115376
+
- type: 'null'
115377
+
token_type:
115378
+
anyOf:
115379
+
- type: string
115380
+
description: 'The billed token category: `input`, `output`, `input_cached`, `input_cache_write_30m`, `input_cache_write_12h`, or `total`. For inference charges, `input` excludes separately billed cache reads and writes. For Scale Tier purchases, these categories describe purchased capacity. Null when line_item is null or when the category is unknown or inapplicable. Additional values may be introduced in the future.'
description: The aggregated costs details of the specific time bucket.
115435
+
properties:
115436
+
api_source:
115437
+
description: When grouped by `api_source`, `agents_api` identifies attributed Agents API activity and `unlabeled` includes all records without published source attribution, including historical and unknown origins. Unlabeled does not imply direct API usage. Without source grouping, this field is null.
115438
+
anyOf:
115439
+
- type: string
115440
+
enum:
115441
+
- agents_api
115442
+
- unlabeled
115443
+
- type: 'null'
115444
+
object:
115445
+
type: string
115446
+
const: organization.costs.result
115447
+
amount:
115448
+
type: object
115449
+
description: The monetary value in its associated currency.
115450
+
properties:
115451
+
value:
115452
+
type: number
115453
+
description: The numeric value of the cost.
115454
+
currency:
115455
+
type: string
115456
+
description: Lowercase ISO-4217 currency e.g. "usd"
115457
+
line_item:
115458
+
anyOf:
115459
+
- type: string
115460
+
description: When `group_by=line_item`, this field provides the line item of the grouped costs result.
115461
+
- type: 'null'
115462
+
project_id:
115463
+
anyOf:
115464
+
- type: string
115465
+
description: When `group_by=project_id`, this field provides the project ID of the grouped costs result.
115466
+
- type: 'null'
115467
+
user_id:
115468
+
anyOf:
115469
+
- type: string
115470
+
description: When `group_by=user_id`, this field provides the user ID of the grouped costs result.
115471
+
- type: 'null'
115472
+
api_key_id:
115473
+
anyOf:
115474
+
- type: string
115475
+
description: When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
115476
+
- type: 'null'
115477
+
quantity:
115478
+
anyOf:
115479
+
- type: number
115480
+
description: When `group_by=line_item`, this field provides the quantity of the grouped costs result.
description: The model associated with the billed product, including purchased capacity. This may differ from the model ID used in a request, including fine-tuned model IDs. Null when line_item is null or a model association is unavailable or not applicable.
115488
+
- type: 'null'
115489
+
token_type:
115490
+
anyOf:
115491
+
- type: string
115492
+
description: 'The billed token category: `input`, `output`, `input_cached`, `input_cache_write_30m`, `input_cache_write_12h`, or `total`. For inference charges, `input` excludes separately billed cache reads and writes. For Scale Tier purchases, these categories describe purchased capacity. Null when line_item is null or when the category is unknown or inapplicable. Additional values may be introduced in the future.'
0 commit comments