{"record":{"id":"ded8df1da524a62f","repo":"BigPizzaV3/CodexPlusPlus","slug":"http","errorCode":null,"errorMessage":"HTTP {}：{}","messagePattern":"HTTP (.+?)：(.+?)","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/sub2api.rs","lineNumber":67,"sourceCode":"    }\n    let api_key = profile.api_key.trim();\n    if api_key.is_empty() {\n        anyhow::bail!(\"API Key 不能为空\");\n    }\n\n    let endpoint = sub2api_billing_endpoint(base_url);\n    let client = crate::http_client::proxied_client(&profile.user_agent)?;\n    let response = client\n        .get(&endpoint)\n        .bearer_auth(api_key)\n        .header(\"x-api-key\", api_key)\n        .send()\n        .await\n        .with_context(|| format!(\"请求 {endpoint} 失败\"))?;\n    let status = response.status();\n    let body = response.text().await.unwrap_or_default();\n    if !status.is_success() {\n        anyhow::bail!(\n            \"HTTP {}：{}\",\n            status.as_u16(),\n            sub2api_error_message(&body).unwrap_or_else(|| \"上游拒绝读取倍率\".to_string())\n        );\n    }\n    let parsed: Sub2ApiBillingResponse =\n        serde_json::from_str(&body).context(\"倍率接口没有返回有效 JSON\")?;\n    validate_sub2api_billing_response(&parsed)?;\n    Ok(Sub2ApiBillingInfo {\n        endpoint,\n        group_rate_multiplier: parsed.group_rate_multiplier,\n        user_rate_multiplier: parsed.user_rate_multiplier,\n        resolved_rate_multiplier: parsed.resolved_rate_multiplier,\n        peak_rate_enabled: parsed.peak_rate_enabled,\n        peak_rate_multiplier: parsed.peak_rate_multiplier,\n        applied_peak_multiplier: parsed.applied_peak_multiplier,\n        effective_rate_multiplier: parsed.effective_rate_multiplier,\n        observed_at: parsed.observed_at,","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/sub2api.rs#L49-L85","documentation":"Thrown by fetch_sub2api_billing_info when the billing endpoint responds with a non-success HTTP status: {status} and the response body text are formatted into the message. The offending input is the upstream sub2api service's answer (bad key, quota, outage); unlike network errors this fires after a completed HTTP exchange.","triggerScenarios":"Thrown at crates/codex-plus-core/src/sub2api.rs:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["根据状态码检查 API Key 与 Base URL 是否正确","确认上游是 sub2api 且暴露 /v1/sub2api/billing 端点","检查 Key 是否有计费查询权限"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}