Skip to content

[FEATURE]: Support OpenAI service tier (flex/priority processing) #7511

Closed

Description

@maheshrijal

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

OpenAI’s API supports selecting a processing/service tier. Although this can be expensive, but getting things done quickly for urgent tasks would be a great feature. Please add support for this in OpenCode.

Upstream reference: openai/codex#2916

Activity

  1. added
    discussion
    on Jan 9, 2026
  2. emamulandalib commented on Jan 11, 2026

    @emamulandalib

    So far I found it was introduced 2 months ago already as part of this PR #4914 (get codex working in copilot)

    Tested with below configuration already and it's working but yes redundant value to handle. I guess here we need a good config design.

    "agent": {
        "plan": { "options": { "serviceTier": "flex" } },
        "title": { "options": { "serviceTier": "flex" } },
        "build": { "options": { "serviceTier": "flex" } }
      },
    

    The config will be parsed here...

    const openaiOptions = await parseProviderOptions({
    provider: "openai",
    providerOptions,
    schema: openaiResponsesProviderOptionsSchema,
    })

    ...and it will be sent to API.

    Then, the repsonse will be captured for stream or non-stream

    if (typeof response.service_tier === "string") {
    providerMetadata.openai.serviceTier = response.service_tier
    }

    if (typeof value.response.service_tier === "string") {
    serviceTier = value.response.service_tier
    }

    Added some logs to verify

    timestamp            duration  provider  model       agent  requested  response
    2026-01-11T22:04:35  +1ms      openai    gpt-5.2     build  flex       flex
    2026-01-11T22:04:35  +549ms    openai    gpt-5-nano  title  flex       flex
    2026-01-11T22:04:38  +1006ms   openai    gpt-5.2     build  flex       flex
    2026-01-11T22:04:42  +402ms    openai    gpt-5.2     build  flex       flex
    2026-01-11T22:04:54  +1324ms   openai    gpt-5.2     build  flex       flex
    2026-01-11T22:04:59  +122ms    openai    gpt-5.2     build  flex       flex
    

    This works as well at model level configuration. I guess we need to update the documentation and the config schema https://opencode.ai/config.json.

  3. aarock1234 commented on Jan 23, 2026

    @aarock1234

    Bump; would be useful to have. Cursor has it under its GPT-... Fast models.

  4. djosh34 commented on Jan 31, 2026

    @djosh34

    This works as well at model level configuration. I guess we need to update the documentation and the config schema https://opencode.ai/config.json.

    How/Where to put this now in opencode.json?

  5. waclawthedev commented on Feb 1, 2026

    @waclawthedev

    I use it with config:

    "provider": {
            "openai": {
                "models": {
                    "gpt-5.2": {
                        "options": {
                            "serviceTier": "flex"
                        }
                    }
                }
            },
    ...
    
  6. djosh34 commented on Feb 1, 2026

    @djosh34

    I use it with config:

    "provider": {
            "openai": {
                "models": {
                    "gpt-5.2": {
                        "options": {
                            "serviceTier": "flex"
                        }
                    }
                }
            },
    ...
    

    Amazing, added a PR for the docs only:

    #11643

  7. waclawthedev commented on Feb 1, 2026

    @waclawthedev
  8. djosh34 commented on Feb 1, 2026

    @djosh34

    @djosh34 FYI #11599

    when testing i couldn't get serviceTier to work with camelcase like your example shows, only with snake_case

  9. djosh34 commented on Feb 1, 2026

    @djosh34

    @djosh34 FYI #11599

    open to merging my changes in your PR though

  10. djosh34 commented on Feb 1, 2026

    @djosh34

    @djosh34 FYI #11599

    when testing i couldn't get serviceTier to work with camelcase like your example shows, only with snake_case

    nvm this comment, this is only if you don't add it to config like your PR

  11. waclawthedev commented on Feb 2, 2026

    @waclawthedev

    @djosh34 check again your point.
    To test your finding I added logging here: https://github.com/waclawthedev/opencode/commit/1bdfd4e3980e19cfe88ccf6fc24070a298ca72bc
    So:

    • with "service_tier": "flex" in config model return serviceTier=default
    • with "serviceTier": "flex" in config model returns serviceTier=flex
  12. github-actions commented on Apr 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions