Sort models by creation date via API
The GET /v1/models
endpoint now supports sorting with the sort_by
and sort_direction
query parameters. This makes it easier to fetch the newest models via the API.
# Sort by when models were first created, newest first
curl -s \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
"https://api.replicate.com/v1/models?sort_by=model_created_at&sort_direction=desc"
Sorting options
model_created_at
: Sort by when the model was first createdlatest_version_created_at
: Sort by when the model’s latest version was created (default)
Sort direction can be asc
(ascending, oldest first) or desc
(descending, newest first).
The default behavior remains unchanged: models are sorted by latest_version_created_at
in descending order (newest versions first).