GrepBoard/Manuals
605 manuals ·

Fix OpenAI API 400 "Invalid service_tier argument"

·Tested on openai-python 3.39.0 · local mock server · OpenAI official docs · 2026-10·Test scope ↓·5 steps

OpenAI API 400 Invalid service_tier argument means the requested service tier is not allowed for the project. Send an allowed tier or change project settings.

output
Invalid `service_tier` argument: The requested service tier is not allowed for this project.

The service tier your request selected, or resolved to, is not allowed for this project. The error is an invalid_request_error with error.param set to service_tier. Change the request's service_tier to an allowed tier, or allow that tier in the project settings.

[1] See which tier the request used. Per the official docs, these values are and are not subject to the project restriction.

Request valueProject restriction
default, flex, priorityRestricted
fastEvaluated as priority (Priority processing was renamed Fast mode on 2026-07-30)
Omitted or autoCan return this error if it resolves to a disallowed tier
Scale TierOutside this project policy

If you sent fast and got the error, what the project blocks is priority. If your code never sends service_tier and still gets it, you are in the third row: check the project's default tier (Settings, then General under Project, Project Service Tier).

[2] Set an allowed tier explicitly in code. It is the fastest fix. For example, if you were sending service_tier="flex" in a project that blocks Flex, put an allowed tier there.

app.py
response = client.responses.create(    model=MODEL,    input=text,  service_tier="default",)

[3] If you need that tier, allow it in the project settings. Allowed tiers live in project settings and the organization's service tiers settings. Projects cannot enable tiers the organization blocks; in that case ask the organization owner.

[4] Retrying does not clear this error. Calling a local mock server (which returns the documented 400 body) with the official Python SDK shows that the SDK sends the value unchecked and raises BadRequestError as soon as the 400 arrives.

console
$ python client_tier.py fastBadRequestError status=400 param=service_tier code=NoneError code: 400 - Invalid `service_tier` argument: The requested service tier is not allowed for this project.$ python client_tier.py flexBadRequestError status=400 param=service_tier code=NoneError code: 400 - Invalid `service_tier` argument: The requested service tier is not allowed for this project.

The mock's log shows one request per run, so there was no retry.

output
request 1: service_tier=fastrequest 2: service_tier=flex

So in code, detect it with e.param == "service_tier" and re-send once with a tier you have confirmed is allowed, set explicitly, or fix the project settings and then re-send once. Re-sending without service_tier can hit the same 400 or the Fast premium, for the reasons in [2]. A retry loop that repeats the same request is pointless.

client_tier.py
except openai.BadRequestError as e:    print(f"{type(e).__name__} status={e.status_code} param={e.param} code={e.code}")

[5] After the change, read the response object's service_tier to see the tier that actually processed the request. Per the docs, GPT-5.6 and earlier models report priority even when you send fast, and when traffic ramps too fast some Fast requests can be downgraded to default and billed at standard rates.

A Flex capacity shortage is not this error; it comes back as 429 Resource Unavailable (not charged). For overload errors see OpenAI API 503 server_is_overloaded, and for key errors Fix OpenAI API 401 "Incorrect API key provided".

#openai-api#400#service-tier#flex