roasOS
Concepts

Pagination

How to read a long list in pages.

A list endpoint gives its results in pages. One cursor rule serves every list of the API.

How pages work

Each response contains a meta object:

{
  "data": [ ... ],
  "meta": {
    "has_more": true,
    "cursor": "eyJ2IjoyLCJjcmVhdGVkX2F0..."
  }
}

To read the next page, send that cursor value in your next request:

curl "https://api.roasos.com/v1/jobs?limit=20&cursor=CURSOR_FROM_LAST_RESPONSE" \
  -H "Authorization: Bearer roasos_sk_..."

If has_more is false, you are at the end of the list.

Options

  • limit — the number of items in one page. The range is 1 to 100. The default value is 20.
  • cursor — the value of meta.cursor from the last response.

A cursor that roasOS cannot read is a 400 invalid_cursor. Request the first page again.

Do not parse a cursor, and do not construct a cursor. The format can change. Send back only the value that you received.

The lists that page

EndpointHolds
GET /v1/jobsevery job of the workspace
GET /v1/generationsthe older generation records
GET /v1/scenesyour saved scenes
GET /v1/avatarsyour saved avatars
GET /v1/productsyour products
GET /v1/voicesyour cloned voices
GET /v1/skillsyour saved skills
GET /v1/memory/pinsthe facts you pinned
GET /v1/discover/itemsthe roasOS library of example ads
GET /v1/account/usageone line for each charge
GET /v1/account/ledgerthe reservations, the captures and the refunds

Two list doors take no cursor. GET /v1/jobs/{id}/events and GET /v1/agent-runs/{id}/events answer with the whole timeline of one run, in order. A job holds eight lifecycle events at most. An agent run answers with 500 events at most.

On this page