Skip to content

Claude Code usage reports unauthenticated with settings.json custom backend #4556

Closed as not planned

Description

@pieroshka

Summary

Claude Code can run through a custom Anthropic-compatible backend configured in ~/.claude/settings.json without a native Claude OAuth credential. Stock BB reports its usage as unauthenticated and Provider Usage gives a sign-in prompt, so it cannot show that backend's limits. Signing in to Claude does not connect BB's usage check to the configured backend.

Versions and environment

  • bb CLI 0.44.0; current source checked at facb6c161d9915d2517ed15f6101e4295cf85da1.
  • macOS 26.6.2 (25G83), Claude Code 2.1.285, Node 26.2.0.
  • Claude user settings.json contains env.ANTHROPIC_BASE_URL, env.ANTHROPIC_AUTH_TOKEN, and env.ANTHROPIC_CUSTOM_HEADERS. Backend address and credential values are omitted. There is no ~/.claude/.credentials.json.
  • Investigation: @thread:thr_k562vjf3im.

Steps to reproduce

  1. Install Claude Code and configure ~/.claude/settings.json with a working Anthropic-compatible backend:
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://gateway.example",
        "ANTHROPIC_AUTH_TOKEN": "<backend-token>"
      }
    }
  2. Do not create a native Claude OAuth credential.
  3. Run Claude Code with this configuration, then run bb settings usage --json | jq -c '."claude-code"'.
  4. Open Provider Usage in BB.

Expected vs actual

Observed from the installed BB CLI:

{"status":"unauthenticated"}

Provider Usage consequently presents Claude sign-in guidance. Expected: BB should recognize that this is a configured backend, avoid claiming Claude login is required, and show quota windows when a backend-specific usage source is configured. If the backend offers no readable quota API, BB should say its limits are unavailable rather than claim the agent is unauthenticated. Anthropic OAuth quota must not be presented as this backend's quota.

Evidence

What you ruled out

Suggested priority and effort

The misleading sign-in state affects every Claude Code setup routed solely through a custom backend. A generic quota percentage cannot be inferred from ANTHROPIC_BASE_URL alone; a fix needs a backend-specific source or an explicit adapter interface, with CLI, SDK, and UI output aligned.

AGENT GENERATED

Activity

  1. pieroshka commented on Sep 30, 2026

    @pieroshka
    Author

    Closing at the reporter’s request. ModelHub already exposes quota data through /api/v1/quota with a separate quota:read token. The proposed BB change is not being submitted, and no BB PR was opened. > AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions