> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r3al.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the platform

> Accounts, API keys, monitoring jobs, and your plan on platform.r3al.ai.

Since 2.0, quantization runs on the R3AL platform at [platform.r3al.ai](https://platform.r3al.ai). The SDK is the thin client that uploads your model, submits the job, and downloads the result. This page is the bridge between the two.

## Create an account and an API key

<Steps>
  <Step title="Sign up and verify your email">
    Create an account at [platform.r3al.ai](https://platform.r3al.ai). Verify your email to activate the account.
  </Step>

  <Step title="Mint an API key">
    Open the **SDK / API keys** page and create a key. Live keys look like `r3l_live_...`. The secret is shown **once**, so copy it immediately. If you lose it, revoke it and mint a new one.
  </Step>
</Steps>

## Connect the SDK

The SDK resolves your key from, in order: the argument you pass, `platform.login(...)`, then the `R3AL_API_KEY` environment variable.

```python theme={null}
import r3alai.platform as platform

platform.login("r3l_live_...")
```

```bash theme={null}
export R3AL_API_KEY="r3l_live_..."
```

To point at a non-default platform host (for example a staging URL), use `configure`:

```python theme={null}
import r3alai.platform as platform

platform.configure(base_url="https://platform.r3al.ai", api_key="r3l_live_...")
```

## Monitor jobs

Every `quantize()` or `train_qat()` call creates a job on the platform. The SDK prints live progress while it waits:

```text theme={null}
[r3al] job 1a2b3c4d · running · 62% · calibrating · 00:48 elapsed
```

Open the platform's **Jobs** page to watch the same job in real time: its status (`pending`, `running`, `completed`, `error`), a progress bar, and a history of every run you have submitted. From the SDK you can inspect a job directly:

```python theme={null}
from r3alai.platform import PlatformClient

client = PlatformClient()
job = client.get_job("job_...")
print(job.status, job.progress)
```

## Your plan and the free-run limit

The free plan includes **3 runs**. Each `quantize` or QAT job consumes one run; local `benchmark()`, `load()`, and export do not. Check what you have left from the SDK or the platform's usage/plan page:

```python theme={null}
from r3alai.platform import PlatformClient

print(PlatformClient().usage())   # plan + remaining free runs
```

A run beyond your quota raises `PlanLimitError` (HTTP 402):

```python theme={null}
from r3alai.platform import PlanLimitError
from r3alai.quant import Quantizer

try:
    Quantizer().quantize(
        "model.onnx",
        calibration_data=["img1.jpg", "img2.jpg", "img3.jpg"],
        output_dir="./out",
    )
except PlanLimitError:
    print("Free plan limit reached. Upgrade at platform.r3al.ai.")
```

Upgrade your plan on the platform to lift the limit.

## Download results

`quantize()` and `train_qat()` download the deliverable automatically into `output_dir`, and `result.path` points at it. If you submit a job with the lower-level `PlatformClient` and want to download later, use the `Job` handle:

```python theme={null}
from r3alai.platform import PlatformClient

client = PlatformClient()
job = client.quantize(
    "model.onnx",
    calibration_data=["img1.jpg", "img2.jpg", "img3.jpg"],  # required for the default ptq_static
)                                     # uploads + submits, returns a Job
job.wait()                            # blocks with live progress
bundle_dir = job.download("./out")    # downloads + unpacks the bundle
```

The unpacked bundle contains the quantized model and `r3alai_manifest.json`, so local [`load()`](/concepts/manifest) and [`benchmark()`](/guides/benchmarking) work on it directly.

## Errors

All platform errors subclass `R3ALPlatformError`:

| Error                 | When                                   |
| --------------------- | -------------------------------------- |
| `AuthenticationError` | Missing or invalid API key (HTTP 401)  |
| `PlanLimitError`      | Free-run quota reached (HTTP 402)      |
| `UploadError`         | A model or calibration upload failed   |
| `JobFailedError`      | The job reached a terminal error state |

## Next steps

<CardGroup cols={2}>
  <Card title="End-to-end workflow" icon="route" href="/guides/workflow">
    Export, quantize, monitor, download, validate.
  </Card>

  <Card title="Python SDK" icon="code" href="/sdk/quantizer">
    The Quantizer facade, PlatformClient, and Job.
  </Card>
</CardGroup>
