Skip to main content
The theauth package is the Python client for the theAuth REST API. It is built on httpx and ships a sync client and an async client with the same surface. Python 3.9 or newer.

Installation

Create a client

Resources

MCP servers

Plugin routes

Call routes declared with defineEndpoint through request(). It returns the parsed JSON body.
Validation failures raise ValidationError with the server issues. A 403 CSRF_REJECTED raises PermissionError, and a 429 raises RateLimitError with retry_after.

DPoP

DPoPAuth signs each request with an ES256 key pair, as described in RFC 9449.
  • The Authorization header becomes DPoP <token> and the proof carries an ath claim.
  • htu drops the query and fragment.
  • The server DPoP-Nonce is cached per origin and a use_dpop_nonce response is retried once.
DPoPAuth is a plain httpx.Auth, so you can also pass it to your own httpx.Client or httpx.AsyncClient. The cryptography package is imported lazily and a clear error is raised if it is missing.

Errors

All exceptions inherit from TheAuthError and carry code, message and status_code.

Client SDK

The TypeScript fetch client this package mirrors.

Expo

React Native and Expo integration.
Last modified on October 13, 2026