fix(models): update pricing and add test skip flags - #993
Conversation
Updated pricing calculations for Perplexity models. Added `test: "skip"` flags for specific provider configurations to improve testing workflow. Adjusted deactivation dates.
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
WalkthroughAdds test: "skip" flags to multiple provider entries across Anthropic, OpenAI, and xAI models; introduces an alternate discount provider for GPT-5; updates a Google model’s deactivation date; and normalizes Perplexity pricing values using fractional expressions. No control-flow code changes; only configuration/data updates. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant R as Model Router
participant P as Provider
rect rgb(238,245,255)
note over R: Filter providers where provider.test !== "skip"
C->>R: Request (modelId)
R->>R: Resolve model providers
R->>R: Exclude test: "skip"
end
alt OpenAI gpt-5
opt Routeway discount available
note over R: Select discount provider if eligible
end
R->>P: Forward request (pricing/context per provider)
P-->>R: Response
else Other providers
R->>P: Forward request
P-->>R: Response
end
R-->>C: Response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/models/src/models/anthropic.ts(5 hunks)packages/models/src/models/google.ts(1 hunks)packages/models/src/models/openai.ts(1 hunks)packages/models/src/models/perplexity.ts(3 hunks)packages/models/src/models/xai.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: This is a pure TypeScript project—do not useanyoras anyunless absolutely necessary
Always use top-level ES imports; never userequireor dynamicimport()
Files:
packages/models/src/models/google.tspackages/models/src/models/openai.tspackages/models/src/models/perplexity.tspackages/models/src/models/xai.tspackages/models/src/models/anthropic.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Always use top-level import; never use require() or dynamic import()
Files:
packages/models/src/models/google.tspackages/models/src/models/openai.tspackages/models/src/models/perplexity.tspackages/models/src/models/xai.tspackages/models/src/models/anthropic.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: test / run
- GitHub Check: lint / run
- GitHub Check: generate / run
- GitHub Check: build / run
- GitHub Check: e2e-shards (4)
- GitHub Check: e2e-shards (1)
- GitHub Check: e2e-shards (2)
- GitHub Check: e2e-shards (3)
- GitHub Check: autofix
🔇 Additional comments (5)
packages/models/src/models/xai.ts (1)
12-12: LGTM!The addition of
test: "skip"flags to these provider entries is consistent with the PR's objective to improve testing workflows by allowing selective test skipping.Also applies to: 102-102, 243-243
packages/models/src/models/openai.ts (1)
398-422: LGTM!The addition of the
routeway-discountprovider for GPT-5 follows the established pattern seen in other models (e.g., GPT-5 Mini, GPT-5 Nano). The configuration includes thereasoningOutput: "omit"field specific to the discount path, which is consistent with similar entries.packages/models/src/models/google.ts (1)
506-506: Verify the deactivation date.The
deactivatedAtdate is set to October 8, 2025, which is in the recent past. Please confirm this date is correct and that the model should indeed be deactivated at this time.packages/models/src/models/perplexity.ts (1)
62-63: LGTM!The pricing representation has been normalized to use fractional expressions, which improves consistency with other models in the codebase.
packages/models/src/models/anthropic.ts (1)
72-72: LGTM!The addition of
test: "skip"flags to these Claude model provider entries is consistent with the PR's objective to improve testing workflows. This allows for selective test execution without affecting the model configurations themselves.Also applies to: 87-87, 113-113, 198-198, 213-213
| inputPrice: 2 / 1e6, | ||
| outputPrice: 8 / 1e6, | ||
| requestPrice: 5.0 / 1000, |
There was a problem hiding this comment.
🧩 Analysis chain
Verify the pricing changes for sonar-reasoning-pro.
The changes introduce actual pricing modifications, not just formatting:
- Input price decreased: from $3/M tokens to $2/M tokens
- Output price decreased: from $10/M tokens to $8/M tokens
- Request price increased: from $0 to $5 per 1,000 requests
Please confirm these pricing changes are intentional and accurate according to Perplexity's current pricing.
🌐 Web query:
What are the current pricing rates (input token price USD, output token price USD, request price per 1,000 requests) for Perplexity AI’s sonar-reasoning-pro and sonar-pro plans?
💡 Result:
As of Oct 6, 2025 — Perplexity's docs list:
-
Sonar Reasoning Pro: input $2 per 1M tokens; output $8 per 1M tokens; request fee (per 1K requests) = $14 / $10 / $6 for High / Medium / Low search-context sizes. [1]
-
Sonar Pro: input $3 per 1M tokens; output $15 per 1M tokens; request fee (per 1K requests) = $14 / $10 / $6 for High / Medium / Low search-context sizes. [2]
Sources: Perplexity model docs — Sonar Reasoning Pro and Sonar Pro. [1] (docs.perplexity.ai) [2] (docs.perplexity.ai)
Citations:
- 1: https://docs.perplexity.ai/getting-started/models/models/sonar-reasoning-pro?utm_source=openai
- 2: https://docs.perplexity.ai/getting-started/models/models/sonar-pro?utm_source=openai
Align requestPrice with published tiered fees.
The current requestPrice: 5.0/1000 ($5/1K) does not match Perplexity’s documented rates ($14/1K, $10/1K, $6/1K for High/Medium/Low). Update both the Sonar Reasoning Pro and Sonar Pro entries in packages/models/src/models/perplexity.ts to reflect these three tiers.
🤖 Prompt for AI Agents
In packages/models/src/models/perplexity.ts around lines 14 to 16, replace the
incorrect requestPrice value (5.0/1000) for both Sonar Reasoning Pro and Sonar
Pro entries with tiered rates matching Perplexity docs: set High to 14/1000,
Medium to 10/1000, and Low to 6/1000 (keep inputPrice/outputPrice unchanged);
ensure each entry's requestPrice reflects the appropriate High/Medium/Low tier
numeric value (e.g., 14/1000) instead of the old 5.0/1000.
| inputPrice: 3 / 1e6, | ||
| outputPrice: 15 / 1e6, | ||
| requestPrice: 5.0 / 1000, |
There was a problem hiding this comment.
🧩 Analysis chain
Verify the request price increase for sonar-pro.
The requestPrice changed from 0 to 5.0 / 1000 ($5 per 1,000 requests). Please confirm this pricing change is intentional and matches Perplexity's current pricing.
🌐 Web query:
What is Perplexity AI’s current sonar-pro API pricing per 1,000 requests?
💡 Result:
Sonar Pro request fee: $14 / $10 / $6 per 1,000 requests for High / Medium / Low search-context sizes. [1][2]
Align Sonar Pro requestPrice with official pricing
The snippet sets requestPrice: 5.0 / 1000 ($5 per 1 000), but Perplexity’s current Sonar Pro fees are $6/$10/$14 per 1 000 requests (low/medium/high search-context). Confirm which tier applies and update requestPrice to match.
🤖 Prompt for AI Agents
In packages/models/src/models/perplexity.ts around lines 38 to 40, the
requestPrice is set to 5.0/1000 but Perplexity Sonar Pro pricing is $6/$10/$14
per 1,000 requests depending on tier; confirm which Sonar Pro tier
(low/medium/high search‑context) this model should use and update requestPrice
to the matching numeric value (e.g., 6.0/1000, 10.0/1000, or 14.0/1000) so the
constant reflects the official per‑1k price.
Updated pricing calculations for Perplexity models. Added
test: "skip"flags for specific provider configurations to improve testing workflow. Adjusted deactivation dates.Summary by CodeRabbit
New Features
Chores
Tests