Skip to content

Commit fca5346

Browse files
rinceyuanj-zhangyiyuanSteveSandersonMSCopilot
authored
docs: add missing assistant.usage event fields to streaming-events reference (#2074)
* docs: add missing assistant.usage event fields to streaming-events reference The assistant.usage event table was missing 8 fields that are present in the AssistantUsageData interface: - reasoningTokens: reasoning/chain-of-thought token count - timeToFirstTokenMs: streaming latency (first token) - interTokenLatencyMs: streaming throughput (avg inter-token) - contentFilterTriggered: content filter detection - finishReason: model finish reason (stop/length/content_filter) - reasoningEffort: reasoning effort level used - cacheExpiresAt: prompt cache expiration timestamp - serviceRequestId: server-side request ID for log correlation Also update the quick-reference table at the end of the file to include the key new fields. * docs: correct assistant usage reference Clarify that serviceRequestId identifies the Copilot service request and keep the event quick reference focused on its established key fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: j-zhangyiyuan <j-zhangyiyuan@microsoft.com> Co-authored-by: Steve Sanderson <1101362+SteveSandersonMS@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6371e3f commit fca5346

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

docs/features/streaming-events.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,20 @@ Ephemeral. Token usage and cost information for an individual API call.
443443
| `model` | `string` || Model identifier (e.g., `"gpt-5.4"`) |
444444
| `inputTokens` | `number` | | Input tokens consumed |
445445
| `outputTokens` | `number` | | Output tokens produced |
446+
| `reasoningTokens` | `number` | | Output tokens used for reasoning/chain-of-thought (subset of `outputTokens`) |
446447
| `cacheReadTokens` | `number` | | Tokens read from prompt cache |
447448
| `cacheWriteTokens` | `number` | | Tokens written to prompt cache |
449+
| `cacheExpiresAt` | `string` | | ISO 8601 timestamp when the prompt cache for this model call expires |
450+
| `contentFilterTriggered` | `boolean` | | Whether the response was blocked or truncated by content filtering (`finish_reason === 'content_filter'`) |
451+
| `finishReason` | `string` | | Model finish reason (e.g., `"stop"`, `"length"`, `"tool_calls"`, `"content_filter"`) |
448452
| `cost` | `number` | | Model multiplier cost for billing |
449453
| `duration` | `number` | | API call duration in milliseconds |
454+
| `timeToFirstTokenMs` | `number` | | Time from request dispatch to first token received (streaming latency) |
455+
| `interTokenLatencyMs` | `number` | | Average latency between consecutive tokens (streaming throughput) |
456+
| `reasoningEffort` | `string` | | Reasoning effort level used for this call (e.g., `"low"`, `"medium"`, `"high"`) |
450457
| `initiator` | `string` | | What triggered this call (e.g., `"sub-agent"`); absent for user-initiated |
451458
| `apiCallId` | `string` | | Completion ID from the provider (e.g., `chatcmpl-abc123`) |
459+
| `serviceRequestId` | `string` | | Copilot service request ID (`x-copilot-service-request-id`) for CAPI log correlation |
452460
| `apiEndpoint` | `"/chat/completions" \| "/v1/messages" \| "/responses" \| "ws:/responses"` | | API endpoint used for the model call; useful for observability and cost attribution. `ws:/responses` is the websocket variant of the responses API |
453461
| `providerCallId` | `string` | | GitHub request tracing ID (`x-github-request-id`) |
454462
| `parentToolCallId` | `string` | | Deprecated. Use envelope-level `agentId` for sub-agent attribution |

0 commit comments

Comments
 (0)