Skip to content

feat(usage): record non-streaming /chat/completions (Task #7)#23

Open
lubobill1990 wants to merge 1 commit into
feat/06-usage-recorderfrom
feat/07-wire-nonstreaming-chat
Open

feat(usage): record non-streaming /chat/completions (Task #7)#23
lubobill1990 wants to merge 1 commit into
feat/06-usage-recorderfrom
feat/07-wire-nonstreaming-chat

Conversation

@lubobill1990
Copy link
Copy Markdown
Collaborator

Records 1 usage_events row per non-streaming OpenAI chat call.

Refs #7

🤖 Generated with Claude Code

After a successful non-streaming OpenAI response, the handler builds a NormalizedUsage from response.usage and calls recordUsage with status='ok', the chosen account, durationMs, requestId. On thrown errors before the recorder, a status='error' event with zero tokens is written. The x-internal-pricing-sync: 1 header is honored via isInternal.

Streaming branch unchanged (Task #8 owns it).

Refs #7

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant