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.77.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xiaoyu_agent_sdk-0.77.0-py3-none-any.whl | Python 3 | none | any | Details for xiaoyu_agent_sdk-0.77.0-py3-none-any.whl |
Release files / xiaoyu_agent_sdk-0.77.0-py3-none-any.whl
| Download URL | xiaoyu_agent_sdk-0.77.0-py3-none-any.whl |
|---|---|
| Size | 45.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b298a84585fcf9067cac95c046065a5045007592c0b76980f7338ae2d890f9e4
|
|
BLAKE2b-256 checksum How to use checksums |
7c719c8ff97c1f243dae7ada865c47b9b8c507a1823b33a4e6e0ffadd60976d0
|
| 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 2, 2026.
Transparency logSecurity for xiaoyu-agent-sdk 0.77.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
All 1 file in this release has been uploaded with provenance metadata.
Attestation for xiaoyu_agent_sdk-0.77.0-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 2, 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.