Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

openmates

OpenMates

Your agentic operating system for everyday tasks, learning & work. With user interests & privacy first.

Python SDK for OpenMates: run app skills, create encrypted chats, inspect usage, and automate everyday OpenMates tasks from Python.

OpenMates | SDK docs | Source

Install

pip install openmates

Install the latest prerelease from the dev channel:

pip install --pre --upgrade openmates

Quick Start

Try eligible requests without an account or API key while the shared free allowance is available. If OPENMATES_API_KEY is configured, the same constructor automatically uses your account.

Run your first request:

from openmates import OpenMates

om = OpenMates()

result = om.apps.web.search({
    "requests": [{"query": "OpenMates SDK examples"}],
})

print(result)

SDK methods authenticate lazily. You do not need to call connect().

New SDK devices may need approval in Settings > Developers > Devices before they can access encrypted account data.

Try without an account

Without an explicit or environment API key, app skills and chats.send() use the shared free allowance:

from openmates import OpenMates, OpenMatesSignupRequiredError

om = OpenMates()
try:
    response = om.chats.send("Explain how a rainbow forms.")
    print(response.content)
except OpenMatesSignupRequiredError as error:
    print(error)  # Free allowance used or unavailable; create an account to continue.

print(om.anonymous.status())

No identity setup is needed. Free usage is limited by public IP and a shared daily, weekly, and monthly service allowance; people on the same network may share the IP limit. Status is informational: each operation's actual allowance is checked by the server. Anonymous chats send plaintext for processing without saving an account transcript. For follow-up turns, pass a history list with role, content, and optional integer created_at fields. Account storage, Projects, Teams, memories, connected accounts, focus modes, goals, and model overrides require authenticated APIs. Anonymous AI requests use chats.send(); apps.ai.ask() directs callers there.

For account access, create a key in Settings > Developers > API Keys with the scopes and credit limit your script needs, then set OPENMATES_API_KEY. Authentication failures and credit exhaustion never switch to the free allowance. For advanced free-only use, anonymous=True ignores an environment key; combining it with an explicit key raises OpenMatesConfigError.

Experimental image decisions

apps.ai.decide supports Jev 1.14 judgments over inline PNG/JPEG images:

import base64
import uuid
from pathlib import Path
from openmates import OpenMates

om = OpenMates()
ref = str(uuid.uuid4())
result = om.apps.ai.decide({
    "state": {"board": ref},
    "questions": {
        "clear": {"type": "noul", "instructions": "Is the path to the exit clear?"}
    },
    "assets": {
        ref: {
            "type": "image", "format": "png",
            "data_base64": base64.b64encode(Path("board.png").read_bytes()).decode("ascii")
        }
    }
})
print(result["data"]["answers"])

Each image needs a canonical lowercase UUID key referenced in a string value in state, instructions, or criteria. OpenMates validates up to four still images, 1 MiB decoded per image and 4 MiB total, with both dimensions 280–1568 pixels. State/questions remain limited to 16 KiB; the complete JSON body is limited to 6 MiB. Use jpg or jpeg for JPEG bytes.

This prototype feature uses direct TypeSafe only, without OpenRouter fallback. Image tokens use the same applicable free allowance or account credits. Callers need no provider key or image header. This path does not fetch remote images or create stored uploads; the separate account upload flow still needs signup. Handle OpenMatesSignupRequiredError and provider failures as for text requests. See REST image decisions.

Common Examples

Send a private chat message

By default, chats.send() creates a non-persistent chat. It does not save the transcript to your OpenMates account.

response = om.chats.send("Summarize this release note draft.")
print(response.content)

Save the chat explicitly when you want it in your account history:

response = om.chats.send(
    "Draft a checklist for launching our beta.",
    save_to_account=True,
)

List and load encrypted chats

latest_chats = om.chats.list(limit=10)
chat = om.chats.load(latest_chats[0]["id"])

print(chat["chat"].get("title"))

Pass limit=0 only when you intentionally want all account chats.

Search the web

search = om.apps.web.search({
    "requests": [
        {"query": "privacy-first AI assistants", "count": 5},
    ],
})

Read a web page

page = om.apps.web.read({
    "url": "https://openmates.org/docs/user-guide/developers/sdk",
})

Search OpenMates docs

docs = om.docs.search("API keys")

Check billing and usage

overview = om.billing.overview()
invoices = om.billing.list_invoices()
pdf = om.billing.download_invoice(invoice_id)  # openmates.RawDownload
open(pdf.filename or "invoice.pdf", "wb").write(pdf.data)

download_invoice, download_credit_note and usage_export return a typed, immutable openmates.RawDownload (content_type, filename, data), matching the npm RawDownload and Rust sdk_ops::RawDownload. filename is the last path component of the server's Content-Disposition name (filename* UTF-8 wins over filename); it is None for missing, malformed, . or .. names. Compatibility: 0.30.0 returned a plain dict; RawDownload keeps read-only mapping access (download["data"], .get(), .keys(), dict(download)), so existing callers keep working, but it can no longer be mutated.

Work with memories

published = om.memories.published(app_id="web")  # read-only app guidance
legacy_entries = om.memories.list()  # deprecated: legacy typed entries (read/delete only)

Each listed entry is decrypted locally; data is the decoded JSON or TOON plaintext (like npm), the plain text when neither applies, or None when the entry is empty or cannot be decrypted with this API key.

Create reminders

reminder = om.reminders.create({
    "title": "Review OpenMates SDK usage",
    "due_at": "2026-07-10T09:00:00Z",
})

SDK Areas

Namespace Purpose
om.apps.* Generated app-skill methods such as web.search, web.read, images.generate, pdf.search, and more.
om.chats.* Encrypted chat list/load/send/export/share/delete helpers.
om.docs.* Search OpenMates documentation.
om.billing.* Usage overview, invoices, and billing metadata.
om.account.* Account info, interests, storage, export helpers.
om.memories.* Read published app guidance; deprecated read/delete of legacy typed entries. Typed memories were replaced by Memories, managed in the web app under Settings > Memories.
om.reminders.* Create, list, and manage reminders.
om.connected_accounts.* Import connected-account data with explicit user approval flows.
om.embeds.* Inspect and share embed data when available to the API key.
om.settings.* Update supported account settings such as language, theme, model defaults, and chat auto-delete.

Generated app-skill methods follow the app and skill names from OpenMates. For example, the web search skill is om.apps.web.search(...) and PDF search is om.apps.pdf.search(...).

API Keys and Scopes

API keys are bearer credentials. Treat them like passwords.

  • Store keys in environment variables or a secret manager.
  • Do not commit keys to source control.
  • Use the narrowest scopes and credit limits your script needs.
  • New SDK devices may require approval before they can access encrypted account data.

Common scopes include:

Scope Allows
chat:create_incognito Non-persistent SDK chats.
chat:create_saved Saved account chats.
chat:read_existing Listing and loading existing encrypted chats.
chat:append_existing Adding messages to existing saved chats.
chat:share Creating share links.
memory:read Reading memory entries selected by the SDK caller.

App-skill scopes can allow all apps, a specific app, or a specific skill such as web:search.

Error Handling

from openmates import OpenMates, OpenMatesApiError, OpenMatesConfigError

try:
    om = OpenMates()
    print(om.billing.overview())
except OpenMatesConfigError as error:
    print(f"Configuration error: {error}")
except OpenMatesApiError as error:
    print(f"API error {error.status_code}: {error.data}")

The SDK raises:

  • OpenMatesConfigError for missing API keys or local key-unwrapping problems.
  • OpenMatesSignupRequiredError (an OpenMatesApiError subclass) when the free allowance is exhausted or unavailable; exposes signup_required, code, and reason.
  • OpenMatesApiError for API responses such as expired keys, unapproved devices, missing scopes, or exceeded credit limits.

Export a calendar event

from pathlib import Path
from openmates import build_calendar_event_file

# Use the decrypted content of a finished calendar_event embed.
calendar_file = build_calendar_event_file(embed_id, content)
if calendar_file is not None:
    Path("event.ics").write_bytes(calendar_file.encode("utf-8"))

The local serializer exports only the primary event. It validates dates and timezones and preserves an unknown end time without inventing a duration. Context events are for display only. No calendar account or network call is required.

Native session SDK (preview)

openmates.SessionClient, RustApiKeyClient, prepare_privacy and sort_tasks run in the shared OpenMates Rust core through the openmates._native extension (PyO3). They never launch the CLI or read CLI login state. The SDK is API-key only and separate from the CLI login: SessionClient's login_password(...) / import_session(...) modes are deprecated and leave the public package once every capability they offer is available through API-key authentication (tracked in config/sdk-capabilities.json); use an API key from Settings > Developers, which decrypts your chats locally with its own wrapped account key. If the extension is missing, these APIs raise SessionClientError with code native_binding_unavailable (there is no pure-Python fallback). The OpenMates API-key client above does not need the extension. Published wheels do not include it yet; from a source checkout run python3 scripts/build_sdk_native.py --language python.

Versioning

OpenMates shows the short product line, for example v0.30, in the web app. Python package artifacts use exact release-line versions:

  • 0.30.0aN is an alpha prerelease from the dev branch.
  • 0.30.0 is a stable release from main.

Install stable releases with pip install openmates. Install prereleases with pip install --pre openmates.

More Documentation

Metadata

Release files for openmates 0.30.0a16

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

Source distribution (sdist)

Source distribution for openmates 0.30.0a16
File Size Uploaded Provenance Actions
openmates-0.30.0a16.tar.gz 259.2 kB With provenance Details for openmates-0.30.0a16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openmates 0.30.0a16
File Interpreter ABI Platform Actions
openmates-0.30.0a16-py3-none-any.whl Python 3 none any Details for openmates-0.30.0a16-py3-none-any.whl

Total release size: 450.7 kB

Release files / openmates-0.30.0a16.tar.gz

Download URL openmates-0.30.0a16.tar.gz
Size 259.2 kB
Tags Source
SHA-256 checksum
How to use checksums
71125b211636ff81d31c74a42f27fb78760bdd7593fd0c27685706e5838079fb
BLAKE2b-256 checksum
How to use checksums
4b63ee18384acaa98c27ad05d4ca196bdbad289cb34465d4ca071de42a249f26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Release files / openmates-0.30.0a16-py3-none-any.whl

Download URL openmates-0.30.0a16-py3-none-any.whl
Size 191.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a20f0b9b78d1eec0b110659d9a25e2498994177c47a779fb61febb0d29a1e8f
BLAKE2b-256 checksum
How to use checksums
e78bea5d05206154f82754d5e8ab56dc1067ce977c37895188f98735fcfc11d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Security for openmates 0.30.0a16

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openmates-0.30.0a16.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 Nov 10, 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
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