Skip to content

Add OpenAI service tier channel pricing - #1

Closed
69gg wants to merge 2 commits into
mainfrom
feat/openai-service-tier-ratios
Closed

69gg wants to merge 2 commits into
mainfrom
feat/openai-service-tier-ratios

Conversation

@69gg

@69gg 69gg commented Mar 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add channel-level service_tier ratio mapping for OpenAI channels
  • apply pricing based on the final upstream service_tier after filtering and overrides
  • expose service_tier pricing details in channel settings and usage logs

Testing

  • unable to run go test in the current sandbox because module downloads are blocked by network restrictions

Open with Devin

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17937e4ab0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread relay/helper/price.go Outdated
Comment on lines +135 to +137
if err = applyChannelServiceTierPricing(c, info, &priceData); err != nil {
logger.LogWarn(c, fmt.Sprintf("resolve service_tier pricing failed: %v", err))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Recompute service-tier ratio after channel retry selection

Applying applyChannelServiceTierPricing here locks PriceData.ServiceTierRatio and QuotaToPreConsume to the channel chosen before request execution, but the retry path can switch channels later (getChannel + SetupContextForSelectedChannel in controller/relay.go) without rerunning pricing. If the fallback channel has different service_tier overrides or service_tier_ratios, both settlement and logs use the stale multiplier from the failed channel, causing incorrect billing on retried requests.

Useful? React with 👍 / 👎.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@69gg

69gg commented Mar 28, 2026

Copy link
Copy Markdown
Owner Author

Closing this because the correct upstream PR is now open at QuantumNous#3482.

@69gg 69gg closed this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant