Install & Compatibility
Where this runs
tested against v2.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.330s · 23.1MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.4s · import 0.317s · 24MB
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
client
✓ from onepasswordconnectsdk import client
Main entry point for interacting with the 1Password Connect API.
models
✓ from onepasswordconnectsdk import models
Contains data models for items, fields, vaults, etc.
ConfigClass
✓ from onepasswordconnectsdk.config import ConfigClass
Used for custom HTTPX client configuration (e.g., timeouts, SSL verification) as of v2.0.0.
Initialize the 1Password Connect client and fetch items from a specified vault. This example relies on environment variables for configuration. Make sure `OP_CONNECT_HOST`, `OP_CONNECT_TOKEN`, and `OP_VAULT_UUID` are set.
import os
from onepasswordconnectsdk import client
# Configure 1Password Connect client via environment variables:
# OP_CONNECT_HOST - e.g., "http://localhost:8080"
# OP_CONNECT_TOKEN - your 1Password Connect server token
# OP_VAULT_UUID - the UUID of a vault you want to access
host = os.environ.get("OP_CONNECT_HOST", "http://localhost:8080")
token = os.environ.get("OP_CONNECT_TOKEN", "dummy_token_replace_me")
vault_uuid = os.environ.get("OP_VAULT_UUID", "dummy_vault_uuid_replace_me")
if token == "dummy_token_replace_me" or vault_uuid == "dummy_vault_uuid_replace_me":
print("Please set OP_CONNECT_HOST, OP_CONNECT_TOKEN, and OP_VAULT_UUID environment variables.")
print("For this quickstart, we'll proceed but it will likely fail without real credentials.")
try:
connect_client = client.Client(host, token)
print(f"Connecting to 1Password Connect server at: {host}")
items = connect_client.get_items(vault_uuid)
print(f"Successfully retrieved {len(items)} items from vault {vault_uuid}.")
for item in items[:3]: # Print first 3 item titles
print(f"- {item.title}")
except Exception as e:
print(f"Error: {e}")
print("Ensure 1Password Connect server is running and accessible, and environment variables are correct.")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'onepasswordconnectsdk'
The `onepasswordconnectsdk` library is not installed in the current Python environment.
fixRun `pip install onepasswordconnectsdk` to install the library.
onepasswordconnectsdk.errors.APIError: Unauthorized
The 1Password Connect server rejected the request due to an invalid or missing access token, or the token does not have permissions for the requested operation.
fixDouble-check the `OP_CONNECT_TOKEN` environment variable or the token passed to `client.Client()`. Ensure it's correct and has the necessary permissions. Also, verify `OP_CONNECT_HOST` is correct and the server is running and accessible.
TypeError: Client() missing 2 required positional arguments: 'host', 'token'
The `client.Client` constructor was called without providing the `host` and `token` arguments, and the corresponding environment variables (`OP_CONNECT_HOST`, `OP_CONNECT_TOKEN`) were not set.
fixPass `host` and `token` directly to `client.Client(host, token)` or ensure `OP_CONNECT_HOST` and `OP_CONNECT_TOKEN` environment variables are properly set before running your application.
KeyError: 'Cannot find vault with UUID: <your-vault-uuid>'
The provided vault UUID does not exist on the 1Password Connect server, or the authenticated token lacks permission to access it.
fixVerify the `vault_uuid` variable (or `OP_VAULT_UUID` environment variable) matches an existing vault's UUID in your 1Password account and that the Connect token has access to it.
Upgrade
Version history
2.1.0latest on PyPI · released May 6, 2026
Audit
Dependencies
httpxrequiredHTTP client for communicating with the 1Password Connect server.