Skip to main content
HTTP failures raise APIStatusError with status_code, code, message, and request_id. Network failures raise APIConnectionError.
The client retries connection failures, timeouts, 408, 429, and 5xx twice. Set max_retries=0 to turn that off. When adapting a harness that handles its own retries, preserve the SDK error’s status, headers, and body. In particular, pass through Trajectory-Should-Retry: false so the harness does not retry an attempt the service has already rejected. Spec (benchmark) uploads retry longer, to ride out signing throttling: push() and start_push() retry each upload request up to upload_max_retries times (default 32) or for 4.5 minutes of waiting, whichever comes first. The client’s max_retries does not apply to them. Pass upload_max_retries=0 to turn that off. Reuse an idempotency_key only when repeating the same submission. A new evaluation or training run needs a new key. Errors inside a trajectory, such as a model request your harness cannot recover from, are reported through the trajectory’s termination reason. See Termination reasons.