Skip to content

feat(usage): record /v1/messages (Task #10)#26

Open
lubobill1990 wants to merge 1 commit into
feat/09-wire-embeddingsfrom
feat/10-wire-anthropic-messages
Open

feat(usage): record /v1/messages (Task #10)#26
lubobill1990 wants to merge 1 commit into
feat/09-wire-embeddingsfrom
feat/10-wire-anthropic-messages

Conversation

@lubobill1990
Copy link
Copy Markdown
Collaborator

Refs #10

🤖 Generated with Claude Code

The /v1/messages route translates Anthropic→OpenAI before sending, so we use the OpenAI accumulator to capture usage. endpoint='messages', upstreamFormat='anthropic' tags the API surface.

Stream branch: feed every chunk into accumulator, finalize on close (ok/aborted/error). Non-stream: normalize response.usage. Errors before the upstream call write a status='error' row.

Refs #10

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