Skip to content

2026 01 04 reasoning tokens not passing through from openrouter to chatopenai

The error message indicates that there was an issue with the completion response from the Anthropic API. The native finish reason is 'stop', which suggests that the API encountered an error and stopped processing the request.

To troubleshoot this issue, you can try the following:

  1. Check the API documentation to ensure that you are using the correct parameters and formatting.
  2. Verify that your token is valid and not expired.
  3. Try sending a new request with different parameters or formatting to see if the error persists.
  4. If you are using a caching mechanism, clear the cache and try again.

Additionally, the output suggests that the API returned an error message indicating that your token was exposed in your PR description. This is likely a security warning from the Anthropic team, and it's recommended to rotate your token to prevent any potential security risks.

To resolve this issue, you can take the following steps:

  1. Rotate your token by following the instructions provided by the Anthropic team.
  2. Review your code and ensure that you are not exposing sensitive information in your API requests.
  3. Implement proper error handling mechanisms to catch and handle any errors that may occur during API requests.

By taking these steps, you should be able to resolve the issue and get back to generating content with the Anthropic API.

Reference