mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-09 02:47:45 +08:00
fix(claude-code): 额度查询携带 x-app/claude-cli UA 以获取 cedar_ember,并在无重置机会时显式清空
This commit is contained in:
@@ -11,7 +11,7 @@ use crate::quota_refresh::ProviderPoolQuotaRequestSpec;
|
||||
pub const CLAUDE_CODE_OAUTH_USAGE_URL: &str =
|
||||
"https://api.anthropic.com/api/oauth/usage?cedar_ember=1&skip_spend=1";
|
||||
pub const CLAUDE_CODE_OAUTH_BETA: &str = "oauth-2025-04-20";
|
||||
pub const CLAUDE_CODE_USAGE_USER_AGENT: &str = "claude-code/2.1.284";
|
||||
pub const CLAUDE_CODE_USAGE_USER_AGENT: &str = "claude-cli/2.1.284 (external, cli)";
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct ClaudeCodeProviderPoolAdapter;
|
||||
@@ -58,6 +58,8 @@ pub fn build_claude_code_pool_quota_request(
|
||||
"anthropic-beta".to_string(),
|
||||
CLAUDE_CODE_OAUTH_BETA.to_string(),
|
||||
),
|
||||
// The reset-credit (`cedar_ember`) block is only returned to first-party CLI callers.
|
||||
("x-app".to_string(), "cli".to_string()),
|
||||
(
|
||||
"user-agent".to_string(),
|
||||
CLAUDE_CODE_USAGE_USER_AGENT.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user