Skip to main content

Cortex SDK for Python

Install

pip install cortex-suite-sdk

Quick start

import asyncio

from cortex_sdk import CortexClient


def on_message(msg):
    print(msg["type"], msg["payload"])


async def main():
    client = CortexClient(
        api_key="your-api-key",
        # auth_url="https://cortexsuite.app",  # optional override
        on_message=on_message,
    )
    await client.connect()
    await client.send_message(content="Hello")


asyncio.run(main())

API

See the full API reference. auth_url is optional; if omitted, the SDK uses its default auth base URL.

Error handling

from cortex_sdk import CortexClient, CortexError


def on_message(msg):
    if msg["type"] == "system::error":
        print("Runtime error:", msg["payload"]["code"])
        if msg["payload"].get("fatal"):
            pass  # handle unrecoverable session


client = CortexClient(
    api_key="your-api-key",
    on_message=on_message,
)

try:
    await client.connect()
except CortexError as err:
    if err.code in ("auth_invalid", "auth_refresh_failed"):
        pass  # prompt re-authentication

Metadata

Release files for cortex-suite-sdk 1.1.22

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

Source distribution (sdist)

Source distribution for cortex-suite-sdk 1.1.22
File Size Uploaded Provenance Actions
cortex_suite_sdk-1.1.22.tar.gz 48.0 kB With provenance Details for cortex_suite_sdk-1.1.22.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cortex-suite-sdk 1.1.22
File Interpreter ABI Platform Actions
cortex_suite_sdk-1.1.22-py3-none-any.whl Python 3 none any Details for cortex_suite_sdk-1.1.22-py3-none-any.whl

Total release size: 77.7 kB

Release files / cortex_suite_sdk-1.1.22.tar.gz

Download URL cortex_suite_sdk-1.1.22.tar.gz
Size 48.0 kB
Tags Source
SHA-256 checksum
How to use checksums
97cd581836e7f504c946e50697d6ccb0c5d7cb282b55a4f8ea656ae4062c6ec4
BLAKE2b-256 checksum
How to use checksums
d31cd20c2975effc9d3a32f399c5f5fddeb2f5166284c25324abe3e66a1e3773
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 13, 2026.

Transparency log

Release files / cortex_suite_sdk-1.1.22-py3-none-any.whl

Download URL cortex_suite_sdk-1.1.22-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4449fbf6ec91fec3749af2973e3f821bff497b8a63c86af7f7010a19f3c75aba
BLAKE2b-256 checksum
How to use checksums
aab6d07029c8c085f7340a6af36aa3745441bd3ef7187af721e7f15f956f7651
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 13, 2026.

Transparency log

Security for cortex-suite-sdk 1.1.22

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 cortex_suite_sdk-1.1.22.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 13, 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

1.1.22 This release

2 release files Full provenance

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