Skip to main content

raytrace-sdk

Create and drive RayTrace cloud sandboxes from Python. Every coding-agent session in a sandbox is recorded to your organization's dashboard.

pip install raytrace-sdk

Python 3.10 or newer. No dependencies.

Authenticate

Create an org API key on your RayTrace account page (Account → API keys) and set it in the environment:

export RAYTRACE_API_KEY=rtk_...

Or pass it directly: RayTrace(api_key="rtk_...").

Quickstart

from raytrace_sdk import RayTrace

rt = RayTrace()

# Upload a project folder (.git, .env, keys and credentials are left out).
sandbox = rt.sandboxes.create(name="my-app", directory=".", size="small")

result = sandbox.exec("pytest", timeout_seconds=300)
print(result.exit_code, result.stdout)

sandbox.stop()

Sandboxes

Call What it does
rt.sandboxes.create(name=, size=, directory= | files= | archive=) New sandbox from a folder, an in-memory file map, or .tar.gz bytes
rt.sandboxes.create(repo=, ref=) New sandbox from a Git repository: an https or ssh URL, or owner/name on GitHub; ref picks a branch or tag. Cloned with this machine's git and credentials
rt.sandboxes.list() / rt.sandboxes.get(id) Your organization's sandboxes
sandbox.exec(command, timeout_seconds=) Runs a command and waits for the result (exit_code, stdout, stderr, state)
sandbox.stop() Stops it; files are kept and billing stops
sandbox.start(size=) Starts it again, restoring an archived sandbox first
sandbox.keep_alive(minutes) Holds off the idle stop for a long-running job (up to 4 hours)
sandbox.destroy(keep_traces=) Deletes it; keep_traces=True keeps its recordings on paid plans
sandbox.status, sandbox.size From the last fetch

Sizes are small, medium and large.

Usage and keys

rt.usage.get(days=30)        # credits spent and remaining
rt.api_keys.create("ci")     # the key is returned once
rt.api_keys.list()
rt.api_keys.revoke(key_id)

Billing and errors

Running sandboxes are paid from prepaid credits in 15-minute blocks, and stop by themselves after 15 minutes of no activity. Failed calls raise RayTraceError with status and code:

code Meaning
insufficient_balance Not enough credit for the next 15 minutes; top up on the account page
recording_plan_required Cloud sandboxes need an Individual or Team plan
no_capacity No room right now; retry shortly

The full HTTP contract is in docs/v1-contract.md.

Metadata

Release files for raytrace-sdk 0.2.0

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

Source distribution (sdist)

Source distribution for raytrace-sdk 0.2.0
File Size Uploaded Provenance Actions
raytrace_sdk-0.2.0.tar.gz 9.4 kB With provenance Details for raytrace_sdk-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for raytrace-sdk 0.2.0
File Interpreter ABI Platform Actions
raytrace_sdk-0.2.0-py3-none-any.whl Python 3 none any Details for raytrace_sdk-0.2.0-py3-none-any.whl

Total release size: 18.1 kB

Release files / raytrace_sdk-0.2.0.tar.gz

Download URL raytrace_sdk-0.2.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
35e66b9be17edb7fb15297ce8a0d097025367b8521a9579124ed8b4d4526ca9d
BLAKE2b-256 checksum
How to use checksums
6274ce46dae2db667e33dd7e09f3e82973b2bca854a7753d5785cf129b98ff3b
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 23, 2026.

Transparency log

Release files / raytrace_sdk-0.2.0-py3-none-any.whl

Download URL raytrace_sdk-0.2.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3d64cb54352f87a07750c93b545eaf03a2afb75e78f3573084cbdd552d89683
BLAKE2b-256 checksum
How to use checksums
3f0664bba0b9a0a5a81f4dc5d241a41191db327f165d28c479fe724d760eb2fe
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 23, 2026.

Transparency log

Security for raytrace-sdk 0.2.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.

Select from 2 files

Attestation for raytrace_sdk-0.2.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 Nov 23, 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

0.2.0 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