cordum-sdk
Typed Python SDK for the Cordum control plane.
cordum-sdk is generated from the canonical OpenAPI spec and wrapped with a
small hand-tuned facade for:
- sync and async clients
- auth helpers
- retry/backoff policy
- typed error mapping
- pagination helpers
- streaming/SSE helpers
Install
pip install cordum-sdk
Sync quickstart
from cordum_sdk import CordumClient
with CordumClient("https://api.cordum.example", auth="cordum_api_key", tenant_id="tenant-123") as client:
jobs = client.jobs.list_jobs()
for job in jobs.items:
print(job.id, job.state)
Async quickstart
from cordum_sdk import AsyncCordumClient
async with AsyncCordumClient("https://api.cordum.example", auth="cordum_api_key", tenant_id="tenant-123") as client:
jobs = await client.jobs.list_jobs()
print(len(jobs.items))
Authentication
API key
from cordum_sdk import CordumClient
client = CordumClient("https://api.cordum.example", auth="cordum_api_key", tenant_id="tenant-123")
Bearer token
from cordum_sdk import CordumClient
from cordum_sdk.auth import BearerTokenAuth
client = CordumClient(
"https://api.cordum.example",
auth=BearerTokenAuth("bearer-token"),
tenant_id="tenant-123",
)
Session login
from cordum_sdk import AsyncCordumClient
from cordum_sdk.auth import SessionAuth
auth = SessionAuth("https://api.cordum.example", email="you@example.com", password="correct-password")
client = AsyncCordumClient("https://api.cordum.example", auth=auth, tenant_id="tenant-123")
SAML redirect flow
import httpx
from cordum_sdk import CordumClient
from cordum_sdk.auth import SamlAuth
def exchange_relay_state(relay_state: str) -> dict[str, str]:
with httpx.Client(base_url="https://api.cordum.example") as http_client:
response = http_client.post("/api/v1/auth/saml/acs", json={"relay_state": relay_state})
response.raise_for_status()
return response.json()
auth = SamlAuth("https://idp.example.com/sso/start", exchange_relay_state)
print("Open:", auth.initiate())
auth.complete("relay-state-from-callback")
client = CordumClient("https://api.cordum.example", auth=auth, tenant_id="tenant-123")
Retries + Idempotency-Key
Retries are enabled by default for idempotent methods (GET, HEAD, PUT,
DELETE, OPTIONS) and for POST only when you supply an idempotency key.
from uuid import uuid4
from cordum_sdk import CordumClient
from cordum_sdk._generated.models.submit_job_request import SubmitJobRequest
with CordumClient("https://api.cordum.example", auth="cordum_api_key", tenant_id="tenant-123") as client:
response = client.jobs.submit_job(
body=SubmitJobRequest(prompt="hello"),
idempotency_key=uuid4(),
)
print(response.job_id)
Pagination + Streaming
from cordum_sdk import CordumClient
with CordumClient("https://api.cordum.example", auth="cordum_api_key", tenant_id="tenant-123") as client:
for job in client.jobs.paginate("list_jobs"):
print(job.id)
for event in client.mcp.stream():
print(event.event, event.data)
break
Error handling
| Exception | Status |
|---|---|
AuthenticationError |
401 |
AuthorizationError |
403 |
NotFoundError |
404 |
ConflictError |
409 |
ValidationError |
400 / 422 |
RateLimitError |
429 |
ServerError |
5xx |
NetworkError / TimeoutError |
transport / timeout |
from cordum_sdk.errors import NotFoundError
Typed models
- Streaming events use the Pydantic v2
StreamEventmodel. - Generated request/response models live in
cordum_sdk._generated.models. - Friendly resource namespaces (
client.jobs,client.workflows, etc.) return those generated typed models directly.
Compatibility
- Python 3.9+
- Generated from
docs/api/openapi/cordum-api.yaml - Current bundled spec version:
2026-04-13
Examples
examples/hello_world.pyexamples/async_streaming.pydocs/quickstart.md
Regenerating from the spec
python -m pip install -e ".[generator]"
bash scripts/generate.sh
On Windows PowerShell:
python -m pip install -e ".[generator]"
.\scripts\generate.ps1
Metadata
Release files for cordum-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cordum_sdk-0.1.0.tar.gz | 152.6 kB | With provenance | Details for cordum_sdk-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cordum_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for cordum_sdk-0.1.0-py3-none-any.whl |
Total release size: 664.5 kB
Release files / cordum_sdk-0.1.0.tar.gz
| Download URL | cordum_sdk-0.1.0.tar.gz |
|---|---|
| Size | 152.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d16da8d82f6e29da4879a9997e98667063cdfee8c2b6eec214e89536fd5ef203
|
|
BLAKE2b-256 checksum How to use checksums |
fa6779961f91efed1116f262f7906708b94b05baf99a936eec8656481e9e60da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 22, 2026.
Transparency logRelease files / cordum_sdk-0.1.0-py3-none-any.whl
| Download URL | cordum_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 511.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7fe60cdad5c239fef6face600091c78731e0ba7ec19797222b095fd6a947d5b8
|
|
BLAKE2b-256 checksum How to use checksums |
d855b582db86c1a1fac401998a4eb86f773a4ffdff9efbc6981db1451752bd5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 22, 2026.
Transparency logSecurity for cordum-sdk 0.1.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
Both files in this release have been uploaded with provenance metadata.
Attestation for cordum_sdk-0.1.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 Apr 22, 2026.
Transparency logA 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.