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

Closed
opened 2026-02-16 18:10:23 -05:00 by yindo · 2 comments
Owner

Originally created by @duysqubix on GitHub (Feb 5, 2026).

Originally assigned to: @thdxr on GitHub.

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).
Originally created by @duysqubix on GitHub (Feb 5, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] 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).
yindo added the discussiondocs labels 2026-02-16 18:10:23 -05:00
yindo closed this issue 2026-02-16 18:10:23 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 5, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #7511: [FEATURE]: Support OpenAI service tier (flex/priority processing) - directly requests the same feature
  • #11597: [FEATURE]: Cost calculation according to service_tier (OpenAI) - specifically addresses configuring serviceTier in opencode.json and cost calculations

Feel free to ignore if these don't address your specific case.

@github-actions[bot] commented on GitHub (Feb 5, 2026): This issue might be a duplicate of existing issues. Please check: - #7511: [FEATURE]: Support OpenAI service tier (flex/priority processing) - directly requests the same feature - #11597: [FEATURE]: Cost calculation according to service_tier (OpenAI) - specifically addresses configuring serviceTier in opencode.json and cost calculations Feel free to ignore if these don't address your specific case.
Author
Owner

@duysqubix commented on GitHub (Feb 6, 2026):

There are dups found for this.. closing.. Thanks

@duysqubix commented on GitHub (Feb 6, 2026): There are dups found for this.. closing.. Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8608