Skip to main content
Both 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

A request that exceeds the timeout raises deutero.TimeoutError.

Custom HTTP client

Bring your own httpx client for proxies, custom certificates, retries or other transport settings:
The SDK still adds the 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 call close():

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 str or uuid.UUID.
  • Optional arguments left as None are not sent. The server default applies, and on updates the field is left unchanged.
  • Enums such as StudyType, ModelTier and SearchMode are str enums: pass either the enum member or its string value.
  • Responses are Pydantic models from deutero.models. Use .model_dump() to get a dict.