Skip to content

Conversation

@narengogi
Copy link
Collaborator

@narengogi narengogi commented Nov 18, 2025

Description: (required)

  • This removes region endpoint from url construction when making request to count tokens endpoint because it throws invalid model otherwise

Tests Run/Test cases added: (required)

  • Tested the count tokens endpoint for both anthropic and non anthropic models for with and without region prefix
    example curl:
curl --location 'http://localhost:8787/v1/messages/count_tokens' \
--header 'x-portkey-provider: bedrock' \
--header 'Content-Type: application/json' \
--header 'x-portkey-aws-access-key-id: abc' \
--header 'x-portkey-aws-secret-access-key: abc' \
--header 'x-portkey-aws-region: us-west-2' \
--data-raw '{
    "model": "apac.anthropic.claude-sonnet-4-5-20250929-v1:0",
    "max_tokens": 10,
    "messages": [
      {
        "role": "user",
        "content": "hello there"
      }
    ]
    ]
  }'

Type of Change:

  • Bug fix (non-breaking change which fixes an issue)

@VisargD VisargD merged commit b6eedd3 into Portkey-AI:main Nov 18, 2025
1 check 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.

Count tokens requests to bedrock through claude code throw errrors for incorect model error

2 participants