Service tiers

Set a tier on each request to choose between response speed and price. The model and request format stay the same.
TierPrice changeUse it for
default0%Production workloads that need a balance of speed and cost.
flex−30%Background agents that can trade response time for lower cost.
fast+50%Interactive workloads where response time matters most.

Set the tier

from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.gradiated.com",
    api_key=os.environ["GRADIATED_API_KEY"],
)

response = client.chat.completions.create(
    model="YOUR_MODEL",
    messages=[{"role": "user", "content": "Summarize this document."}],
    extra_body={"service_tier": "flex"},
)

The service_tier parameter is optional and defaults to default, which is the normal speed you'd expect from an inference provider at an affordable price.

The flex tier is for background agents where latency isn't as important. It returns a normal response or stream, so you don't need to make any changes to your code to adopt it.

Every hosted model supports all three tiers. A retry keeps the selected tier. The response includes the selected tier in the x-gradiated-service-tier header.

Tier pricing applies to input, cached input, cache write, output, and reasoning output prices when the model uses those token types. Gradiated calculates each nano-USD unit price and rounds down before it calculates the request charge.