Skip to content

Idempotency key is sent in the JSON payload #104

@saxon134

Description

@saxon134

VideosResource.create and TasksResource.create pass all keyword params through _payload(request, params) while also deriving the Idempotency-Key header from params.get("idempotency_key"). With the main src package on PYTHONPATH, client.tasks.create(type="image_generation", idempotency_key="idem_1") sends both header Idempotency-Key: idem_1 and JSON body {"type":"image_generation","idempotency_key":"idem_1"}. If the API treats idempotency as a header-only control field, strict request validation can reject the request or persist the control field as task input. Exclude idempotency_key from the serialized payload before calling _payload for sync and async create methods.

File: src/globalrouter/_resources.py

Line: 335

Severity: medium

Summary: idempotency key serialized in create payloads

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions