Documentation Index
Fetch the complete documentation index at: https://docs.tinfoil.sh/llms.txt
Use this file to discover all available pages before exploring further.
API Errors
Since the Tinfoil SDK wraps the OpenAI client, standard API errors (AuthenticationError, RateLimitError, etc.) pass through unchanged. The SDK re-exports them so you can import and catch them directly. See the OpenAI error documentation for details.
Example: handling an AuthenticationError
Example: handling an AuthenticationError
Client Errors
The SDK verifies attestations, pins certificates, and encrypts payloads before any data leaves your machine. It retries transient failures automatically, but errors that persist will surface to your code as one of two typed errors.TinfoilError, which extends the native Error class. Each error includes a message string and an optional cause property containing the underlying error.
| Error | Cause | What to do |
|---|---|---|
ConfigurationError | Bad or missing client options | Fix your code. Retrying will not help. |
AttestationError | Attestation verification failed | Retry. If it persists, it may indicate a genuine security issue. |
ConfigurationError (a bug in your code) from transient errors:
The Rust SDK exposes one additional discriminator beyond the cross-language taxonomy:
is_fetch() returns true for transport-level failures fetching attestation materials (network, HTTP, GitHub API), while is_attestation() is reserved for verification failures (signature, certificate, measurement mismatch). is_retryable() is is_fetch() plus the retryable subset of upstream API errors.
