Skip to content

Add bundled ClawRouter models and quota integration #99657

Description

@steipete

Problem

OpenClaw has no bundled integration for a credential-scoped ClawRouter catalog. Users must manually duplicate provider configuration, cannot select all models granted to a ClawRouter key, and cannot see that key's managed quota in normal usage surfaces.

An earlier draft implementation in #94012 routes only OpenAI-compatible traffic and uses the package name @openclaw/clawrouter-provider. It also does not expose ClawRouter quota data.

Proposed behavior

  • Bundle the extension as @openclaw/clawrouter and provider id clawrouter.
  • Discover models dynamically from /v1/catalog using the configured key.
  • Route OpenAI-compatible Responses/chat, native Anthropic Messages, and native Gemini streaming through their matching OpenClaw transports.
  • Apply each transport family's replay and tool-schema compatibility policy.
  • Fail closed for catalog rows whose wire format OpenClaw cannot safely produce.
  • Report /v1/usage budget and aggregate request/token/cost data through OpenClaw status and dashboard usage surfaces.
  • Keep the proxy credential out of model metadata and attach it only at request dispatch.

Acceptance criteria

  • Credential-scoped model list uses clawrouter/<provider>/<model> refs.
  • Short live turns pass for every supported catalog model granted to the test key, including OpenAI-compatible, Anthropic, and Gemini families.
  • Invalid catalog credentials produce an explicit authentication diagnostic.
  • Quota/status identifies ClawRouter and displays the available monthly budget and aggregate usage.
  • Focused tests, bundled extension lint, plugin contracts, generated inventory, docs, and remote Linux validation pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.extensions: clawrouterExtension: clawrouterimpact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.maintainerMaintainer-authored PR

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions