0

List collections of models

by
Published Oct 17, 2025

Example cURL request: ```console curl -s \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ https://api.replicate.com/v1/collections ``` The response will be a paginated JSON list of collection objects: ```json { "next": "null", "previous": null, "results": [ { "name": "Super resolution", "slug": "super-resolution", "description": "Upscaling models that create high-quality images from low-quality images." } ] } ```

Script replicate Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Replicate = {
3
  token: string;
4
};
5
/**
6
 * List collections of models
7
 * Example cURL request:
8

9
```console
10
curl -s \
11
  -H "Authorization: Bearer $REPLICATE_API_TOKEN" \
12
  https://api.replicate.com/v1/collections
13
```
14

15
The response will be a paginated JSON list of collection objects:
16

17
```json
18
{
19
  "next": "null",
20
  "previous": null,
21
  "results": [
22
    {
23
      "name": "Super resolution",
24
      "slug": "super-resolution",
25
      "description": "Upscaling models that create high-quality images from low-quality images."
26
    }
27
  ]
28
}
29
```
30

31
 */
32
export async function main(auth: Replicate) {
33
  const url = new URL(`https://api.replicate.com/v1/collections`);
34

35
  const response = await fetch(url, {
36
    method: "GET",
37
    headers: {
38
      Authorization: "Bearer " + auth.token,
39
    },
40
    body: undefined,
41
  });
42
  if (!response.ok) {
43
    const text = await response.text();
44
    throw new Error(`${response.status} ${text}`);
45
  }
46
  return await response.text();
47
}
48