mirror of
https://github.com/openai/codex.git
synced 2026-10-27 18:48:37 +00:00
## Why ENT26 plans are billed directly in dollars, so credit estimates and credit-weighted breakdowns do not describe their thread usage. ## What changed - Expose optional `nativeUsageUsdMicros` in app-server `ThreadUsage` responses and generated schemas and SDK types. Missing native usage means unknown, not zero. - Enable ENT26 usage fetching and display native dollar amounts in `/status`, the status line, terminal titles, and the agents overview. Hide credits and omit credit-weighted `/status` breakdowns for these plans. - Use native dollar amounts when tracking post-turn usage settlement for ENT26 plans. ## Testing Add coverage for native usage forwarding, ENT26 billing displays, and settlement polling with stale, missing, or zero dollar amounts. GitOrigin-RevId: ca8ea98141a66bdf0a27feb9f58f67822b821f5f
195 lines
4.0 KiB
JSON
Generated
195 lines
4.0 KiB
JSON
Generated
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"definitions": {
|
|
"AccountTokenUsageDailyBucket": {
|
|
"properties": {
|
|
"startDate": {
|
|
"type": "string"
|
|
},
|
|
"tokens": {
|
|
"format": "int64",
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"required": [
|
|
"startDate",
|
|
"tokens"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"AccountTokenUsageSummary": {
|
|
"properties": {
|
|
"currentStreakDays": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"lifetimeTokens": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"longestRunningTurnSec": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"longestStreakDays": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"peakDailyTokens": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
}
|
|
},
|
|
"type": "object"
|
|
},
|
|
"ThreadUsage": {
|
|
"properties": {
|
|
"estimatedUsageCreditsMicros": {
|
|
"format": "int64",
|
|
"type": "integer"
|
|
},
|
|
"estimatedUsageUsdMicros": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"groups": {
|
|
"items": {
|
|
"$ref": "#/definitions/ThreadUsageBreakdownGroup"
|
|
},
|
|
"type": "array"
|
|
},
|
|
"nativeUsageUsdMicros": {
|
|
"description": "Native dollar usage, independent of credit estimates. None means unknown, not zero.",
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"threadId": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"estimatedUsageCreditsMicros",
|
|
"groups",
|
|
"threadId"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"ThreadUsageBreakdownGroup": {
|
|
"properties": {
|
|
"cachedInputTokens": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"estimatedUsageCreditsMicros": {
|
|
"format": "int64",
|
|
"type": "integer"
|
|
},
|
|
"inputTokens": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"model": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"netNewInputTokens": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"outputTokens": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"reasoningEffort": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"speed": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"totalTokens": {
|
|
"format": "int64",
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"estimatedUsageCreditsMicros"
|
|
],
|
|
"type": "object"
|
|
}
|
|
},
|
|
"properties": {
|
|
"dailyUsageBuckets": {
|
|
"items": {
|
|
"$ref": "#/definitions/AccountTokenUsageDailyBucket"
|
|
},
|
|
"type": [
|
|
"array",
|
|
"null"
|
|
]
|
|
},
|
|
"summary": {
|
|
"$ref": "#/definitions/AccountTokenUsageSummary"
|
|
},
|
|
"threadUsage": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/ThreadUsage"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": null,
|
|
"description": "Estimated usage when a thread was requested and its billing route is available."
|
|
}
|
|
},
|
|
"required": [
|
|
"summary"
|
|
],
|
|
"title": "GetAccountTokenUsageResponse",
|
|
"type": "object"
|
|
} |