Start

Python SDK quickstart

Install the sx SDK, authenticate, and make a project-scoped call

The Python SDK is the primary sx surface. The installed sx distribution also provides the CLI and MCP server used by agent clients.

1. Install the customer package

Package access is organization-scoped. Use the package-index URL supplied during onboarding; the unrelated public PyPI project named sx is not this platform's SDK.

uv add sx --index "$SX_PACKAGE_INDEX"

The SDK requires Python 3.12 or newer. Verify the tool installation before continuing:

sx --help
command -v sx-mcp

2. Authenticate once

sx auth login
sx auth status

The browser-approved credential stays in your operating-system credential store. For CI and enrolled machines, use an explicitly scoped SX_API_KEY; do not put a human credential in a project file.

3. Connect from Python

Copy the project UUID from the Console project switcher or your onboarding details.

import asyncio
from uuid import UUID

import sx

PROJECT_ID = UUID("00000000-0000-0000-0000-000000000000")


async def main() -> None:
    async with sx.connect(PROJECT_ID) as client:
        task = await client.experience.task("task:pick-mug@production")
        print(task)


asyncio.run(main())

Replace the example UUID and task reference with values from your project. A valid read returns a canonical task value. Missing access, a wrong project, or an unknown task returns an explicit refusal—it never silently switches projects or services.

4. Run durable work

async with sx.connect(PROJECT_ID) as client:
    task = await client.experience.task("task:pick-mug@production")
    application = await client.autonomy.application("application:YOUR_SHA256_DIGEST")

    operation = await client.worlds.evaluate(application, for_task=task, seed=7)
    print(operation.ref)  # persist this immediately

    evaluation = await operation
    print(evaluation)

Awaiting the operation follows ordered updates and returns the typed terminal result. Closing the Python process does not cancel server work.

You are ready when

You can authenticate, connect one project, resolve a real task, submit an operation, and save its pillar/kind/id reference before waiting for completion.

Add an agent next

The same installation can configure your coding agent without exposing the credential:

sx project connect "$PROJECT_ID"

Continue with MCP + Skills installation, or stay in Python and learn the SDK mental model.