Provider routing
Models served through OpenRouter accept a provider object: order, only, ignore, allow_fallbacks, sort (price / throughput / latency), require_parameters, data_collection, quantizations and zdr. You are always billed the real cost of the provider that answered.
Python
response = client.chat.completions.create(
model="grok-4.7",
messages=messages,
extra_body={
"provider": {
"sort": "throughput", # or "price" / "latency"
"order": ["anthropic", "google-vertex"],
"allow_fallbacks": True,
"data_collection": "deny", # only providers that don't train on data
"zdr": True, # zero data retention
},
},
)