OpenMates Python SDK
Project description
openmates
Python SDK for OpenMates: run app skills, create encrypted chats, inspect usage, and automate everyday OpenMates tasks from Python.
Install
pip install openmates
Install the latest prerelease from the dev channel:
pip install --pre --upgrade openmates
Quick Start
- Open OpenMates.
- Go to Settings > Developers > API Keys.
- Create an API key with the scopes and credit limit your script needs.
- Copy the key immediately. OpenMates only shows it once.
Set the key in your environment:
export OPENMATES_API_KEY="sk-api-..."
Run your first request:
from openmates import OpenMates
om = OpenMates() # reads OPENMATES_API_KEY
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.
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.invoices()
Work with memories
memory_types = om.memories.types()
saved_memories = om.memories.list(app_id="web")
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.* |
List, create, update, and delete encrypted memory entries when your API key has memory scopes. |
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:
OpenMatesConfigErrorfor missing API keys or local key-unwrapping problems.OpenMatesApiErrorfor API responses such as expired keys, unapproved devices, missing scopes, or exceeded credit limits.
Versioning
OpenMates shows the short product line, for example v0.14, in the web app.
Python package artifacts use exact release-line versions:
0.14.Na0is an alpha prerelease from thedevbranch.0.14.Nis a stable release frommain.
Install stable releases with pip install openmates. Install prereleases with
pip install --pre openmates.
More Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openmates-0.14.2.tar.gz.
File metadata
- Download URL: openmates-0.14.2.tar.gz
- Upload date:
- Size: 60.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4910daa1057fd6ac07f82efcddd29c636003b0e121279aaf2b308f6c73675348
|
|
| MD5 |
508b9695a67bfa5abf4bae6a1fba40a4
|
|
| BLAKE2b-256 |
1a9859603a71596f39485109fd9904732d1929188cac953ef6b3dd1c53a769c1
|
Provenance
The following attestation bundles were made for openmates-0.14.2.tar.gz:
Publisher:
publish-python-sdk.yml on glowingkitty/OpenMates
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openmates-0.14.2.tar.gz -
Subject digest:
4910daa1057fd6ac07f82efcddd29c636003b0e121279aaf2b308f6c73675348 - Sigstore transparency entry: 2118969820
- Sigstore integration time:
-
Permalink:
glowingkitty/OpenMates@46483a8fd49cfe9d377b7af43ea7150cb286f76d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/glowingkitty
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@46483a8fd49cfe9d377b7af43ea7150cb286f76d -
Trigger Event:
push
-
Statement type:
File details
Details for the file openmates-0.14.2-py3-none-any.whl.
File metadata
- Download URL: openmates-0.14.2-py3-none-any.whl
- Upload date:
- Size: 53.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65fed1e97df9e6c029be8107fa80efcf64674c12daf70b0e37be7eb0da177d62
|
|
| MD5 |
efbcd9e83ab56b0e0abf8d26e030111e
|
|
| BLAKE2b-256 |
08eda0da387abf60bd6f6e7ed7e1c29c3fee42774729e90185665b5466d4a106
|
Provenance
The following attestation bundles were made for openmates-0.14.2-py3-none-any.whl:
Publisher:
publish-python-sdk.yml on glowingkitty/OpenMates
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openmates-0.14.2-py3-none-any.whl -
Subject digest:
65fed1e97df9e6c029be8107fa80efcf64674c12daf70b0e37be7eb0da177d62 - Sigstore transparency entry: 2118969841
- Sigstore integration time:
-
Permalink:
glowingkitty/OpenMates@46483a8fd49cfe9d377b7af43ea7150cb286f76d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/glowingkitty
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@46483a8fd49cfe9d377b7af43ea7150cb286f76d -
Trigger Event:
push
-
Statement type: