Skip to main content

Xiaoyu Agent SDK

Python 3.11+ host API for the Xiaoyu workspace execution engine. The SDK runs in your process and depends on the exact same version of xiaoyu-agent.

Installation

pip install xiaoyu-agent-sdk

You do not need to install xiaoyu-agent yourself: pip pulls in xiaoyu-agent[sdk] pinned to the same version. Only the SDK extra comes along; the TUI, serve and browser extras are not installed. Nothing else needs to be running either — no xiaoyu CLI process or xiaoyu serve daemon.

Because the pin is exact, installing the SDK into an environment that already has a different xiaoyu-agent version will change that version, and with it the xiaoyu command from that environment. Use a separate virtual environment if you want to keep the two apart.

The SDK does not read Xiaoyu's .env or user configuration. Pass the model, credentials and endpoint through ModelOptions.

Quick start

import os
from pathlib import Path

from xiaoyu_agent_sdk import ModelOptions, Session, SessionOptions, run

options = SessionOptions(
    model=ModelOptions(
        model=os.environ["SDK_MODEL"],
        api_key=os.environ["SDK_API_KEY"],
        # Any OpenAI-compatible endpoint; defaults to https://api.openai.com/v1
        base_url=os.environ.get("SDK_BASE_URL", "https://api.openai.com/v1"),
    ),
    workspace=Path.cwd(),
)

# One-shot call
print(run("Summarize this project in one sentence", options).text)

# Multi-turn session: later turns see earlier ones
with Session(options) as session:
    print(session.run("Remember the number 42").text)
    print(session.run("What number did I give you?").text)

Model credentials are explicit. Mutating tools require host approval by default. Use Session for multiple turns, AsyncSession for async applications, and OutputSpec for validated JSON results with bounded repair attempts.

See SDK guide for ownership, approval, streaming, structured output, extension and persistence contracts. Runnable examples, most with an offline --demo mode, live in examples/sdk.

Metadata

Release files for xiaoyu-agent-sdk 0.80.1

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

Built distribution (wheel)

Table of built distributions (wheels) for xiaoyu-agent-sdk 0.80.1
File Interpreter ABI Platform Actions
xiaoyu_agent_sdk-0.80.1-py3-none-any.whl Python 3 none any Details for xiaoyu_agent_sdk-0.80.1-py3-none-any.whl

Release files / xiaoyu_agent_sdk-0.80.1-py3-none-any.whl

Download URL xiaoyu_agent_sdk-0.80.1-py3-none-any.whl
Size 45.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff815620036c84aa3edd726d50b9891c74d52a5f6bbb1efd862f51ed4d3b222a
BLAKE2b-256 checksum
How to use checksums
ec6d837ad6a4cbfcb4c5893805dff050c8af10989585e529bdd5a3162a0362f8
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 4, 2026.

Transparency log

Security for xiaoyu-agent-sdk 0.80.1

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

All 1 file in this release has been uploaded with provenance metadata.

Attestation for xiaoyu_agent_sdk-0.80.1-py3-none-any.whl

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 4, 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.

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