Anthropic API-key requests fail with "credit balance is too low"
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
調査の方向性
Start with the system block in src/eca/llm_providers/anthropic.clj around line 546 and trace how authentication type is passed into chat!. Check linked pull request #667 for work already underway. Done means API-key requests omit the identity block while OAuth requests retain it, with the issue's reproduced API behavior addressed.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
With an Anthropic API key (provider key, ANTHROPIC_API_KEY, or the Console login), every chat
fails with Anthropic invalid_request_error: Your credit balance is too low to access the Anthropic API,
though the key has credits. The cause is the system block chat! prepends for every auth type,
"You are Claude Code, Anthropic's official CLI for Claude."
(anthropic.clj#L546).
The same key succeeds when that block is absent.
To Reproduce
curl -s https://api.anthropic.com/v1/messages -H "x-api-key: $KEY" \
-H 'anthropic-version: 2023-06-01' -H 'content-type: application/json' \
-d '{"model":"claude-sonnet-5-5","max_tokens":5,"messages":[{"role":"user","content":"hi"}]}'
# 200
curl -s https://api.anthropic.com/v1/messages -H "x-api-key: $KEY" \
-H 'anthropic-version: 2023-06-01' -H 'content-type: application/json' \
-d '{"model":"claude-sonnet-5-5","max_tokens":5,"messages":[{"role":"user","content":"hi"}],
"system":[{"type":"text","text":"You are Claude Code, Anthropic'\''s official CLI for Claude."}]}'
# 400 "Your credit balance is too low to access the Anthropic API..."
In ECA: configure an anthropic provider with an API key and send any prompt.
Expected behavior
API-key requests omit the identity block; only OAuth (subscription) requests send it.
Doctor
ECA 0.166.0 (also current master 26176a3), macOS. Seen with claude-sonnet-5-5 and claude-haiku-5-5.
- 主要言語
- Clojure
- スター
- 1k
- フォーク
- 82
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 21
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
editor-code-assistant/eca のほかの issue
-
Models doesn't work when fetchModels: false is used対応中かも @zikajk が 8 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
editor-code-assistant/eca#661 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 4/5 1〜2日 初心者へのやさしさ 54/100
editor-code-assistant/eca#674 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
editor-code-assistant/eca#672 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
editor-code-assistant/eca#671 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
editor-code-assistant/eca#670 ·
メンテナーはふだん 2 日以内に返信
editor-code-assistant/eca の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
clojure-emacs/cider#4224 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
.Needs Triage Priority:P3 Type:Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
metabase/metabase#85686 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
defold/defold#13578 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信