Deutero and AsyncDeutero accept the same keyword-only options:
str
Your API key. Defaults to the
DEUTERO_API_KEY environment variable.str
default:"https://dashboard.deutero.ai/study-api"
The API root. Override it to point at a staging environment.
float
default:"120"
Request timeout in seconds. Some calls are model calls that take a minute or more (study drafting, question generation, validation), so keep this generous.
httpx.Client | httpx.AsyncClient
A preconfigured
httpx client. Pass httpx.Client to Deutero and httpx.AsyncClient to AsyncDeutero.Custom base URL
Custom timeout
deutero.TimeoutError.
Custom HTTP client
Bring your ownhttpx client for proxies, custom certificates, retries or other transport settings:
X-API-Key header to every request, and uses its own base_url if your client doesn’t set one.
When you pass
http_client, its own timeout applies; the SDK’s timeout argument is not applied to it. The SDK also doesn’t close a client you passed in, so close it yourself when you’re done.Closing connections
The client keeps a connection pool. Use it as a context manager, or callclose():
Health check
client.health() calls GET /health and returns the raw JSON body. It’s handy for a readiness probe.
Conventions
- IDs can be passed as
stroruuid.UUID. - Optional arguments left as
Noneare not sent. The server default applies, and on updates the field is left unchanged. - Enums such as
StudyType,ModelTierandSearchModearestrenums: pass either the enum member or its string value. - Responses are Pydantic models from
deutero.models. Use.model_dump()to get a dict.
.png?fit=max&auto=format&n=G_hwo_L4hZsQ93vT&q=85&s=c00b6042d4688a9b776bae65a530206a)