Pagination and IDs
How list endpoints page through results, and what each object ID prefix means.
Paging through lists
List endpoints take two query parameters: limit, the maximum number of items to return, and
offset, the number of items to skip from the start of the list. offset defaults to 0.
Alongside the items, every list response carries a cursor object:
{
"training_runs": [
{
"training_run_id": "run_3Bz",
"base_model": "Qwen/Qwen3-8B",
"status": "ready"
}
],
"cursor": { "offset": 0, "limit": 20, "total_count": 41 }
}The collection key is named for the resource (data for files, training_runs for training
runs); the cursor object behaves the same everywhere. To fetch everything, advance offset
by the number of items each page returns, and stop once offset plus the returned count
reaches total_count:
import requests
runs = []
offset = 0
while True:
resp = requests.get(
'https://api.nucleus-ai.io/v1/training-runs',
headers={'Authorization': f'Bearer {API_KEY}'},
params={'limit': 20, 'offset': offset},
)
body = resp.json()
page = body['training_runs']
runs.extend(page)
offset += len(page)
if offset >= body['cursor']['total_count']:
breakObject ID prefixes
Every object ID starts with a prefix naming its type, so an ID in a log line or an error message tells you what it refers to and which endpoint retrieves it.
| Prefix | Example | Object |
|---|---|---|
file_ | file_9fQ2x | An uploaded JSONL dataset. See Files. |
ftjob_ | ftjob_7Kd1p | A managed fine-tuning job. See Fine-tuning jobs. |
eval_ | eval_2Wp | An evaluation of a model against a dataset. See Evaluations. |
run_ | run_3Bz | A low-level training run. See Training runs. |
ckpt_ | ckpt_000240 | A saved checkpoint of a run's weights. See Checkpoints. |
sess_ | sess_A1 | A session, assignable to a project. See Sessions. |
proj_ | proj_acme | A project grouping related resources. See Projects. |
key_ | key_2Fd | An API key. See API keys. |
op_ | op_91c4 | An asynchronous operation from a 202 response. See Poll an operation. |
wh_ | wh_5Qa | A webhook registration. See Register a webhook. |
One thing that looks like an ID but is not: checkpoint paths such as
nucleus://run_3Bz:train:0/sampler_weights/000240 are addresses, not IDs. They locate a set
of weights within a run rather than naming an API object, and several endpoints accept them
directly where weights are expected. See Architecture.