Skip to main content

psymind

Official Python SDK for PsyMind API v1. Requires Python 3.11 or newer and has no runtime dependencies.

Quickstart

Install:

python -m pip install psymind

Set the service credential only in the server environment:

export PSYMIND_API_KEY="your-service-credential"

Create a client, create a practice, and wait for its result:

import os
from datetime import UTC, datetime

from psymind import PsyMind, create_idempotency_key

psymind = PsyMind(api_key=os.environ["PSYMIND_API_KEY"])

# Set consent_status to granted only after valid consent has been obtained.
client = psymind.clients.create({
    "external_id": create_idempotency_key("quickstart-client"),
    "preferred_language": "en",
    "timezone": "UTC",
    "consent_status": "granted",
    "consent_version": "your-valid-consent-version",
    "consent_at": datetime.now(UTC).isoformat(),
})

created = psymind.practices.create(
    {
        "client_id": client.data["id"],
        "goal": "Sleep calmly and wake rested",
        "language": "en",
        "generate_audio": True,
    },
    idempotency_key=create_idempotency_key("practice"),
)

result = psymind.practices.wait_until_ready(created.data["id"])
print(result.data["status"], result.request_id)

Service credentials are server-only. Do not embed them in browser, mobile, or distributed client applications.

Resources

The Pythonic client exposes organizations, practitioners, clients, practices, voices, methods, assignments, and outcomes. Request and response models are generated as TypedDict definitions from OpenAPI. PsyMind.request() provides low-level access to all 66 public API v1 operations.

The current public contract has no usage or webhook-management routes, so these are intentionally absent.

Pagination, retries, and errors

List results include Pagination. Resource .all() helpers follow cursors sequentially, detect loops, enforce max_pages, and optionally deduplicate by id.

GET requests retry transient failures with bounded exponential jitter; a valid Retry-After value is honored in full. POST requests retry only when OpenAPI declares Idempotency-Key and the caller supplies a stable key. PATCH, DELETE, authentication POSTs, and non-idempotent POSTs never retry automatically. HTTP 409 is never retried.

Configure timeout, max_retries, and retry_base_delay on the client. Python's synchronous transport applies timeout to blocking network I/O, matching standard urllib socket-timeout semantics; it is not a wall-clock cap for a slow-drip response or a synchronous credential provider. Polling passes its remaining budget to each request, retries transient GET failures within that budget, and checks the total deadline between calls. PsyMindError exposes code, status, request_id, retry_after, and details where available.

Organization selection

Service credentials are bound to their organization. A human access token with memberships in multiple organizations may set organization_id; the SDK sends X-PsyMind-Organization-Id. Tenant binding remains enforced by the API.

Webhook verification

Pass the exact raw request body, before JSON parsing:

from psymind import verify_webhook

event = verify_webhook(raw_body, headers, webhook_secret)

The verifier checks the current webhook-id, webhook-timestamp, and webhook-signature HMAC-SHA256 contract and five-minute timestamp window. Persist processed webhook-id values and reject duplicates in your receiver; timestamp validation alone cannot deduplicate a correctly signed delivery.

Metadata

Release files for psymind 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psymind 1.0.0
File Size Uploaded Provenance
psymind-1.0.0.tar.gz 32.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for psymind 1.0.0
File Interpreter ABI Platform
psymind-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 59.0 kB

Release files / psymind-1.0.0.tar.gz

Download URL psymind-1.0.0.tar.gz
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3ad0b018742f1da4050be522d45a9d8f44d409c4f5df0f0ec6306c2bd86b7ea9
BLAKE2b-256 checksum
How to use checksums
d2407a39e66443739554fed4193fcd6b39707c66b2786522a784caa466abcee7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / psymind-1.0.0-py3-none-any.whl

Download URL psymind-1.0.0-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
489742fd5804b07f77e05b8803e900df257fc43d4438743ca24dc97c3ae763bd
BLAKE2b-256 checksum
How to use checksums
23a07525deb55a98e89e41c68c383b22ffb3c2766b02d51110ba8d527f029fe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Security for psymind 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for psymind-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page