For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Flex processing

You can continue using Flex processing on supported models as we wind down the beta. Flex is unavailable on GPT-6.2 Astra and GPT-6.2 Sol, and we won’t be adding it to future models. We’ll share the retirement date and migration guidance here once the date is confirmed.

For workloads that can run asynchronously, background mode in the Responses API offers discounted completion windows on supported models. The 2-hour window is 30% below Standard token pricing, and the 8-hour window is 40% below. The discount applies to every eligible request, including follow-ups.

Flex processing provides lower costs for Responses or Chat Completions requests in exchange for slower response times and occasional resource unavailability.

Tokens are priced at Batch API rates, with additional discounts from prompt caching.

API usage

To use Flex processing, set the service_tier parameter to flex in your API request:

Flex processing example
from openai import OpenAI

client = OpenAI(
    # increase default timeout to 15 minutes (from 10 minutes)
    timeout=900.0
)

# you can override the max timeout per request as well
response = client.with_options(timeout=900.0).responses.create(
    model="gpt-6.1-sol",
    instructions="List and describe all the metaphors used in this book.",
    input="<very long text of book here>",
    service_tier="flex",
)

print(response.output_text)

API request timeouts

Due to slower processing speeds with Flex processing, request timeouts are more likely. Here are some considerations for handling timeouts:

  • Default timeout: The default timeout is 10 minutes when making API requests with an official OpenAI SDK. You may need to increase this timeout for lengthy prompts or complex tasks.
  • Configuring timeouts: Each SDK will provide a parameter to increase this timeout. In the Python and TypeScript SDKs, this is timeout as shown in the code samples above.
  • Automatic retries: The OpenAI SDKs automatically retry requests that result in a 408 Request Timeout error code twice before throwing an exception.

Resource unavailable errors

Flex processing may sometimes lack sufficient resources to handle your requests, resulting in a 429 Resource Unavailable error code. You will not be charged when this occurs.

Consider implementing these strategies for handling resource unavailable errors:

  • Retry requests with exponential backoff: Implementing exponential backoff is suitable for workloads that can tolerate delays and aims to minimize costs, as your request can eventually complete when more capacity is available. For implementation details, see this cookbook.

  • Retry requests with standard processing: When receiving a resource unavailable error, implement a retry strategy with standard processing if occasional higher costs are worth ensuring successful completion for your use case. To do so, set service_tier to auto in the retried request, or remove the service_tier parameter to use the default mode for the project.