[GH-ISSUE #1046] [BUG]: Unhandled Anthropic error #645

Closed
opened 2026-02-22 18:20:37 -05:00 by yindo · 1 comment
Owner

Originally created by @timothycarambat on GitHub (Apr 5, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1046

Originally assigned to: @timothycarambat on GitHub.

How are you running AnythingLLM?

Not listed

What happened?

When a key is rate limited the user sends a chat there is an unhandled Anthropic error.

Reproduction log

 Found 1 pinned sources - prepending to content with ~29725 tokens of content.
/home/ubuntu/anything-llm/server/node_modules/@anthropic-ai/sdk/error.js:58
            return new RateLimitError(status, error, message, headers);
                   ^

RateLimitError: 429 {"type":"error","error":{"type":"rate_limit_error","message":"Number of request tokens has exceeded your rate limit (https://docs.anthropic.com/claude/reference/rate-limits). Please reduce the the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://www.anthropic.com/contact-sales to discuss your options for a rate limit increase."}}
    at APIError.generate (/home/ubuntu/anything-llm/server/node_modules/@anthropic-ai/sdk/error.js:58:20)
    at Anthropic.makeStatusError (/home/ubuntu/anything-llm/server/node_modules/@anthropic-ai/sdk/core.js:263:33)
    at Anthropic.makeRequest (/home/ubuntu/anything-llm/server/node_modules/@anthropic-ai/sdk/core.js:306:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async MessageStream._createMessage (/home/ubuntu/anything-llm/server/node_modules/@anthropic-ai/sdk/lib/MessageStream.js:114:24) {
  status: 429,
  headers: {
    'anthropic-ratelimit-requests-limit': '5',
    'anthropic-ratelimit-requests-remaining': '4',
    'anthropic-ratelimit-requests-reset': '2024-04-05T16:09:00Z',
    'anthropic-ratelimit-tokens-limit': '300000',
    'anthropic-ratelimit-tokens-remaining': '0',
    'anthropic-ratelimit-tokens-reset': '2024-04-06T00:00:00Z',
   ....
  },
  error: {
    type: 'error',
    error: {
      type: 'rate_limit_error',
      message: 'Number of request tokens has exceeded your rate limit (https://docs.anthropic.com/claude/reference/rate-limits). Please reduce the the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://www.anthropic.com/contact-sales to discuss your options for a rate limit increase.'
    }
  }
}

Are there known steps to reproduce?

Send a chat on a rate limited Anthropic key that sends more text then the key allows.

Originally created by @timothycarambat on GitHub (Apr 5, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1046 Originally assigned to: @timothycarambat on GitHub. ### How are you running AnythingLLM? Not listed ### What happened? When a key is rate limited the user sends a chat there is an unhandled Anthropic error. Reproduction log ``` Found 1 pinned sources - prepending to content with ~29725 tokens of content. /home/ubuntu/anything-llm/server/node_modules/@anthropic-ai/sdk/error.js:58 return new RateLimitError(status, error, message, headers); ^ RateLimitError: 429 {"type":"error","error":{"type":"rate_limit_error","message":"Number of request tokens has exceeded your rate limit (https://docs.anthropic.com/claude/reference/rate-limits). Please reduce the the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://www.anthropic.com/contact-sales to discuss your options for a rate limit increase."}} at APIError.generate (/home/ubuntu/anything-llm/server/node_modules/@anthropic-ai/sdk/error.js:58:20) at Anthropic.makeStatusError (/home/ubuntu/anything-llm/server/node_modules/@anthropic-ai/sdk/core.js:263:33) at Anthropic.makeRequest (/home/ubuntu/anything-llm/server/node_modules/@anthropic-ai/sdk/core.js:306:30) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MessageStream._createMessage (/home/ubuntu/anything-llm/server/node_modules/@anthropic-ai/sdk/lib/MessageStream.js:114:24) { status: 429, headers: { 'anthropic-ratelimit-requests-limit': '5', 'anthropic-ratelimit-requests-remaining': '4', 'anthropic-ratelimit-requests-reset': '2024-04-05T16:09:00Z', 'anthropic-ratelimit-tokens-limit': '300000', 'anthropic-ratelimit-tokens-remaining': '0', 'anthropic-ratelimit-tokens-reset': '2024-04-06T00:00:00Z', .... }, error: { type: 'error', error: { type: 'rate_limit_error', message: 'Number of request tokens has exceeded your rate limit (https://docs.anthropic.com/claude/reference/rate-limits). Please reduce the the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://www.anthropic.com/contact-sales to discuss your options for a rate limit increase.' } } } ```` ### Are there known steps to reproduce? Send a chat on a rate limited Anthropic key that sends more text then the key allows.
yindo added the bug label 2026-02-22 18:20:37 -05:00
yindo closed this issue 2026-02-22 18:20:37 -05:00
Author
Owner

@timothycarambat commented on GitHub (Apr 5, 2024):

'anthropic-ratelimit-tokens-limit': '300000',
Looks like an account level restriction we will need to handle.

@timothycarambat commented on GitHub (Apr 5, 2024): `'anthropic-ratelimit-tokens-limit': '300000',` Looks like an account level restriction we will need to handle.
yindo changed title from [BUG]: Unhandled Anthropic error to [GH-ISSUE #1046] [BUG]: Unhandled Anthropic error 2026-06-05 14:36:27 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#645