Skip to content

Preview: Model Atlas is in development and not yet available.

Pagination

Every list endpoint returns one page at a time: data, the page’s items, and next_cursor, the key to the next page.

  1. Send the request with the filters you want, and optionally limit: 1 to 200 items, 50 by default.
  2. Read data.
  3. If next_cursor is a string, send the same request again with cursor set to it. If it’s null, that was the last page.
Terminal window
curl -H "Authorization: Bearer $MA_API_KEY" "$MA_API/v1/providers?limit=2"
{
"data": [
{"slug": "amazon", "name": "Amazon", "country_of_origin": "US", "jurisdiction": "US"},
{"slug": "anthropic", "name": "Anthropic", "country_of_origin": "US", "jurisdiction": "US"}
],
"next_cursor": "eyJhZnRlciI6ImFudGhyb3BpYyIsImYiOiJmNmI1YWE5NTMxNTgxZmZmIn0"
}

(From the listProviders example, trimmed.) The next page:

Terminal window
curl -H "Authorization: Bearer $MA_API_KEY" \
"$MA_API/v1/providers?limit=2&cursor=eyJhZnRlciI6ImFudGhyb3BpYyIsImYiOiJmNmI1YWE5NTMxNTgxZmZmIn0"
  • Opaque. Pass it back unchanged. Don’t build or parse one.
  • Tied to its request. A cursor belongs to the endpoint and the filters it came from. On catalog and event lists, a cursor sent with different filters is 400 invalid_parameter, as is a malformed one. You can change limit between pages.
  • Not secret. It holds the last item’s position and a hash of the filters, nothing about your account.
Endpoint Order
Providers, platforms, models, versions, offerings by slug
/v1/availability by offering slug, then region
/v1/events oldest first, by event ID
API keys, webhook endpoints, subscriptions, deliveries newest first

Catalog lists are read from one consistent snapshot per page. Data can change between pages (sources load during the day), so a long walk through a catalog list may see an entry change while you page.

/v1/events is oldest first, and new events always sort after existing ones, so it can be replayed in order. Events written while you page come at the end, never in the middle.

On the last page next_cursor is null, so you can’t use it to wait for new events. Use after instead: pass the id of the last event you processed, and you get the events after it.

Terminal window
curl -H "Authorization: Bearer $MA_API_KEY" \
"$MA_API/v1/events?after=01KB5Z6T8QY0M7J3V2C9W4D1EN"

Store the last id you processed, and poll with it. The Watch the models you use tutorial has a complete loop.

What Limit
limit 1 to 200 (default 50). Outside that range is 400 invalid_parameter.
models, slug up to 100 comma-separated entries