Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Rayon Python SDK

Rayon manages current material for supported public sources. Send the source-page URL, profile and exact request. No script collection or preparation is needed for this header flow. Replace the reserved example URLs with your approved source and endpoint. {} uses default profile values; supply measured values when needed.

Keep the API key server-side. Your integration owns the target HTTP client, authentication, cookies and session. Rayon generates telemetry; your client sends the target request.

Quickstart · Material options · API reference

Install

Release candidate for the preparation-required server contract. Deploy the compatible server before migrating clients.

Requires Python 3.10+.

python -m pip install 'rayon-sdk-py>=3.0.0rc2,<4'

Generate

import os
from rayon_sdk_py import Client

shape = {
    "source_url": "https://shop.example.com/account",
    "profile": {},
    "request": {
        "url": "https://shop.example.com/api/check",
        "method": "POST",
        "content_type": "application/json",
        "body": "{}",
    },
}
with Client(os.environ["RAYON_API_KEY"]) as client:
    result = client.generate(shape)
    # Apply result.headers with your target client. Keep client open for further calls.

Use AsyncClient with async with and await client.generate(shape) in async applications. Both clients accept the same inputs and return the same metadata.

Apply every returned header unchanged, including optional a0, to the exact request. Keep application headers and session state in your target client. Generate fresh telemetry for each request and inspect the target response to check acceptance. Rayon returns no target cookies.

Material and readiness

Generation accepts ready managed material or a ready private reference. Custom scripts must go through preparation. Unsupported, expired or unprepared inputs return an explicit error. Generation does not prepare material or retry automatically.

Custom material requires preparation

Preparation can take several minutes. Wait helpers return as soon as ready, with a 30-minute default limit. Timeouts and cancellation leave the job available to resume.

ready = client.prepare_and_wait(explicit_shape)
context = {k: v for k, v in explicit_shape.items() if k not in ("scripts", "material_ref")}
result = client.generate({**context, "material_ref": ready.material_ref})

Submit complete sources and the intended context with the preparation helper. Wait for state: ready, then use its material_ref for generation. A queued job can already contain a reference; that does not establish readiness. Readiness is scoped to supported inputs. Normal request inputs may vary only within that documented scope; an unchanged program does not establish universal coverage.

Refresh custom material outside generation before the earlier of ready_until and material_expires_at, or after a supported deployment change. Wait for the replacement to become ready before switching references. Keep original sources on your side for refresh. Expired references are never recovered by uploading scripts to a solve call. For managed header calls, keep both material fields omitted on every request. Form mode requires an explicit ready reference.

Client options and errors

Reuse one client for connections. usage() is a free access/allowance check. Default API URL: https://api.rayonapi.com; timeout: 45 seconds. Set base_url or timeout in the constructor. Use validate_profile for offline validation.

Errors inherit RayonError: ValidationError, TransportError, HTTPError and InvalidResponseError. Metadata includes status_code, request_id, code, retry_after, reason, action, domain, field, billing_status and retryable when available. Check request history before retrying a timeout or uncertain billing outcome. Generation is never automatically retried. Refresh expired custom material through preparation before resubmitting a solve.

The client retains no solve-upload source cache. Automatic generation never pins a returned reference. The SDK does not fetch target scripts, send target requests or cache generated telemetry.

Errors · Release instructions · Support · MIT license

Metadata

Release files for rayon-sdk-py 3.0.0rc2

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

Source distribution (sdist)

Source distribution for rayon-sdk-py 3.0.0rc2
File Size Uploaded Provenance Actions
rayon_sdk_py-3.0.0rc2.tar.gz 46.6 kB With provenance Details for rayon_sdk_py-3.0.0rc2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rayon-sdk-py 3.0.0rc2
File Interpreter ABI Platform Actions
rayon_sdk_py-3.0.0rc2-py3-none-any.whl Python 3 none any Details for rayon_sdk_py-3.0.0rc2-py3-none-any.whl

Total release size: 68.6 kB

Release files / rayon_sdk_py-3.0.0rc2.tar.gz

Download URL rayon_sdk_py-3.0.0rc2.tar.gz
Size 46.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d9e1b46fefff1fccbe0de9bc43fc71035821365023c013eaefad59beea41bfb2
BLAKE2b-256 checksum
How to use checksums
f224f1d16d658e54d6fa17a6f65a75ab2e21cac636a71f8dabda8b4d1179e6e6
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 8, 2026.

Transparency log

Release files / rayon_sdk_py-3.0.0rc2-py3-none-any.whl

Download URL rayon_sdk_py-3.0.0rc2-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a43033bc0f5372af1a8a4a217dd568d81798ffcde40edea3abc2f587c3e5e9b4
BLAKE2b-256 checksum
How to use checksums
e727c1d0f7e96697a4447ac62f1ac43ce6c51376519b41efe3ede426cd471c8c
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 8, 2026.

Transparency log

Security for rayon-sdk-py 3.0.0rc2

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 rayon_sdk_py-3.0.0rc2.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 8, 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