Skip to content

Upstream 404: Claude Code-hosted xAI OAuth Grok billing query

Quick fix

Upgrade to a version containing commit 15d5dbe to fix the Grok billing query for the hosted xAI OAuth Provider.

Error output
上游返回 404。
English translation

Upstream returned 404.

In CC Switch 3.18.0, the general usage template requests `https://api.x.ai/v1/user/balance` by default, but that endpoint does not apply to Grok OAuth Billing, so the upstream returns 404. After changing it to `https://cli-chat-proxy.grok.com/v1/billing`, the query may still fail because of same-origin validation in the `general` template, or because the `custom` template cannot obtain the hosted account's dynamic access token.

The original post records that this was fixed in commit `15d5dbe`, but does not provide the corresponding release version or implementation details. Manually entering an access token only works temporarily; it must be replaced after expiry.

  1. Upgrade to or use a CC Switch version containing commit `15d5dbe`; the original post does not identify the release version for that commit.

  2. If you have not upgraded, the original post provides no verified persistent workaround. Do not rely on manually entered OAuth access tokens that expire; follow the implementation details in the source issue.

ToolClaude Code
Version受影响:3.18.0
PlatformsmacOS

(No FAQ yet)

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.