Using the Proxy results in a 404

Resolved 💬 12 comments Opened Jun 4, 2025 by sterankin Closed Nov 30, 2025

Any help being able to see the request Claude uses as I am getting a 404 and i would like to see the url and api request claude is using to access my AWS Bedrock claude model.

Note my url and request works in curl and postman. for example:

curl --request POST \
  --url https://my-company-url-api-endpoint/bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0 \
  --header 'Authorization: Bearer {{BearerToken}}' \
  --header 'content-type: application/json' \
  --data '{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "text": "Give me joke"
        }
      ]
    }
  ],
  "system": [
    {
      "text": "You are a helpful assistant."
    }
  ]
}'

I have a get_proxy_token.sh file which successfully gets a Bearer token ok. For example I can run:

~/.claude/get_proxy_token.sh

and it echos the token and sets the ACCESS_TOKEN env variable.

In my Claude settings.json (/Users/me/.claude/settings.json) I have the following settings:

{
  "env": {
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "ANTHROPIC_BEDROCK_BASE_URL": "https://my-company-url-api-endpoint/bedrock/",
    "CLAUDE_CODE_SKIP_BEDROCK_AUTH": "1",
    "ANTHROPIC_MODEL": "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
  },
  "apiKeyHelper": "/Users/me/.claude/get_proxy_token.sh",
  "CLAUDE_CODE_API_KEY_HELPER_TTL_MS": 3600000
}

Claude output in terminal:

> summarise this project
  ⎿  API Error: 404 Resource not found

I have tried adding --verbose and --debug flags when running claude code but i cannot see the output anywhere.

Any ideas why this might not be working and how I can debug it?

EDIT:

2 things. Claude code is adding _/invoke_ or _/invoke-with-stream_ to the url path at the end. I had to account for this in my api gateway as it was giving a 404.

However:

I added the following line to my shell script which gets the token:

echo "Script called at $(date)" >> /tmp/proxy_token_called.log

I can tell that claude code is not calling my apiKeyHelper file as the log is out output to the tmp file. It does output when I manually run the .sh file. The path is correct and it the script is executable.

Any ideas why claude is not running this file?

View original on GitHub ↗

This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗