docs/crossmodel.md
CrossModel is a multi-provider, OpenAI- and Anthropic-compatible API aggregation platform. You call one API and CrossModel routes the request to the right upstream provider, billing a prepaid wallet.
CrossModel uses API key authentication. Create a key in the CrossModel console. Keys start with cm-.
Set the CROSSMODEL_API_KEY environment variable:
export CROSSMODEL_API_KEY="cm-..."
You can also configure the API key in CodexBar Settings → Providers → CrossModel.
printf '%s' "$CROSSMODEL_API_KEY" | codexbar config set-api-key --provider crossmodel --stdin
The CrossModel provider fetches data from two read-only API endpoints:
Credits API (/v1/credits): Returns the wallet balance (balance_micro), currency, and any in-flight holds (uncollected_micro). All amounts are integer micro units (1 major currency unit = 1,000,000 micro).
Usage API (/v1/usage): Returns currency plus spend, token, and request counts for the current UTC day, ISO week, and calendar month. CodexBar only displays usage spend when /usage currency matches /credits currency.
The CrossModel menu card shows:
codexbar --provider crossmodel
codexbar -p cm # alias
| Variable | Description |
|---|---|
CROSSMODEL_API_KEY | Your CrossModel API key (required) |
CROSSMODEL_API_URL | Override the base API URL (optional, defaults to https://api.crossmodel.ai/v1; loopback HTTP is allowed for local testing) |