VideosResource.create and TasksResource.create build the JSON body from the full params mapping while also converting params.get("idempotency_key") into the Idempotency-Key header. A call such as client.videos.create(model="m", prompt="p", idempotency_key="idem") sends both the header and a body field named idempotency_key. Since this is an SDK transport option, it should be removed from the request payload before calling _payload; otherwise APIs may reject the unexpected field or treat it as model input.
File: src/globalrouter/_resources.py
Line: 335
Severity: medium
Summary: idempotency key leaks into create payloads
VideosResource.createandTasksResource.createbuild the JSON body from the fullparamsmapping while also convertingparams.get("idempotency_key")into theIdempotency-Keyheader. A call such asclient.videos.create(model="m", prompt="p", idempotency_key="idem")sends both the header and a body field namedidempotency_key. Since this is an SDK transport option, it should be removed from the request payload before calling_payload; otherwise APIs may reject the unexpected field or treat it as model input.File:
src/globalrouter/_resources.pyLine: 335
Severity: medium
Summary: idempotency key leaks into create payloads