Generate a Python SDK From the unLocked CRM OpenAPI Spec

Build a typed, async-ready Python client for unLocked CRM in under 10 minutes using openapi-python-client.

Python is the lingua franca of data and AI. If you're building a back-office automation, an LLM agent, or a nightly ETL job that touches the CRM, generate a typed Python SDK from the OpenAPI spec.

Install the Generator

pipx install openapi-python-client

Generate the Client

openapi-python-client generate --url https://unlockedcrm.ai/openapi.json

This produces a unlocked_crm_client/ package with typed models (via attrs), an async-ready httpx client, and one function per endpoint.

Use It

from unlocked_crm_client import AuthenticatedClient
from unlocked_crm_client.api.contacts import get_contacts

client = AuthenticatedClient(
    base_url="https://api.unlockedcrm.ai",
    token=os.environ["UNLOCKED_API_KEY"],
    prefix="",
    auth_header_name="x-api-key",
)

response = get_contacts.sync(client=client, limit=50)
for contact in response.data:
    print(contact.first_name, contact.email)

Why a Generated Client Beats requests + dict

  • Type safety — mypy/pyright catch field typos at lint time, not at runtime.
  • Auto-pagination — most generators ship cursor helpers.
  • Drift detection — re-run on every release; breaking changes fail your build instead of production.
  • LLM-friendly — Claude and ChatGPT can read the typed client and write working code without hallucinating field names.

For larger workloads, swap to the async client and parallelize requests with asyncio.gather().

Related Reading