Skip to main content

Per-call options

Every method accepts variadic RequestOption arguments for per-call overrides:

result, err := client.Liveness.Check(ctx, req,
ekyc.WithIdempotencyKey("verification-"+verificationID),
ekyc.WithRequestID("req_audit_42"),
)

Available options

WithIdempotencyKey(key string)

Pin the Idempotency-Key header for this call. Default: SDK auto-generates client_<uuidv4>.

client.Sessions.Create(ctx, req, ekyc.WithIdempotencyKey("user_42_session_2026-05-08"))

See Idempotency for when to set this.

WithRequestID(id string)

Pin the X-Request-Id for the FIRST attempt of this call. SDK retries generate fresh request ids per attempt regardless.

client.OCR.Scan(ctx, req, ekyc.WithRequestID("req_my_correlation_id"))

WithAPIVersion(v string)

Override the API version pin for this call. Rare — you usually pin once at Client config time.

client.OCR.Scan(ctx, req, ekyc.WithAPIVersion("2027-01-01"))

Combining

Options stack in order:

client.Face.Verify(ctx, req,
ekyc.WithIdempotencyKey("verify-"+id),
ekyc.WithAPIVersion("2026-04-26"),
)