# Access and inference

Connect only after readiness and keep rental credentials separate from account credentials.

A successful reservation does not yet provide execution access. Poll `GET /api/v1/jobs/{id}` and wait for `RUNNING`, then request `GET /api/v1/jobs/{id}/access`.

## Choose the right access path

| Access | Credential and destination |
| --- | --- |
| AmpleRun's OpenAI-compatible relay | Account API key at `https://amplerun-api.spiry.org/api/v1/jobs/{id}/openai/v1` |
| A template's directly exposed model endpoint | The endpoint and per-rental `api_key` returned in access details |
| SSH | Your own private SSH key, matching the public key supplied when reserving |

Do not swap the per-rental key and account API key. Keep both out of shared notebook output, shell traces, and application logs.

## Call the model relay

With `AMPLERUN_API_KEY` and `AMPLERUN_JOB_ID` already provided privately to your process, this read-only Python standard-library example lists the rental's model IDs:

```python
import json
import os
import urllib.request

url = (
    'https://amplerun-api.spiry.org/api/v1/jobs/'
    + os.environ['AMPLERUN_JOB_ID']
    + '/openai/v1/models'
)
request = urllib.request.Request(url, headers={
    'Authorization': 'Bearer ' + os.environ['AMPLERUN_API_KEY']
})
with urllib.request.urlopen(request, timeout=30) as response:
    models = json.load(response)
print([model['id'] for model in models.get('data', [])])
```

Use an actually returned model ID for `/chat/completions`, `/completions`, or `/embeddings` where the selected template supports that operation. The relay follows the running rental; it is not a general pool that selects a different model or machine for you.

## SSH and result retrieval

Provide a one-line OpenSSH **public** key when creating a rental if you need SSH. Without it, SSH is disabled; model/API-only use does not require a key in the current REST and hosted MCP flows. Check [MCP version differences](https://docs.amplerun.com/agents/mcp.md) before using an older local client.

Use the returned `ssh_command` and verify `ssh_host_key_fingerprint`. Never turn off host-key verification just to bypass an unexpected mismatch.

After `STOPPED`, access may return `mode: retrieval-read-only` until `expires_at`. That access is for retrieval, not execution. Move important results off the machine before stopping; do not assume a retrieval endpoint exists for every template or tier.

---
Last reviewed: 2026-10-19.
Canonical: https://docs.amplerun.com/renting/access-and-inference/
