SDK — Configuration Reference

Every field on ResonTechConfig — required keys, sensible defaults, environment-variable patterns, self-hosted overrides — plus how to choose workers with gpu_models and a price cap.

Overview

All SDK runtime settings live on ResonTechConfig. Construct one and pass it to ResonTech(config).

Python
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

FieldTypeDescription
base_urlstrBase URL of the REST API. Trailing slash is stripped.
platform_api_keystrPlatform API key minted at Profile → Developer. Starts with rsk_. Env fallback: RESON_API_KEY.
s3_access_key_idstrAccess key ID issued when you provisioned the bucket.
s3_secret_access_keystrSecret key shown once at bucket creation. Rotate from Profile → Storage if lost.
note
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)

FieldDefaultDescription
s3_bucket_alias""Bucket alias. Resolved from your account automatically if empty.
s3_endpoint"https://s3.reson.tech"S3-compatible endpoint URL. Override for a self-hosted (Private Fabric) install.
s3_region"garage"Region label. The storage service ignores it, but boto3 requires a value.
dashboard_url"https://app.reson.tech"Web UI base. Used to build job.dashboard_url. Match your deployment.

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.

FieldTypeDescription
worker_idslist[str]Pin to specific workers. When set, the two fields below are unused.
gpu_modelslist[str]REQUIRED unless worker_ids is set. Ordered GPU-model preference, as catalog ids.
max_price_per_gpu_hourfloatREQUIRED unless worker_ids is set. Ceiling in dollars PER GPU per hour — the unit the catalog quotes. A 4-GPU worker costs 4× this.
only_mine_workersboolRestrict selection to nodes you own.

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.

Python
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"])
note
Omitting both on the auto path raises 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:

Python
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 ResonTechConfig or update RESON_API_KEY.
note
Revocation takes effect within seconds. Requests with the old key fail with 401 invalid_api_key. S3 secret rotation is separate: Profile → Storage → Rotate Key.