Skip to content

CC Switch does not show the remaining quota - Codex

Quick fix

Codex free accounts cannot query quota due to official API limits, with no direct fix yet; Grok Build usage undercounting requires a source change to streaming…

Error output
For Codex free accounts, CC Switch does not show the remaining quota or the refresh/reset time.

The usage statistics and balance display module of CC Switch has several known problems. For Codex free accounts, official API restrictions prevent CC Switch from fetching and showing the remaining quota and refresh time (Issue #3651). The community has also reported usage problems in other tools: Claude input billing may have a logic difference when deducting cache, so when input is smaller than cache the cost is calculated as 0 (Issue #1191); when a Grok Build session log (updates.jsonl) exceeds 50 MiB, the MAX_GROK_FILE_BYTES limit causes the whole file to be skipped, permanently undercounting usage (Issue #6660).

  1. For the Codex free account quota display problem, there is currently no official fix; wait for a later release with a clearer unavailability notice.

  2. For the Grok Build usage undercounting problem, modify the source to remove the 50 MiB limit and, following the Codex implementation, change whole-file reading to BufReader line-by-line streaming parsing.

    // src-tauri/src/services/session_usage_grokbuild.rs
    const MAX_GROK_FILE_BYTES: u64 = 50 * 1024 * 1024;
    if metadata.len() > MAX_GROK_FILE_BYTES {
    log::warn!("Grok session log too large ({} bytes), skipping: {}", ...);
    return Ok(SessionSyncResult::default());
    }
    let content = fs::read_to_string(file_path)?;
    let events = parse_grok_usage_events(&content);
    let file = fs::File::open(file_path)?;
    let reader = BufReader::new(file);
    for line_result in reader.lines() {
    // 逐行解析 turn_completed 事件
    }
ToolCodex / Grok Build / Claude
Version3.16.1 - 3.20.0 (受影响版本范围)
PlatformsWindowsmacOS
Why does only Grok Build undercount usage while Codex does not?
The Codex reader is streaming and has no size limit, while Grok Build has a 50 MiB MAX_GROK_FILE_BYTES limit; beyond it the whole file is skipped.
Why does Claude input billing sometimes show as 0?
When input is smaller than cache, CC Switch may have a logic difference when computing input cost after cache deduction, resulting in a cost of 0; this issue is being tracked.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.