Overview
All SDK runtime settings live on ResonTechConfig. Construct one and pass it to ResonTech(config).
from resontech import ResonTechConfig
config = ResonTechConfig(
base_url="https://api.reson.tech",
platform_api_key="rsk_live_...", # or set RESON_API_KEY env var
s3_access_key_id="AKIA...",
s3_secret_access_key="...",
)Required Fields
platform_api_key is kwarg-only. The client rides it as Authorization: Bearer <key> on every request — don't pass a predict_api_key here by mistake (those go on InferenceClient instead and use X-API-Key). The prefix check will raise ResonAuthError if you cross them.Optional Fields (with Defaults)
The SDK resolves your bucket alias automatically; it is also shown on Profile → Storage.
Choosing Workers — gpu_models & max_price_per_gpu_hour
These live on InferenceConfig and on sdk.rt_submit(...) for training. There are two mutually exclusive ways to get workers and no flag to switch between them: passing worker_ids pins specific machines, omitting it means the platform selects for you.
When the platform selects, both fields below are required. Together they bound the two things a job can otherwise run away with — which hardware it lands on, and what it costs. There is deliberately no way to auto-select without saying both.
Order is a preference, not a set
The pool is filled from the first id before the next is touched. So with gpu_models=["rtx_5090", "rtx_5070"], one RTX 5090 free, two RTX 5070s free, and two workers needed, you get the 5090 plus one 5070 — the platform takes everything it can of your first choice, then tops up from your second. List the card you would rather have first.
from resontech import InferenceConfig
# Platform selects — both fields required
InferenceConfig(
gpu_models=["rtx_5090", "rtx_4090"], # ordered preference
max_price_per_gpu_hour=3.00, # $ per GPU per hour
)
# You pin the machines — neither field is used
InferenceConfig(worker_ids=["w-12", "w-13"])ValidationError before anything is uploaded, naming the two fields and showing the lines to add. A GPU id that isn't in the catalog is rejected by the API up front with the valid ids listed — a typo never silently becomes “not enough workers”.Valid ids
Click the GPUs you want, in preference order, and copy the line:
Loading GPU ids…
Environment-Variable Pattern
platform_api_key falls back to RESON_API_KEY when omitted; the rest of the fields are yours to source however you like:
import os
from resontech import ResonTech, ResonTechConfig
config = ResonTechConfig(
base_url=os.environ["RT_BASE_URL"],
# platform_api_key omitted → read from RESON_API_KEY
s3_access_key_id=os.environ["RT_S3_KEY"],
s3_secret_access_key=os.environ["RT_S3_SECRET"],
s3_endpoint=os.environ.get("RT_S3_ENDPOINT", "https://s3.reson.tech"),
dashboard_url=os.environ.get("RT_DASHBOARD_URL", "https://app.reson.tech"),
)
sdk = ResonTech(config)Self-hosted (Private Fabric) example
ResonTechConfig(
base_url="https://api.resontech.example.com",
platform_api_key="rsk_live_...",
s3_access_key_id="...",
s3_secret_access_key="...",
s3_endpoint="https://s3.resontech.example.com",
dashboard_url="https://app.resontech.example.com",
)Rotating a Leaked Platform API Key
If you committed the key by accident or suspect compromise:
- Open Profile → Developer in the web UI.
- Click Rotate next to the compromised key — mints a new plaintext (shown once) and revokes the old one.
- Paste the new value into your
ResonTechConfigor updateRESON_API_KEY.
401 invalid_api_key. S3 secret rotation is separate: Profile → Storage → Rotate Key.