Verify Pricing
Reygent tracks per-provider token pricing in src/pricing.ts to estimate workflow costs. The verify-pricing skill checks these values against live provider documentation and keeps them up to date.
Running the Skill
In a Claude Code session inside the reygent repo:
/verify-pricingNo CLI command or build step required — this is a Claude Code skill, not a reygent command.
What It Does
- Reads the
PROVIDER_PRICINGobject insrc/pricing.ts - Fetches each provider's pricing page (stored in
pricingUrl) - Compares three fields per provider:
inputCostPerMillion— cost per 1M input tokens (USD)outputCostPerMillion— cost per 1M output tokens (USD)cacheDiscountRate— fraction saved on cached tokens (0–1 scale)
- Reports a comparison table with match/mismatch/unable-to-verify status
- Applies updates:
- All fields match → auto-updates
lastVerifiedto today - Mismatches found → lists suggested changes, waits for confirmation before editing
- Unable to verify → field skipped, no changes applied
- All fields match → auto-updates
Pricing Data Structure
Each provider entry in src/pricing.ts looks like this:
typescript
claude: {
inputCostPerMillion: 3.00,
outputCostPerMillion: 15.00,
cacheDiscountRate: 0.90,
supportsCaching: true,
defaultModel: "claude-sonnet-4-5-20250929",
pricingUrl: "https://www.anthropic.com/pricing",
lastVerified: "2026-05-08",
},| Field | Type | Description |
|---|---|---|
inputCostPerMillion | number | USD per 1M input tokens |
outputCostPerMillion | number | USD per 1M output tokens |
cacheDiscountRate | number | Fraction saved on cached tokens (0.90 = 90% savings, pay 10%) |
supportsCaching | boolean | Whether provider supports prompt caching |
defaultModel | string | Model these prices apply to |
pricingUrl | string | URL fetched during verification |
lastVerified | string | ISO date of last successful verification |
Example Output
Provider Field Current Actual Status
──────────────────────────────────────────────────────────────────────
claude inputCostPerMillion $3.00/M $3.00/M ✓ match
claude outputCostPerMillion $15.00/M $15.00/M ✓ match
claude cacheDiscountRate 90% 90% ✓ match
claude lastVerified 2026-05-15 ✓ verified
codex inputCostPerMillion $2.50/M $2.50/M ✓ match
codex outputCostPerMillion $15.00/M $15.00/M ✓ match
codex cacheDiscountRate 90% 90% ✓ match
openrouter inputCostPerMillion $3.00/M $3.00/M ✓ match
openrouter outputCostPerMillion $15.00/M $15.00/M ✓ match
openrouter cacheDiscountRate 50% ? unable to verify
──────────────────────────────────────────────────────────────────────
All verified pricing matches current provider documentation.
Apply these changes? (y/n)Cache Discount Rate Normalization
Provider docs express caching savings in different formats. The skill normalizes all of them to a 0–1 decimal representing the fraction saved:
| Doc Format | Meaning | Normalized Rate |
|---|---|---|
| "90% savings" | Save 90% of cost | 0.90 |
| "billed at 10%" | Pay 10%, save 90% | 0.90 |
| "0.1x base input price" | Pay 10% of base | 0.90 |
| "$0.30 vs $3.00" | Price comparison | 0.90 |
When a provider's caching documentation is ambiguous or missing, the field is marked ? unable to verify rather than guessed.
Update Rules
- Auto-update:
lastVerifieddate updates automatically when all verified fields match - Manual approval: Pricing value changes require user confirmation before applying
- Partial verification: If any field can't be verified,
lastVerifiedis not auto-updated for that provider - No guessing: Fields that can't be extracted from provider docs are skipped, never estimated
Adding a New Provider
To add a provider to pricing verification:
- Add an entry to
PROVIDER_PRICINGinsrc/pricing.tswith all required fields - Add the provider name to the
ProviderNametype union - Set
pricingUrlto a page where token pricing is publicly listed - Run
/verify-pricingto validate the initial values
