mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 16:06:16 +00:00
docs: clarify openai usage normalization
This commit is contained in:
@@ -107,7 +107,8 @@ Current bundled examples:
|
||||
fetching
|
||||
- `openai`: GPT-5.4 forward-compat fallback, direct OpenAI transport
|
||||
normalization, Codex-aware missing-auth hints, Spark suppression, synthetic
|
||||
OpenAI/Codex catalog rows, thinking/live-model policy, and
|
||||
OpenAI/Codex catalog rows, thinking/live-model policy, usage-token alias
|
||||
normalization (`input` / `output` and `prompt` / `completion` families), and
|
||||
provider-family metadata
|
||||
- `google` and `google-gemini-cli`: Gemini 3.1 forward-compat fallback and
|
||||
modern-model matching; Gemini CLI OAuth also owns auth-profile token
|
||||
|
||||
@@ -278,6 +278,9 @@ Event types currently emitted:
|
||||
## Usage
|
||||
|
||||
`usage` is populated when the underlying provider reports token counts.
|
||||
OpenClaw normalizes common OpenAI-style aliases before those counters reach
|
||||
downstream status/session surfaces, including `input_tokens` / `output_tokens`
|
||||
and `prompt_tokens` / `completion_tokens`.
|
||||
|
||||
## Errors
|
||||
|
||||
|
||||
@@ -198,6 +198,12 @@ OpenAI Responses), OpenClaw also attaches stable session and turn identity state
|
||||
to requests so retries, reconnects, and SSE fallback stay aligned to the same
|
||||
conversation identity.
|
||||
|
||||
OpenClaw also normalizes OpenAI usage counters across transport variants before
|
||||
they reach session/status surfaces. Native OpenAI/Codex Responses traffic may
|
||||
report usage as either `input_tokens` / `output_tokens` or
|
||||
`prompt_tokens` / `completion_tokens`; OpenClaw treats those as the same input
|
||||
and output counters for `/status`, `/usage`, and session logs.
|
||||
|
||||
You can set `agents.defaults.models.<provider/model>.params.transport`:
|
||||
|
||||
- `"sse"`: force SSE
|
||||
|
||||
@@ -61,6 +61,11 @@ Other surfaces:
|
||||
- **CLI:** `openclaw status --usage` and `openclaw channels list` show
|
||||
normalized provider quota windows (`X% left`, not per-response costs).
|
||||
|
||||
Usage surfaces normalize common provider-native field aliases before display.
|
||||
For OpenAI-family Responses traffic, that includes both `input_tokens` /
|
||||
`output_tokens` and `prompt_tokens` / `completion_tokens`, so transport-specific
|
||||
field names do not change `/status`, `/usage`, or session summaries.
|
||||
|
||||
## Cost estimation (when shown)
|
||||
|
||||
Costs are estimated from your model pricing config:
|
||||
|
||||
Reference in New Issue
Block a user