OpenAI API breaking change: request-media-type-removed on POST /responses/input_tokens application/x-www-form-urlencoded
What changed
According to the OpenAPI spec diff (openai/openai-oas-5162af98d314-to-117ce5680e42-breaking), the following surface changed:
request-media-type-removed: POST /responses/input_tokens application/x-www-form-urlencoded
openai OAS corridor pair 5162af98d314 -> 117ce5680e42 (breaking subset ingested 2026-08-01)
Who is affected
Switch the request body encoding at every call site that POSTs /responses/input_tokens as a form: replace application/x-www-form-urlencoded submission (URLSearchParams / form-data key-value bodies with the form content-type header) with a JSON body — set the Content-Type header to application/json and JSON.stringify the same parameters.
To find out whether your repo is hit — file and line number, no code leaving your machine:
npx mendapi scan --repo .
How to fix it
Migration path:
Switch the request body encoding at every call site that POSTs /responses/input_tokens as a form: replace application/x-www-form-urlencoded submission (URLSearchParams / form-data key-value bodies with the form content-type header) with a JSON body — set the Content-Type header to application/json and JSON.stringify the same parameters. Official openai SDK clients already send JSON and are unaffected; only raw HTTP callers using form encoding break.
Before:
await fetch('https://api.openai.com/v1/responses/input_tokens', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams(params) });
After:
await fetch('https://api.openai.com/v1/responses/input_tokens', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(params) });
Replacement data source: the same endpoint accepts application/json request bodies in the NEW spec
With your own LLM key configured (BYO compute — mendapi never proxies your credentials), npx mendapi llmfix turns this guide into a reviewable draft patch for your repo.
Detected and tracked by mendapi — Dependabot for every API you depend on. Scans run locally; your code never leaves your machine.
Related
- openai breaking-change guide — every tracked openai entry on one page, with fixability verdicts.
- openai-node v3 to v4 migration — the full migration guide with pack-backed fixes.
- All monitored providers — live change counts for openai and 19 others.
- Migration pack catalog — every deterministic fix mendapi ships.
- Getting started — scan your repo in 30 seconds, no code leaves your machine.