Skip to content

feat(opencode): cost calculation according to service_tier (OpenAI) - #11599

Closed
waclawthedev wants to merge 2 commits into
anomalyco:devfrom
waclawthedev:feat/service_tier_for_openai
Closed

waclawthedev wants to merge 2 commits into
anomalyco:devfrom
waclawthedev:feat/service_tier_for_openai

Conversation

@waclawthedev

@waclawthedev waclawthedev commented Feb 1, 2026 •

Copy link
Copy Markdown

What does this PR do?

Allows to set (override) detailed prices for models by service_tier. It helps to calculate price by reading service_tier from result.

How to verify:

Example of config for get-5.2:

"provider": {
        "openai": {
            "models": {
                "gpt-5.2": {
                    "options": {
                        "serviceTier": "flex"
                    },
                    "cost": {
                        "input": 1.75,
                        "output": 14.00,
                        "cache_read": 0.175,
                        "service_tier": {
                            "default": {
                                "input": 1.75,
                                "output": 14.00,
                                "cache_read": 0.175,
                            },
                            "flex": {
                                "input": 0.875,
                                "output": 7.00,
                                "cache_read": 0.0875,
                            },
                            "priority": {
                                "input": 3.50,
                                "output": 28.00,
                                "cache_read": 0.35,
                            },
                        },
                    }
                }
            }
        },
        ...
  • Try to run model via OpenAI and take a look at logs and actual price in OpenAI

Notes

models.dev is not providing the prices for tiers now but if it will be added from theirs side it will be possible to start reading values in the future

Closes #11597 and maybe #Closes #7511

@github-actions

github-actions Bot commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

Hey! Your PR title [FEATURE]:cost calculation according to service_tier (OpenAI) doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@waclawthedev waclawthedev changed the title [FEATURE]:cost calculation according to service_tier (OpenAI) feat(opencode): cost calculation according to service_tier (OpenAI) Feb 1, 2026
@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Apr 4, 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.

[FEATURE]: Cost calculation according to service_tier (OpenAI) [FEATURE]: Support OpenAI service tier (flex/priority processing)

1 participant