Get an API key
- Sign in with Discord.
- Accept the Terms and acknowledge the Privacy Policy in the dashboard.
- Request Shape access for your source page and API endpoint domains.
- Create an API key after access is approved. Keep
RAYON_API_KEYon your server.
Generation uses your available allowance or funds. The usage check below is free.
To claim the free trial, join the Rayon API Discord and verify your membership in the dashboard, then claim 1,000 free requests. The trial can be claimed once per Discord identity.
Install your SDK
python -m pip install 'rayon-sdk-py>=1.1.4,<2'Use Python 3.10+ or Node.js 20.18.1+. SDKs also covers Go and an adapter for your existing Playwright page; Go v1.0.0 and Playwright 0.1.0 are published.
Check usage for free
Call usage() to verify your key and read available allowance. This does not consume generation quota.
import os
from rayon_sdk_py import Client
with Client(os.environ["RAYON_API_KEY"]) as client:
print(client.usage())
# Continue with generation here to reuse this client.Prepare inputs
Supply a source-page URL, complete ordered protection script sources, a profile object and the exact target request. Save them as shape.json using the input guide, or construct the object in your application.
Use measured browser values when your integration needs them and JavaScript-visible cookies only when applicable. You can start directly with the SDK. No browser collector or helper is required. Your existing HTTP client or browser owns target authentication, cookies, proxy and session settings when needed.
Generate with the SDK
# python -m pip install 'rayon-sdk-py>=1.1.4,<2'
import json
import os
from pathlib import Path
from rayon_sdk_py import Client
shape = json.loads(Path("shape.json").read_text(encoding="utf-8"))
with Client(os.environ["RAYON_API_KEY"]) as client:
# Keep this client open across calls to reuse material in either mode.
result = client.generate(shape)
print(result.request_id)
# Apply result.headers to that exact request with your target client.Keep one client open across calls. Python and JavaScript SDK 1.1.4 reuse material in both header and form modes while generating fresh telemetry for each request. See material reuse for details.
Apply the result
Apply the entire returned header map unchanged, including optional a0, to that exact request through your existing target client. Keep any application headers and session state your flow requires. For observed URL-encoded form telemetry, follow Form payload integration.
The core SDK and API never download script URLs or send the target request. Generation does not establish target acceptance; inspect the target response. See Errors and limits for uncertain outcomes. Direct REST is an advanced fallback in the API reference.