Skip to content

[FEATURE]: Support configuring OpenAI service_tier='flex' for chat/completions and document in config #12297

@duysqubix

Description

@duysqubix

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

I am using opencode with OpenAI and want to be able to select the service_tier='flex' option for supported OpenAI models to reduce costs. At present, service_tier is propagated for Responses API, but not for chat/completions requests, and configuration/docs do not clearly document/validate this option.

Enhancement Proposed:

  • Add serviceTier to the OpenAI Responses provider options schema to ensure configuration is typed and documented.
  • Add serviceTier to the OpenAI-compatible chat provider options schema and propagate as service_tier in the chat request body (in openai-compatible-chat-language-model.ts).
  • Update docs (e.g., models.mdx) to illustrate how to use serviceTier: "flex" in opencode.json.
  • Optionally update/add tests to assert that chat and response bodies include service_tier when configured.

Benefits:

  • Full support for OpenAI flexible service tiers (flex and priority) for both response and chat endpoints.
  • Enables users to control cost via configuration for supported models (gpt-5, o3, o4-mini, etc).

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussiondocs

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions