Skip to content

Feature request: Support OpenCode ChatGPT OAuth auth.json for Codex/ChatGPT quota tracking #78

@ovizii

Description

@ovizii

Hi, I’m using OpenCode with the built-in OpenAI/ChatGPT Plus OAuth login, not an API key. onWatch looks like it can already monitor ChatGPT/Codex quota via the ChatGPT usage endpoints, but it seems to only auto-detect Codex-style credentials from ~/.codex/auth.json or CODEX_HOME/auth.json.

OpenCode stores its OAuth credentials at:

~/.local/share/opencode/auth.json

with a different shape, roughly:

{
  "openai": {
    "type": "...",
    "refresh": "...",
    "access": "...",
    "expires": 1234567890,
    "accountId": "..."
  }
}

onWatch appears to expect Codex-style fields like:

{
  "tokens": {
    "access_token": "...",
    "refresh_token": "...",
    "account_id": "..."
  }
}

Could onWatch support OpenCode’s ChatGPT OAuth credential file directly, either by auto-detecting ~/.local/share/opencode/auth.json or by allowing a provider/profile config that maps this format?

This would let OpenCode users monitor their ChatGPT Plus/Pro quota/reset without setting up separate Codex auth or copying tokens into another file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions