0

Get a model's README

by
Published Oct 17, 2025

Get the README content for a model. Example cURL request: ```console curl -s \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ https://api.replicate.com/v1/models/replicate/hello-world/readme ``` The response will be the README content as plain text in Markdown format: ``` # Hello World Model This is an example model that... ```

Script replicate Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Replicate = {
3
  token: string;
4
};
5
/**
6
 * Get a model's README
7
 * Get the README content for a model.
8

9
Example cURL request:
10

11
```console
12
curl -s \
13
  -H "Authorization: Bearer $REPLICATE_API_TOKEN" \
14
  https://api.replicate.com/v1/models/replicate/hello-world/readme
15
```
16

17
The response will be the README content as plain text in Markdown format:
18

19
```
20
# Hello World Model
21

22
This is an example model that...
23
```
24

25
 */
26
export async function main(
27
  auth: Replicate,
28
  model_owner: string,
29
  model_name: string,
30
) {
31
  const url = new URL(
32
    `https://api.replicate.com/v1/models/${model_owner}/${model_name}/readme`,
33
  );
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