Skip to content

Enable anthropic count_tokens api to be proxied also#476

Merged
mostlygeek merged 1 commit intomostlygeek:mainfrom
simcop2387:main
Jan 20, 2026
Merged

Enable anthropic count_tokens api to be proxied also#476
mostlygeek merged 1 commit intomostlygeek:mainfrom
simcop2387:main

Conversation

@simcop2387
Copy link
Contributor

@simcop2387 simcop2387 commented Jan 20, 2026

This should hopefully fix any last compatibility issues with #475

Summary by CodeRabbit

  • New Features

    • Added support for the v1/messages/count_tokens endpoint, enabling users to count tokens for message operations through the OpenAI API integration.
  • Documentation

    • Updated API endpoint reference documentation to include the newly supported token counting operation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Walkthrough

This pull request adds support for a new /v1/messages/count_tokens endpoint in the message proxy system. The change includes documentation in README.md and endpoint routing configuration in proxy/proxymanager.go, using the same authentication middleware and handler as existing message-related endpoints.

Changes

Cohort / File(s) Summary
Documentation
README.md
Adds reference to v1/messages/count_tokens endpoint in the OpenAI API supported endpoints list
Endpoint Configuration
proxy/proxymanager.go
Registers new /v1/messages/count_tokens route with existing message endpoint authentication middleware and handler

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling the Anthropic count_tokens API to be proxied, which is confirmed by the changes in README.md and proxy/proxymanager.go.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mostlygeek mostlygeek merged commit 7493618 into mostlygeek:main Jan 20, 2026
3 checks passed
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.

2 participants