The external JWT authentication documentation tells API clients to create a fresh token for every request and includes a jti nonce, but jwt_decode_handler() does not currently enforce that one-time-token contract. A captured, still-valid API token can therefore be replayed. Add replay protection at the decoder boundary without changing the existing issuer lookup, signing algorithm, iat/exp checks, clock-skew handling, or maximum token lifetime.
Every otherwise-valid API-key JWT must contain a jti JSON string from 1 through 255 characters. Unicode strings are valid. A missing claim must raise DRF AuthenticationFailed with JWT jti (JWT ID) claim is missing.; an empty value, non-string value, or value longer than 255 characters must raise it with JWT jti (JWT ID) claim must be a non-empty string no longer than 255 characters. A valid token with a previously unused ID must still return its complete decoded payload unchanged.
After successful validation, claim the exact (iss, jti) pair in the configured default Django cache so separate workers sharing that cache agree on prior use. A second successful decode of the same pair while its claim is live must raise AuthenticationFailed with JWT jti (JWT ID) has already been used. Scope IDs by issuer: equal IDs from different issuers are independent, and pair encoding must be unambiguous even when issuer or ID strings contain delimiters.
Keep each claim through the token's entire acceptance window, including JWT_LEEWAY after exp; after that window, a new otherwise-valid token may reuse the pair. Tokens rejected for a bad signature or for exceeding MAX_APIKEY_JWT_AUTH_TOKEN_LIFETIME must not consume their IDs and must retain their existing error behavior. If the cache fails while creating the replay reservation, fail closed with AuthenticationFailed("JWT replay protection is temporarily unavailable.") rather than accepting the token or exposing the backend exception.