> For the complete documentation index, see [llms.txt](https://api.pdf.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.pdf.ai/v1/summarize-pdf.md).

# Summarize PDF

To get the summary of a PDF you just need `docId` of the PDF. To get `docId` [<mark style="color:blue;">upload</mark>](/v1/upload-pdf.md) the PDF first.

You can get the summary in the language you want using the `language` field. The default language is English.

{% hint style="warning" %}
The summary result will not be saved as a Chat. To save your chat history use [<mark style="color:blue;">chat</mark>](/v1/chat-with-pdf.md) API
{% endhint %}

## Summary of the PDF

## Summarize a PDF

<mark style="color:green;">`POST`</mark> `https://pdf.ai/api/v1/summary`

To get the summary of the PDF using its `docId`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| X-API-Key<mark style="color:red;">\*</mark> | string | \<API-Key>  |

#### Request Body

| Name                                    | Type    | Description                                                              |
| --------------------------------------- | ------- | ------------------------------------------------------------------------ |
| docId<mark style="color:red;">\*</mark> | string  | Document ID obtained after uploading PDF                                 |
| language                                | string  | Summary language e.g., "french"                                          |
| use\_gpt4                               | boolean | <p>To get response using GPT-4 model. <br>Default model: gpt-4-turbo</p> |
| model                                   | string  | <p>To choose GPT-4 model<br>"gpt-4o" or "gpt-4-turbo"(default)</p>       |

{% tabs %}
{% tab title="200 Summary of the PDF" %}

```json
{
    "content": "This is the summary of the PDF"
}
```

{% endtab %}

{% tab title="401 Invalid API key" %}

```json
{
    "error": "Invalid API key"
}
```

{% endtab %}

{% tab title="400: Bad Request No API key or docId is present" %}

```json
{
    "error": "No API key present"
}
```

{% endtab %}
{% endtabs %}
