Logo

anthropic

#15410000

account_billing_error

Usage is blocked due to insufficient credits. Please visit Plans and Billing to upgrade or purchase credits.

This error has been identified and solved.

Reason

The 400 status error you are encountering, specifically the invalid_request_error with the message "prompt is too long: 345320 tokens > 199999 maximum," is happening because your request exceeds the maximum token limit set by the Anthropic API. The API has a limit of 199,999 tokens per request, and your prompt contains more tokens than this allowed limit.

Solution

To fix the 400 status error due to the prompt exceeding the maximum allowed token limit, you need to adjust the length of your request. Here are some concise solutions:

  • Reduce the length of the prompt or context.

  • Break down the request into smaller, manageable parts if possible.

  • Trim or summarize the content to fit within the token limit.

  • Consider using a different model with a higher token limit, if available.

  • Optimize your request to use fewer tokens while still conveying the necessary information.

Original Error Message

Raw

Usage is blocked due to insufficient credits. Please visit Plans and Billing to upgrade or purchase credits.

Original Error Message

Raw

Usage is blocked due to insufficient credits. Please visit Plans and Billing to upgrade or purchase credits.

Suggested Links

https://docs.anthropic.com/en/api/errors https://community.openai.com/t/error-code-400-max-token-length/716391 https://docs.anthropic.com/en/api/rate-limits https://github.com/langgenius/dify/issues/4009 https://github.com/Aider-AI/aider/issues/861

© 2024 Portkey, Inc. All rights reserved

HIPAA

COMPLIANT

GDPR

Transform Your AI app prototypes to be production-ready

Talk to us →