---
title: PDF-Unterstützung
url: https://platform.claude.com/docs/de/build-with-claude/pdf-support
description: "Verarbeite PDFs mit Claude: Extrahiere Text, analysiere Diagramme und verstehe visuelle Inhalte aus deinen Dokumenten."
featureMetadata:
  status: stable
  zdr:
    eligibility: eligible
    note: Excludes [Covered Models](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#model-specific-data-retention-requirements).
  supportedModels:
    - claude-fable-5-2
    - claude-mythos-5-2
    - claude-fable-5-1
    - claude-mythos-5-1
    - claude-fable-5
    - claude-mythos-5
    - claude-mythos-preview
    - claude-opus-5-5
    - claude-opus-5
    - claude-sonnet-5-5
    - claude-sonnet-5
    - claude-haiku-5-5
    - claude-haiku-4-5-20251001
    - claude-opus-4-8
    - claude-opus-4-7
    - claude-opus-4-6
    - claude-sonnet-4-6
    - claude-opus-4-5-20251101
    - claude-sonnet-4-5-20250929
  supportedPlatforms:
    Claude API: stable
    Amazon Bedrock:
      availability: stable
      note: Nur Base64-Quellen.
    Amazon Bedrock (bedrock-runtime):
      availability: stable
      note: Nur Base64-Quellen.
    Claude Platform on AWS: stable
    Claude Models on Google Cloud (Anthropic managed): stable
    Claude Models on Google Cloud (Google managed):
      availability: stable
      note: Nur Base64-Quellen.
    Microsoft Foundry:
      availability: stable
      note: "`file_id`-Quellen erfordern ein Deployment vom Typ Hosted on Anthropic."
---

Du kannst Claude zu beliebigen Texten, Bildern, Diagrammen und Tabellen in den von dir bereitgestellten PDFs befragen. Einige Beispielanwendungsfälle:

* Analyse von Finanzberichten und Verständnis von Diagrammen/Tabellen
* Extraktion wichtiger Informationen aus juristischen Dokumenten
* Unterstützung bei der Übersetzung von Dokumenten
* Umwandlung von Dokumentinformationen in strukturierte Formate

## Bevor du beginnst

### PDF-Anforderungen prüfen

Claude funktioniert mit jedem Standard-PDF. Stelle sicher, dass deine Anfragegröße diese Anforderungen erfüllt:

| Anforderung                     | Limit                                                                                                                                                                         |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Maximale Anfragegröße           | 128 MB bei der First-Party-Claude-API (variiert je nach Plattform; siehe [Limits für die Anfragegröße](https://platform.claude.com/docs/de/api/overview#request-size-limits)) |
| Maximale Seitenzahl pro Anfrage | 600 (100, wenn das Kontextfenster der Anfrage unter 1M Token liegt)                                                                                                           |
| Format                          | Standard-PDF (keine Passwörter/Verschlüsselung)                                                                                                                               |

Beide Limits gelten für die gesamte Anfrage-Payload, einschließlich aller anderen Inhalte, die zusammen mit PDFs gesendet werden. Bei großen PDFs solltest du in Erwägung ziehen, sie mit der [Files API](https://platform.claude.com/docs/de/build-with-claude/files) hochzuladen und per `file_id` zu referenzieren, um die Anfrage-Payloads klein zu halten.

<Tip>
  Dichte PDFs (viele Seiten mit kleiner Schrift, komplexe Tabellen oder umfangreiche Grafiken) können das „context window“ (Kontextfenster) füllen, bevor das Seitenlimit erreicht ist. Anfragen mit großen PDFs können auch fehlschlagen, bevor das Seitenlimit erreicht ist, selbst bei Verwendung der Files API. Versuche, das Dokument in Abschnitte aufzuteilen; bei großen Dateien kann auch das Herunterskalieren eingebetteter Bilder helfen, da jede Seite als Bild verarbeitet wird.
</Tip>

Da die PDF-Unterstützung auf den Vision-Fähigkeiten von Claude beruht, unterliegt sie denselben [Einschränkungen und Überlegungen](https://platform.claude.com/docs/de/build-with-claude/vision#limitations) wie andere Vision-Aufgaben.

### Unterstützte Plattformen und Modelle

Alle [aktiven Modelle](https://platform.claude.com/docs/de/models/overview) unterstützen die PDF-Verarbeitung.

<Note>
  Reine Textdateien wie .txt, .csv oder .md können direkt in Document-Blöcken verwendet werden: Lade sie mit dem MIME-Typ `text/plain` in die Files API hoch und referenziere sie per `file_id`. Binärformate wie .xlsx oder .docx werden in Document-Blöcken nicht unterstützt, konvertiere sie daher zuerst in Text oder PDF. Siehe [Arbeiten mit anderen Dateiformaten](https://platform.claude.com/docs/de/build-with-claude/files#working-with-other-file-formats).
</Note>

## PDFs mit Claude verarbeiten

### Sende deine erste PDF-Anfrage

Beginne mit einem Beispiel, das die Messages API verwendet. Um Claude ein PDF zu übergeben, sende es in einem [`document`-Inhaltsblock](https://platform.claude.com/docs/de/api/messages#document_block_param) mit einer von drei Arten von Quellen. Deine Plattform bestimmt, welche Arten du verwenden kannst (siehe [Verfügbarkeit](https://platform.claude.com/docs/de/build-with-claude/pdf-support#feature-availability)). Wähle unter diesen Arten danach, wo sich das PDF befindet, wie groß es ist und wie oft du es verwendest:

1. **Ein online gehostetes PDF:** Referenziere es über seine URL ([Option 1: URL-basiertes PDF-Dokument](https://platform.claude.com/docs/de/build-with-claude/pdf-support#option-1-url-based-pdf-document)).
2. **Ein PDF auf deinem lokalen System oder ohne URL:** Sende es als base64-kodierte Daten ([Option 2: Base64-kodiertes PDF-Dokument](https://platform.claude.com/docs/de/build-with-claude/pdf-support#option-2-base64-encoded-pdf-document)).
3. **Ein großes PDF oder eines, das du wiederholt verwenden wirst:** Lade es mit der [Files API](https://platform.claude.com/docs/de/build-with-claude/files) hoch und referenziere es per `file_id` ([Option 3: Files API](https://platform.claude.com/docs/de/build-with-claude/pdf-support#option-3-files-api)).

#### Option 1: URL-basiertes PDF-Dokument

Referenziere das PDF über seine URL:

<CodeGroup>
  ```bash cURL
  curl https://api.anthropic.com/v1/messages \
    -H "content-type: application/json" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -d '{
      "model": "claude-opus-5-5",
      "max_tokens": 1024,
      "messages": [{
        "role": "user",
        "content": [{
          "type": "document",
          "source": {
            "type": "url",
            "url": "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
          }
        },
        {
          "type": "text",
          "text": "What are the key findings in this document?"
        }]
      }]
    }'
  ```

  ```bash CLI
  ant messages create <<'YAML'
  model: claude-opus-5-5
  max_tokens: 1024
  messages:
    - role: user
      content:
        - type: document
          source:
            type: url
            url: https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf
        - type: text
          text: What are the key findings in this document?
  YAML
  ```

  ```python Python
  client = anthropic.Anthropic()
  message = client.messages.create(
      model="claude-opus-5-5",
      max_tokens=1024,
      messages=[
          {
              "role": "user",
              "content": [
                  {
                      "type": "document",
                      "source": {
                          "type": "url",
                          "url": "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf",
                      },
                  },
                  {"type": "text", "text": "What are the key findings in this document?"},
              ],
          }
      ],
  )

  print(message.content)
  ```

  ```typescript TypeScript
  const anthropic = new Anthropic();

  const response = await anthropic.messages.create({
    model: "claude-opus-5-5",
    max_tokens: 1024,
    messages: [
      {
        role: "user",
        content: [
          {
            type: "document",
            source: {
              type: "url",
              url: "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
            }
          },
          {
            type: "text",
            text: "What are the key findings in this document?"
          }
        ]
      }
    ]
  });

  console.log(response);
  ```

  ```csharp C#
  var client = new AnthropicClient();

  // Erstelle einen Dokumentblock mit URL
  var documentParam = new DocumentBlockParam
  {
      Source = new UrlPdfSource
      {
          Url = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf",
      },
  };

  // Erstelle eine Nachricht mit Dokument- und Text-Content-Blöcken
  var message = await client.Messages.Create(new MessageCreateParams
  {
      Model = Model.ClaudeOpus5_5,
      MaxTokens = 1024,
      Messages =
      [
          new UserMessageParam
          {
              Content = new List<ContentBlockParam>
              {
                  documentParam,
                  new TextBlockParam("What are the key findings in this document?"),
              },
          },
      ],
  });

  Console.WriteLine(string.Join("\n", message.Content));
  ```

  ```go Go
  client := anthropic.NewClient()

  message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
  	Model:     anthropic.ModelClaudeOpus5_5,
  	MaxTokens: 1024,
  	Messages: []anthropic.MessageParam{
  		anthropic.NewUserMessage(
  			anthropic.NewDocumentBlock(anthropic.URLPDFSourceParam{
  				URL: "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf",
  			}),
  			anthropic.NewTextBlock("What are the key findings in this document?"),
  		),
  	},
  })
  if err != nil {
  	panic(err)
  }

  fmt.Printf("%+v\n", message.Content)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  // Erstelle einen Dokumentblock mit einer URL
  DocumentBlockParam documentParam = DocumentBlockParam.builder()
      .source(
          UrlPdfSource.builder()
              .url(
                  "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
              )
              .build()
      )
      .build();

  // Erstelle eine Nachricht mit Dokument- und Text-Content-Blöcken
  MessageCreateParams params = MessageCreateParams.builder()
      .model(Model.CLAUDE_OPUS_5_5)
      .maxTokens(1024)
      .addUserMessageOfContentBlockParams(
          List.of(
              ContentBlockParam.ofDocument(documentParam),
              ContentBlockParam.ofText(
                  TextBlockParam.builder()
                      .text("What are the key findings in this document?")
                      .build()
              )
          )
      )
      .build();

  Message message = client.messages().create(params);
  IO.println(message.content());
  ```

  ```php PHP
  $client = new Client();

  $message = $client->messages->create(
      maxTokens: 1024,
      messages: [
          [
              'role' => 'user',
              'content' => [
                  [
                      'type' => 'document',
                      'source' => [
                          'type' => 'url',
                          'url' => 'https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf',
                      ],
                  ],
                  [
                      'type' => 'text',
                      'text' => 'What are the key findings in this document?',
                  ],
              ],
          ],
      ],
      model: Model::CLAUDE_OPUS_5_5,
  );

  echo $message;
  ```

  ```ruby Ruby
  anthropic = Anthropic::Client.new

  message = anthropic.messages.create(
    model: Anthropic::Model::CLAUDE_OPUS_5_5,
    max_tokens: 1024,
    messages: [
      {
        role: "user",
        content: [
          {
            type: "document",
            source: {
              type: "url",
              url: "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
            }
          },
          {type: "text", text: "What are the key findings in this document?"}
        ]
      }
    ]
  )

  puts(message.content)
  ```
</CodeGroup>

Die Antwort gibt die Analyse von Claude als Textblöcke in `content` zurück, mit dem Tokenverbrauch in `usage`:

```json Output
{
  "id": "msg_01Hfp8YuFjQ55VgWbpdHDehB",
  "type": "message",
  "role": "assistant",
  "model": "claude-opus-5-5",
  "content": [
    {
      "type": "text",
      "text": "This document is an addendum to the Claude 3 model card, reporting updated evaluation results. The key findings include..."
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 45000,
    "output_tokens": 300
  }
}
```

#### Option 2: Base64-kodiertes PDF-Dokument

Sende das PDF als base64-kodierte Daten in der Anfrage selbst. Die meisten der folgenden Beispiele laden ein Beispiel-PDF herunter und kodieren es, sodass sie keine lokale Datei benötigen. Um in diesen Beispielen eine lokale Datei zu senden, ersetze die Zeilen, die das PDF herunterladen und kodieren, durch die auskommentierten Zeilen:

<CodeGroup>
  ```bash cURL
  # Methode 1: Remote-PDF abrufen und kodieren
  curl -sL "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf" | base64 | tr -d '\n' > pdf_base64.txt

  # Methode 2: Lokale PDF-Datei kodieren
  # base64 document.pdf | tr -d '\n' > pdf_base64.txt

  # Erstelle eine JSON-Anfragedatei mit dem Inhalt von pdf_base64.txt
  jq -n --rawfile PDF_BASE64 pdf_base64.txt '{
    "model": "claude-opus-5-5",
    "max_tokens": 1024,
    "messages": [{
      "role": "user",
      "content": [{
        "type": "document",
        "source": {
          "type": "base64",
          "media_type": "application/pdf",
          "data": $PDF_BASE64
        }
      },
      {
        "type": "text",
        "text": "What are the key findings in this document?"
      }]
    }]
  }' > request.json

  # Sende die API-Anfrage mit der JSON-Datei
  curl https://api.anthropic.com/v1/messages \
    -H "content-type: application/json" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -d @request.json
  ```

  ```bash CLI
  ant messages create --model claude-opus-5-5 --max-tokens 1024 <<'YAML'
  messages:
    - role: user
      content:
        - type: document
          source:
            type: base64
            media_type: application/pdf
            data: "@./document.pdf"
        - type: text
          text: What are the key findings in this document?
  YAML
  ```

  ```python Python
  import base64
  import httpx2

  # Lade und kodiere zuerst das PDF
  pdf_url = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
  pdf_data = base64.standard_b64encode(
      httpx2.get(pdf_url, follow_redirects=True).content
  ).decode("utf-8")

  # Alternative: Lade aus einer lokalen Datei
  # with open("document.pdf", "rb") as f:
  #     pdf_data = base64.standard_b64encode(f.read()).decode("utf-8")

  # Sende mit Base64-Kodierung an Claude
  client = anthropic.Anthropic()
  message = client.messages.create(
      model="claude-opus-5-5",
      max_tokens=1024,
      messages=[
          {
              "role": "user",
              "content": [
                  {
                      "type": "document",
                      "source": {
                          "type": "base64",
                          "media_type": "application/pdf",
                          "data": pdf_data,
                      },
                  },
                  {"type": "text", "text": "What are the key findings in this document?"},
              ],
          }
      ],
  )

  print(message.content)
  ```

  ```typescript TypeScript
  // Methode 1: Remote-PDF abrufen und kodieren
  const pdfURL =
    "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf";
  const pdfResponse = await fetch(pdfURL);
  const arrayBuffer = await pdfResponse.arrayBuffer();
  const pdfBase64 = Buffer.from(arrayBuffer).toString("base64");

  // Methode 2: Aus einer lokalen Datei laden
  // import { readFile } from "node:fs/promises";
  // const pdfBase64 = (await readFile("document.pdf")).toString("base64");

  // Sende die API-Anfrage mit base64-kodiertem PDF
  const anthropic = new Anthropic();
  const response = await anthropic.messages.create({
    model: "claude-opus-5-5",
    max_tokens: 1024,
    messages: [
      {
        role: "user",
        content: [
          {
            type: "document",
            source: {
              type: "base64",
              media_type: "application/pdf",
              data: pdfBase64
            }
          },
          {
            type: "text",
            text: "What are the key findings in this document?"
          }
        ]
      }
    ]
  });

  console.log(response);
  ```

  ```csharp C#
  var client = new AnthropicClient();

  // Methode 1: Lade ein Remote-PDF herunter und kodiere es
  var pdfUrl = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf";
  using var httpClient = new HttpClient();
  var pdfBase64 = Convert.ToBase64String(await httpClient.GetByteArrayAsync(pdfUrl));

  // Methode 2: Lade aus einer lokalen Datei
  // var pdfBase64 = Convert.ToBase64String(await File.ReadAllBytesAsync("document.pdf"));

  // Erstelle einen Dokumentblock mit base64-Daten
  var documentParam = new DocumentBlockParam
  {
      Source = new Base64PdfSource { Data = pdfBase64 },
  };

  // Erstelle eine Nachricht mit Dokument- und Text-Content-Blöcken
  var message = await client.Messages.Create(new MessageCreateParams
  {
      Model = Model.ClaudeOpus5_5,
      MaxTokens = 1024,
      Messages =
      [
          new UserMessageParam
          {
              Content = new List<ContentBlockParam>
              {
                  documentParam,
                  new TextBlockParam("What are the key findings in this document?"),
              },
          },
      ],
  });

  Console.WriteLine(string.Join("\n", message.Content));
  ```

  ```go Go
  // Lade und kodiere zuerst das PDF
  pdfURL := "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
  resp, err := http.Get(pdfURL)
  if err != nil {
  	panic(err)
  }
  defer resp.Body.Close()
  pdfBytes, err := io.ReadAll(resp.Body)
  if err != nil {
  	panic(err)
  }
  pdfBase64 := base64.StdEncoding.EncodeToString(pdfBytes)

  // Alternative: Aus einer lokalen Datei laden (ersetze in den Imports "io" und "net/http" durch "os")
  // pdfBytes, err := os.ReadFile("document.pdf")
  // pdfBase64 := base64.StdEncoding.EncodeToString(pdfBytes)

  // Mit Base64-Kodierung an Claude senden
  client := anthropic.NewClient()
  message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
  	Model:     anthropic.ModelClaudeOpus5_5,
  	MaxTokens: 1024,
  	Messages: []anthropic.MessageParam{
  		anthropic.NewUserMessage(
  			anthropic.NewDocumentBlock(anthropic.Base64PDFSourceParam{
  				Data: pdfBase64,
  			}),
  			anthropic.NewTextBlock("What are the key findings in this document?"),
  		),
  	},
  })
  if err != nil {
  	panic(err)
  }

  fmt.Printf("%+v\n", message.Content)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  // Methode 1: Ein entferntes PDF herunterladen und kodieren
  String pdfUrl =
      "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf";
  HttpClient httpClient = HttpClient.newBuilder()
      .followRedirects(HttpClient.Redirect.NORMAL)
      .build();
  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create(pdfUrl))
      .GET()
      .build();

  HttpResponse<byte[]> response = httpClient.send(
      request,
      HttpResponse.BodyHandlers.ofByteArray()
  );
  String pdfBase64 = Base64.getEncoder().encodeToString(response.body());

  // Methode 2: Aus einer lokalen Datei laden
  // byte[] fileBytes = Files.readAllBytes(Path.of("document.pdf"));
  // String pdfBase64 = Base64.getEncoder().encodeToString(fileBytes);

  // Erstelle einen Dokumentblock mit base64-Daten
  DocumentBlockParam documentParam = DocumentBlockParam.builder()
      .source(Base64PdfSource.builder()
          .data(pdfBase64)
          .build())
      .build();

  // Erstelle eine Nachricht mit Dokument- und Text-Content-Blöcken
  MessageCreateParams params = MessageCreateParams.builder()
      .model(Model.CLAUDE_OPUS_5_5)
      .maxTokens(1024)
      .addUserMessageOfContentBlockParams(
          List.of(
              ContentBlockParam.ofDocument(documentParam),
              ContentBlockParam.ofText(
                  TextBlockParam.builder()
                      .text("What are the key findings in this document?")
                      .build()
              )
          )
      )
      .build();

  Message message = client.messages().create(params);
  IO.println(message.content());
  ```

  ```php PHP
  $client = new Client();

  // Lade und kodiere zuerst das PDF
  $pdf_url = 'https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf';
  $pdf_bytes = file_get_contents($pdf_url)
      ?: throw new \RuntimeException('Could not fetch the PDF.');
  $pdf_data = base64_encode($pdf_bytes);

  // Alternative: Aus einer lokalen Datei laden
  // $pdf_bytes = file_get_contents('document.pdf')
  //     ?: throw new \RuntimeException('Could not read document.pdf.');
  // $pdf_data = base64_encode($pdf_bytes);

  // Mit Base64-Kodierung an Claude senden
  $message = $client->messages->create(
      maxTokens: 1024,
      messages: [
          [
              'role' => 'user',
              'content' => [
                  [
                      'type' => 'document',
                      'source' => [
                          'type' => 'base64',
                          'mediaType' => 'application/pdf',
                          'data' => $pdf_data,
                      ],
                  ],
                  [
                      'type' => 'text',
                      'text' => 'What are the key findings in this document?',
                  ],
              ],
          ],
      ],
      model: Model::CLAUDE_OPUS_5_5,
  );

  echo $message;
  ```

  ```ruby Ruby
  require "open-uri"

  # Lade und kodiere zuerst das PDF
  pdf_url = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
  pdf_bytes = URI.open(pdf_url, "rb", &:read)
  pdf_data = [pdf_bytes].pack("m0") # Encode as base64 without newlines

  # Alternative: Aus einer lokalen Datei laden
  # pdf_data = [File.binread("document.pdf")].pack("m0")

  # Mit Base64-Kodierung an Claude senden
  anthropic = Anthropic::Client.new
  message = anthropic.messages.create(
    model: Anthropic::Model::CLAUDE_OPUS_5_5,
    max_tokens: 1024,
    messages: [
      {
        role: "user",
        content: [
          {
            type: "document",
            source: {
              type: "base64",
              media_type: "application/pdf",
              data: pdf_data
            }
          },
          {type: "text", text: "What are the key findings in this document?"}
        ]
      }
    ]
  )

  puts(message.content)
  ```
</CodeGroup>

#### Option 3: Files API

Für PDFs, die du wiederholt verwenden wirst, oder wenn du den Kodierungsaufwand vermeiden möchtest, verwende die [Files API](https://platform.claude.com/docs/de/build-with-claude/files):

<CodeGroup>
  ```bash cURL
  # Lade zuerst dein PDF in die Files API hoch
  curl -sS -X POST https://api.anthropic.com/v1/files \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -F "file=@document.pdf"

  # Verwende dann die file_id aus der Upload-Antwort in deiner Nachricht
  curl https://api.anthropic.com/v1/messages \
    -H "content-type: application/json" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -d '{
      "model": "claude-opus-5-5",
      "max_tokens": 1024,
      "messages": [{
        "role": "user",
        "content": [{
          "type": "document",
          "source": {
            "type": "file",
            "file_id": "'"$FILE_ID"'"
          }
        },
        {
          "type": "text",
          "text": "What are the key findings in this document?"
        }]
      }]
    }'
  ```

  ```bash CLI
  # Lade zuerst dein PDF in die Files API hoch
  ant files upload --file ./document.pdf

  # Verwende dann die file_id aus der Upload-Antwort in deiner Nachricht
  ant messages create <<YAML
  model: claude-opus-5-5
  max_tokens: 1024
  messages:
    - role: user
      content:
        - type: document
          source:
            type: file
            file_id: $FILE_ID
        - type: text
          text: What are the key findings in this document?
  YAML
  ```

  ```python Python
  client = anthropic.Anthropic()

  # Lade die PDF-Datei hoch
  with open("/path/to/document.pdf", "rb") as f:
      file_upload = client.files.upload(file=("document.pdf", f, "application/pdf"))

  # Verwende die hochgeladene Datei in einer Nachricht
  message = client.messages.create(
      model="claude-opus-5-5",
      max_tokens=1024,
      messages=[
          {
              "role": "user",
              "content": [
                  {
                      "type": "document",
                      "source": {"type": "file", "file_id": file_upload.id},
                  },
                  {"type": "text", "text": "What are the key findings in this document?"},
              ],
          }
      ],
  )

  print(message.content)
  ```

  ```typescript TypeScript
  import Anthropic, { toFile } from "@anthropic-ai/sdk";
  import fs from "node:fs";

  const anthropic = new Anthropic();

  // Lade die PDF-Datei hoch
  const fileUpload = await anthropic.files.upload({
    file: await toFile(fs.createReadStream("/path/to/document.pdf"), undefined, {
      type: "application/pdf"
    })
  });

  // Verwende die hochgeladene Datei in einer Nachricht
  const response = await anthropic.messages.create({
    model: "claude-opus-5-5",
    max_tokens: 1024,
    messages: [
      {
        role: "user",
        content: [
          {
            type: "document",
            source: {
              type: "file",
              file_id: fileUpload.id
            }
          },
          {
            type: "text",
            text: "What are the key findings in this document?"
          }
        ]
      }
    ]
  });

  console.log(response);
  ```

  ```csharp C#
  var client = new AnthropicClient();

  // Lade die PDF-Datei hoch
  var fileUpload = await client.Files.Upload(new FileUploadParams
  {
      File = new BinaryContent
      {
          Stream = File.OpenRead("/path/to/document.pdf"),
          FileName = "document.pdf",
          ContentType = new("application/pdf"),
      },
  });

  // Verwende die hochgeladene Datei in einer Nachricht
  var message = await client.Messages.Create(new MessageCreateParams
  {
      Model = Model.ClaudeOpus5_5,
      MaxTokens = 1024,
      Messages =
      [
          new UserMessageParam
          {
              Content = new List<ContentBlockParam>
              {
                  new DocumentBlockParam
                  {
                      Source = new FileDocumentSource { FileID = fileUpload.ID },
                  },
                  new TextBlockParam("What are the key findings in this document?"),
              },
          },
      ],
  });

  Console.WriteLine(string.Join("\n", message.Content));
  ```

  ```go Go
  client := anthropic.NewClient()

  // Lade die PDF-Datei hoch
  pdfFile, err := os.Open("/path/to/document.pdf")
  if err != nil {
  	panic(err)
  }
  defer pdfFile.Close()

  fileUpload, err := client.Files.Upload(context.TODO(), anthropic.FileUploadParams{
  	File: anthropic.File(pdfFile, "document.pdf", "application/pdf"),
  })
  if err != nil {
  	panic(err)
  }

  // Verwende die hochgeladene Datei in einer Nachricht
  message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
  	Model:     anthropic.ModelClaudeOpus5_5,
  	MaxTokens: 1024,
  	Messages: []anthropic.MessageParam{
  		anthropic.NewUserMessage(
  			anthropic.NewDocumentBlock(anthropic.FileDocumentSourceParam{
  				FileID: fileUpload.ID,
  			}),
  			anthropic.NewTextBlock("What are the key findings in this document?"),
  		),
  	},
  })
  if err != nil {
  	panic(err)
  }

  fmt.Printf("%+v\n", message.Content)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  // Lade die PDF-Datei hoch
  FileMetadata file = client
      .files()
      .upload(FileUploadParams.builder()
          .file(Path.of("/path/to/document.pdf"))
          .build());

  // Verwende die hochgeladene Datei in einer Nachricht
  MessageCreateParams params = MessageCreateParams.builder()
      .model(Model.CLAUDE_OPUS_5_5)
      .maxTokens(1024)
      .addUserMessageOfContentBlockParams(
          List.of(
              ContentBlockParam.ofDocument(
                  DocumentBlockParam.builder()
                      .fileSource(file.id())
                      .build()
              ),
              ContentBlockParam.ofText(
                  TextBlockParam.builder()
                      .text("What are the key findings in this document?")
                      .build()
              )
          )
      )
      .build();

  Message message = client.messages().create(params);
  IO.println(message.content());
  ```

  ```php PHP
  use Anthropic\Core\FileParam;

  $client = new Client();

  // Lade die PDF-Datei hoch
  $document = fopen('/path/to/document.pdf', 'rb')
      ?: throw new \RuntimeException('Could not open /path/to/document.pdf.');

  $file_upload = $client->files->upload(
      file: FileParam::fromResource($document, contentType: 'application/pdf'),
  );

  // Verwende die hochgeladene Datei in einer Nachricht
  $message = $client->messages->create(
      maxTokens: 1024,
      messages: [
          [
              'role' => 'user',
              'content' => [
                  [
                      'type' => 'document',
                      'source' => [
                          'type' => 'file',
                          'fileID' => $file_upload->id,
                      ],
                  ],
                  [
                      'type' => 'text',
                      'text' => 'What are the key findings in this document?',
                  ],
              ],
          ],
      ],
      model: Model::CLAUDE_OPUS_5_5,
  );

  echo $message;
  ```

  ```ruby Ruby
  anthropic = Anthropic::Client.new

  # Lade die PDF-Datei hoch
  file_upload = File.open("/path/to/document.pdf", "rb") do |pdf_file|
    anthropic.files.upload(
      file: Anthropic::FilePart.new(pdf_file, filename: "document.pdf", content_type: "application/pdf")
    )
  end

  # Verwende die hochgeladene Datei in einer Nachricht
  message = anthropic.messages.create(
    model: Anthropic::Model::CLAUDE_OPUS_5_5,
    max_tokens: 1024,
    messages: [
      {
        role: "user",
        content: [
          {
            type: "document",
            source: {type: "file", file_id: file_upload.id}
          },
          {type: "text", text: "What are the key findings in this document?"}
        ]
      }
    ]
  )

  puts(message.content)
  ```
</CodeGroup>

### So funktioniert die PDF-Unterstützung

Wenn du ein PDF an Claude sendest, laufen die folgenden Schritte ab:

<Steps>
  <Step title="Das System extrahiert die Inhalte des Dokuments.">
    * Das System wandelt jede Seite des Dokuments in ein Bild um.
    * Das System extrahiert den Text jeder Seite und stellt ihn zusammen mit dem Bild dieser Seite bereit.
  </Step>

  <Step title="Claude analysiert sowohl den Text als auch die Bilder.">
    * Claude erhält jedes Dokument als Kombination aus Text und Bildern.
    * Da Claude ein Bild jeder Seite erhält, kannst du Erkenntnisse zu visuellen Elementen eines PDFs anfragen, wie Diagrammen, Schaubildern und anderen nicht-textuellen Inhalten.
  </Step>

  <Step title="Claude verwendet die Inhalte des PDFs in seiner Antwort, falls relevant.">
    Claude kann in seiner Antwort sowohl auf textuelle als auch auf visuelle Inhalte zurückgreifen.
  </Step>
</Steps>

### Schätze deine Kosten

Die Tokenanzahl einer PDF-Datei hängt vom gesamten aus dem Dokument extrahierten Text und der Anzahl der Seiten ab:

* Kosten für Text-Token: Jede Seite verbraucht je nach Inhaltsdichte typischerweise 1.500–3.000 Token. Es gelten die Standard-API-Preise ohne zusätzliche PDF-Gebühren.
* Kosten für Bild-Token: Das Bild jeder Seite verbraucht bei jedem Modell höchstens 1.568 visuelle Token, da die API Seitenbilder an die Limits der Standard-Auflösungsstufe anpasst. Wie du die visuellen Token eines Bildes zählst, erfährst du unter [Auflösung und Token-Kosten](https://platform.claude.com/docs/de/build-with-claude/vision#evaluate-image-size).

Du kannst die [Token-Zählung](https://platform.claude.com/docs/de/build-with-claude/token-counting) verwenden, um die Kosten für deine spezifischen PDFs zu schätzen.

## PDF-Verarbeitung optimieren

Du kannst die PDF-Unterstützung mit anderen Funktionen kombinieren:

* [Prompt-Caching verwenden](https://platform.claude.com/docs/de/build-with-claude/pdf-support#use-prompt-caching), um die Leistung bei wiederholter Analyse zu verbessern.
* [Dokument-Batches verarbeiten](https://platform.claude.com/docs/de/build-with-claude/pdf-support#process-document-batches), um Dokumente in großem Umfang zu bearbeiten.
* [Tools verwenden](https://platform.claude.com/docs/de/agents-and-tools/tool-use/overview), damit Claude spezifische Informationen aus Dokumenten zur Verwendung als Tool-Eingaben extrahiert.

### Leistung verbessern

Befolge diese Best Practices für optimale Ergebnisse:

* Platziere PDFs in deinen Anfragen vor dem Text
* Verwende Standardschriftarten
* Stelle sicher, dass der Text klar und lesbar ist
* Drehe Seiten in die korrekte aufrechte Ausrichtung
* Verwende logische Seitenzahlen (aus dem PDF-Viewer) in Prompts
* Teile große PDFs bei Bedarf in Abschnitte auf
* Aktiviere Prompt-Caching für wiederholte Analysen

### Skaliere deine Implementierung

Für die Verarbeitung großer Mengen solltest du diese Ansätze in Betracht ziehen:

#### Prompt-Caching verwenden

Cache PDFs mit [Prompt-Caching](https://platform.claude.com/docs/de/build-with-claude/prompt-caching), um die Leistung bei wiederholten Abfragen zu verbessern:

<CodeGroup>
  ```bash cURL
  curl -sL "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf" |
    base64 | tr -d '\n' |
    jq -Rs '{
      model: "claude-opus-5-5",
      max_tokens: 1024,
      messages: [{
        role: "user",
        content: [
          {
            type: "document",
            source: {type: "base64", media_type: "application/pdf", data: .},
            cache_control: {type: "ephemeral"}
          },
          {type: "text", text: "Which model has the highest human preference win rates across each use-case?"}
        ]
      }]
    }' |
    curl https://api.anthropic.com/v1/messages \
      -H "content-type: application/json" \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2026-10-21" \
      -d @-
  ```

  ```bash CLI
  ant messages create <<'YAML'
  model: claude-opus-5-5
  max_tokens: 1024
  messages:
    - role: user
      content:
        - type: document
          source:
            type: base64
            media_type: application/pdf
            data: "@./document.pdf"
          cache_control:
            type: ephemeral
        - type: text
          text: Which model has the highest human preference win rates across each use-case?
  YAML
  ```

  ```python Python
  import base64
  import httpx2

  # Lade und kodiere zuerst das PDF
  pdf_url = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
  pdf_data = base64.standard_b64encode(
      httpx2.get(pdf_url, follow_redirects=True).content
  ).decode("utf-8")

  # Erstelle eine Nachricht mit dem gecachten Dokument
  client = anthropic.Anthropic()
  message = client.messages.create(
      model="claude-opus-5-5",
      max_tokens=1024,
      messages=[
          {
              "role": "user",
              "content": [
                  {
                      "type": "document",
                      "source": {
                          "type": "base64",
                          "media_type": "application/pdf",
                          "data": pdf_data,
                      },
                      "cache_control": {"type": "ephemeral"},
                  },
                  {
                      "type": "text",
                      "text": "Which model has the highest human preference win rates across each use-case?",
                  },
              ],
          }
      ],
  )

  print(message.content)
  ```

  ```typescript TypeScript
  // Lade und kodiere zuerst das PDF
  const pdfURL =
    "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf";
  const pdfResponse = await fetch(pdfURL);
  const arrayBuffer = await pdfResponse.arrayBuffer();
  const pdfBase64 = Buffer.from(arrayBuffer).toString("base64");

  // Erstelle eine Nachricht mit dem gecachten Dokument
  const anthropic = new Anthropic();
  const response = await anthropic.messages.create({
    model: "claude-opus-5-5",
    max_tokens: 1024,
    messages: [
      {
        role: "user",
        content: [
          {
            type: "document",
            source: {
              type: "base64",
              media_type: "application/pdf",
              data: pdfBase64
            },
            cache_control: { type: "ephemeral" }
          },
          {
            type: "text",
            text: "Which model has the highest human preference win rates across each use-case?"
          }
        ]
      }
    ]
  });

  console.log(response);
  ```

  ```csharp C#
  var client = new AnthropicClient();

  // Lade das PDF herunter und kodiere es
  var pdfUrl = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf";
  using var httpClient = new HttpClient();
  var pdfBase64 = Convert.ToBase64String(await httpClient.GetByteArrayAsync(pdfUrl));

  var message = await client.Messages.Create(new MessageCreateParams
  {
      Model = Model.ClaudeOpus5_5,
      MaxTokens = 1024,
      Messages =
      [
          new UserMessageParam
          {
              Content = new List<ContentBlockParam>
              {
                  new DocumentBlockParam
                  {
                      Source = new Base64PdfSource { Data = pdfBase64 },
                      CacheControl = new CacheControlEphemeral(),
                  },
                  new TextBlockParam("Which model has the highest human preference win rates across each use-case?"),
              },
          },
      ],
  });

  Console.WriteLine(message);
  ```

  ```go Go
  // Lade und kodiere zuerst das PDF
  pdfURL := "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
  resp, err := http.Get(pdfURL)
  if err != nil {
  	panic(err)
  }
  defer resp.Body.Close()
  pdfBytes, err := io.ReadAll(resp.Body)
  if err != nil {
  	panic(err)
  }
  pdfBase64 := base64.StdEncoding.EncodeToString(pdfBytes)

  // Erstelle einen Dokumentblock mit Cache-Steuerung
  client := anthropic.NewClient()
  message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
  	Model:     anthropic.ModelClaudeOpus5_5,
  	MaxTokens: 1024,
  	Messages: []anthropic.MessageParam{
  		anthropic.NewUserMessage(
  			anthropic.ContentBlockParamUnion{
  				OfDocument: &anthropic.DocumentBlockParam{
  					Source: anthropic.DocumentBlockParamSourceUnion{
  						OfBase64: &anthropic.Base64PDFSourceParam{
  							Data: pdfBase64,
  						},
  					},
  					CacheControl: anthropic.NewCacheControlEphemeralParam(),
  				},
  			},
  			anthropic.NewTextBlock("Which model has the highest human preference win rates across each use-case?"),
  		),
  	},
  })
  if err != nil {
  	panic(err)
  }

  fmt.Printf("%+v\n", message.Content)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  // Lade das PDF herunter und kodiere es
  String pdfUrl =
      "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf";
  HttpClient httpClient = HttpClient.newBuilder()
      .followRedirects(HttpClient.Redirect.NORMAL)
      .build();
  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create(pdfUrl))
      .GET()
      .build();

  HttpResponse<byte[]> response = httpClient.send(
      request,
      HttpResponse.BodyHandlers.ofByteArray()
  );
  String pdfBase64 = Base64.getEncoder().encodeToString(response.body());

  MessageCreateParams params = MessageCreateParams.builder()
      .model(Model.CLAUDE_OPUS_5_5)
      .maxTokens(1024)
      .addUserMessageOfContentBlockParams(
          List.of(
              ContentBlockParam.ofDocument(
                  DocumentBlockParam.builder()
                      .source(Base64PdfSource.builder()
                          .data(pdfBase64)
                          .build())
                      .cacheControl(CacheControlEphemeral.builder().build())
                      .build()
              ),
              ContentBlockParam.ofText(
                  TextBlockParam.builder()
                      .text(
                          "Which model has the highest human preference win rates across each use-case?"
                      )
                      .build()
              )
          )
      )
      .build();

  Message message = client.messages().create(params);
  IO.println(message);
  ```

  ```php PHP
  $client = new Client();

  // Lade und kodiere das PDF
  $pdf_url = 'https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf';
  $pdf_bytes = file_get_contents($pdf_url)
      ?: throw new \RuntimeException('Could not fetch the PDF.');
  $pdf_data = base64_encode($pdf_bytes);

  $message = $client->messages->create(
      maxTokens: 1024,
      messages: [
          [
              'role' => 'user',
              'content' => [
                  [
                      'type' => 'document',
                      'source' => [
                          'type' => 'base64',
                          'mediaType' => 'application/pdf',
                          'data' => $pdf_data,
                      ],
                      'cacheControl' => ['type' => 'ephemeral'],
                  ],
                  [
                      'type' => 'text',
                      'text' => 'Which model has the highest human preference win rates across each use-case?',
                  ],
              ],
          ],
      ],
      model: Model::CLAUDE_OPUS_5_5,
  );

  echo $message;
  ```

  ```ruby Ruby
  require "open-uri"

  # Lade und kodiere das PDF
  pdf_url = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
  pdf_bytes = URI.open(pdf_url, "rb", &:read)
  pdf_data = [pdf_bytes].pack("m0") # Encode as base64 without newlines

  anthropic = Anthropic::Client.new

  message = anthropic.messages.create(
    model: Anthropic::Model::CLAUDE_OPUS_5_5,
    max_tokens: 1024,
    messages: [
      {
        role: "user",
        content: [
          {
            type: "document",
            source: {
              type: "base64",
              media_type: "application/pdf",
              data: pdf_data
            },
            cache_control: {type: "ephemeral"}
          },
          {
            type: "text",
            text: "Which model has the highest human preference win rates across each use-case?"
          }
        ]
      }
    ]
  )

  puts(message.content)
  ```
</CodeGroup>

#### Dokument-Batches verarbeiten

Verwende die [Message Batches API](https://platform.claude.com/docs/de/build-with-claude/batch-processing), um viele PDFs in einer Anfrage zu verarbeiten:

<CodeGroup>
  ```bash cURL
  curl -sL "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf" | base64 | tr -d '\n' > pdf_base64.txt
  # Erstelle eine JSON-Anfragedatei mit dem Inhalt von pdf_base64.txt
  jq -n --rawfile PDF_BASE64 pdf_base64.txt '{
    "requests": [
    {
      "custom_id": "my-first-request",
      "params": {
        "model": "claude-opus-5-5",
        "max_tokens": 1024,
        "messages": [{
          "role": "user",
          "content": [{
            "type": "document",
            "source": {
              "type": "base64",
              "media_type": "application/pdf",
              "data": $PDF_BASE64
            }
          },
          {
            "type": "text",
            "text": "Which model has the highest human preference win rates across each use-case?"
          }]
        }]
      }
    },
    {
      "custom_id": "my-second-request",
      "params": {
        "model": "claude-opus-5-5",
        "max_tokens": 1024,
        "messages": [{
          "role": "user",
          "content": [{
            "type": "document",
            "source": {
              "type": "base64",
              "media_type": "application/pdf",
              "data": $PDF_BASE64
            }
          },
          {
            "type": "text",
            "text": "Extract 5 key insights from this document."
          }]
        }]
      }
    }]
  }' > request.json

  # Führe dann den API-Aufruf mit der JSON-Datei aus
  curl https://api.anthropic.com/v1/messages/batches \
    -H "content-type: application/json" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -d @request.json
  ```

  ```bash CLI
  ant messages:batches create <<'YAML'
  requests:
    - custom_id: my-first-request
      params:
        model: claude-opus-5-5
        max_tokens: 1024
        messages:
          - role: user
            content:
              - type: document
                source:
                  type: base64
                  media_type: application/pdf
                  data: "@./document.pdf"
              - type: text
                text: >-
                  Which model has the highest human preference win rates
                  across each use-case?
    - custom_id: my-second-request
      params:
        model: claude-opus-5-5
        max_tokens: 1024
        messages:
          - role: user
            content:
              - type: document
                source:
                  type: base64
                  media_type: application/pdf
                  data: "@./document.pdf"
              - type: text
                text: Extract 5 key insights from this document.
  YAML
  ```

  ```python Python
  import base64
  import httpx2

  # Lade und kodiere zuerst das PDF
  pdf_url = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
  pdf_data = base64.standard_b64encode(
      httpx2.get(pdf_url, follow_redirects=True).content
  ).decode("utf-8")

  # Erstelle einen Batch von Anfragen, die das Dokument verwenden
  client = anthropic.Anthropic()
  message_batch = client.messages.batches.create(
      requests=[
          {
              "custom_id": "my-first-request",
              "params": {
                  "model": "claude-opus-5-5",
                  "max_tokens": 1024,
                  "messages": [
                      {
                          "role": "user",
                          "content": [
                              {
                                  "type": "document",
                                  "source": {
                                      "type": "base64",
                                      "media_type": "application/pdf",
                                      "data": pdf_data,
                                  },
                              },
                              {
                                  "type": "text",
                                  "text": "Which model has the highest human preference win rates across each use-case?",
                              },
                          ],
                      }
                  ],
              },
          },
          {
              "custom_id": "my-second-request",
              "params": {
                  "model": "claude-opus-5-5",
                  "max_tokens": 1024,
                  "messages": [
                      {
                          "role": "user",
                          "content": [
                              {
                                  "type": "document",
                                  "source": {
                                      "type": "base64",
                                      "media_type": "application/pdf",
                                      "data": pdf_data,
                                  },
                              },
                              {
                                  "type": "text",
                                  "text": "Extract 5 key insights from this document.",
                              },
                          ],
                      }
                  ],
              },
          },
      ]
  )

  print(message_batch)
  ```

  ```typescript TypeScript
  // Lade und kodiere zuerst das PDF
  const pdfURL =
    "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf";
  const pdfResponse = await fetch(pdfURL);
  const arrayBuffer = await pdfResponse.arrayBuffer();
  const pdfBase64 = Buffer.from(arrayBuffer).toString("base64");

  // Erstelle einen Batch von Anfragen, die das Dokument verwenden
  const anthropic = new Anthropic();
  const response = await anthropic.messages.batches.create({
    requests: [
      {
        custom_id: "my-first-request",
        params: {
          model: "claude-opus-5-5",
          max_tokens: 1024,
          messages: [
            {
              role: "user",
              content: [
                {
                  type: "document",
                  source: {
                    type: "base64",
                    media_type: "application/pdf",
                    data: pdfBase64
                  }
                },
                {
                  type: "text",
                  text: "Which model has the highest human preference win rates across each use-case?"
                }
              ]
            }
          ]
        }
      },
      {
        custom_id: "my-second-request",
        params: {
          model: "claude-opus-5-5",
          max_tokens: 1024,
          messages: [
            {
              role: "user",
              content: [
                {
                  type: "document",
                  source: {
                    type: "base64",
                    media_type: "application/pdf",
                    data: pdfBase64
                  }
                },
                {
                  type: "text",
                  text: "Extract 5 key insights from this document."
                }
              ]
            }
          ]
        }
      }
    ]
  });

  console.log(response);
  ```

  ```csharp C#
  var client = new AnthropicClient();

  // Lade das PDF herunter und kodiere es
  var pdfUrl = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf";
  using var httpClient = new HttpClient();
  var pdfBase64 = Convert.ToBase64String(await httpClient.GetByteArrayAsync(pdfUrl));

  var batch = await client.Messages.Batches.Create(new BatchCreateParams
  {
      Requests =
      [
          new()
          {
              CustomID = "my-first-request",
              Params = new()
              {
                  Model = Model.ClaudeOpus5_5,
                  MaxTokens = 1024,
                  Messages =
                  [
                      new UserMessageParam
                      {
                          Content = new List<ContentBlockParam>
                          {
                              new DocumentBlockParam
                              {
                                  Source = new Base64PdfSource { Data = pdfBase64 },
                              },
                              new TextBlockParam("Which model has the highest human preference win rates across each use-case?"),
                          },
                      },
                  ],
              },
          },
          new()
          {
              CustomID = "my-second-request",
              Params = new()
              {
                  Model = Model.ClaudeOpus5_5,
                  MaxTokens = 1024,
                  Messages =
                  [
                      new UserMessageParam
                      {
                          Content = new List<ContentBlockParam>
                          {
                              new DocumentBlockParam
                              {
                                  Source = new Base64PdfSource { Data = pdfBase64 },
                              },
                              new TextBlockParam("Extract 5 key insights from this document."),
                          },
                      },
                  ],
              },
          },
      ],
  });

  Console.WriteLine(batch);
  ```

  ```go Go
  // Lade und kodiere zuerst das PDF
  pdfURL := "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
  resp, err := http.Get(pdfURL)
  if err != nil {
  	panic(err)
  }
  defer resp.Body.Close()
  pdfBytes, err := io.ReadAll(resp.Body)
  if err != nil {
  	panic(err)
  }
  pdfBase64 := base64.StdEncoding.EncodeToString(pdfBytes)

  // Erstelle einen Batch von Anfragen, die das Dokument verwenden
  client := anthropic.NewClient()
  batch, err := client.Messages.Batches.New(context.TODO(), anthropic.MessageBatchNewParams{
  	Requests: []anthropic.MessageBatchNewParamsRequest{
  		{
  			CustomID: "my-first-request",
  			Params: anthropic.MessageBatchNewParamsRequestParams{
  				Model:     anthropic.ModelClaudeOpus5_5,
  				MaxTokens: 1024,
  				Messages: []anthropic.MessageParam{
  					anthropic.NewUserMessage(
  						anthropic.NewDocumentBlock(anthropic.Base64PDFSourceParam{
  							Data: pdfBase64,
  						}),
  						anthropic.NewTextBlock("Which model has the highest human preference win rates across each use-case?"),
  					),
  				},
  			},
  		},
  		{
  			CustomID: "my-second-request",
  			Params: anthropic.MessageBatchNewParamsRequestParams{
  				Model:     anthropic.ModelClaudeOpus5_5,
  				MaxTokens: 1024,
  				Messages: []anthropic.MessageParam{
  					anthropic.NewUserMessage(
  						anthropic.NewDocumentBlock(anthropic.Base64PDFSourceParam{
  							Data: pdfBase64,
  						}),
  						anthropic.NewTextBlock("Extract 5 key insights from this document."),
  					),
  				},
  			},
  		},
  	},
  })
  if err != nil {
  	panic(err)
  }

  fmt.Printf("%+v\n", batch)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  // Lade das PDF herunter und kodiere es
  String pdfUrl =
      "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf";
  HttpClient httpClient = HttpClient.newBuilder()
      .followRedirects(HttpClient.Redirect.NORMAL)
      .build();
  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create(pdfUrl))
      .GET()
      .build();

  HttpResponse<byte[]> response = httpClient.send(
      request,
      HttpResponse.BodyHandlers.ofByteArray()
  );
  String pdfBase64 = Base64.getEncoder().encodeToString(response.body());

  BatchCreateParams params = BatchCreateParams.builder()
      .addRequest(
          BatchCreateParams.Request.builder()
              .customId("my-first-request")
              .params(
                  BatchCreateParams.Request.Params.builder()
                      .model(Model.CLAUDE_OPUS_5_5)
                      .maxTokens(1024)
                      .addUserMessageOfContentBlockParams(
                          List.of(
                              ContentBlockParam.ofDocument(
                                  DocumentBlockParam.builder()
                                      .source(Base64PdfSource.builder()
                                          .data(pdfBase64)
                                          .build())
                                      .build()
                              ),
                              ContentBlockParam.ofText(
                                  TextBlockParam.builder()
                                      .text(
                                          "Which model has the highest human preference win rates across each use-case?"
                                      )
                                      .build()
                              )
                          )
                      )
                      .build()
              )
              .build()
      )
      .addRequest(
          BatchCreateParams.Request.builder()
              .customId("my-second-request")
              .params(
                  BatchCreateParams.Request.Params.builder()
                      .model(Model.CLAUDE_OPUS_5_5)
                      .maxTokens(1024)
                      .addUserMessageOfContentBlockParams(
                          List.of(
                              ContentBlockParam.ofDocument(
                                  DocumentBlockParam.builder()
                                      .source(Base64PdfSource.builder()
                                          .data(pdfBase64)
                                          .build())
                                      .build()
                              ),
                              ContentBlockParam.ofText(
                                  TextBlockParam.builder()
                                      .text("Extract 5 key insights from this document.")
                                      .build()
                              )
                          )
                      )
                      .build()
              )
              .build()
      )
      .build();

  MessageBatch batch = client.messages().batches().create(params);
  IO.println(batch);
  ```

  ```php PHP
  $client = new Client();

  // PDF laden und kodieren
  $pdf_url = 'https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf';
  $pdf_bytes = file_get_contents($pdf_url)
      ?: throw new \RuntimeException('Could not fetch the PDF.');
  $pdf_data = base64_encode($pdf_bytes);

  $batch = $client->messages->batches->create(
      requests: [
          [
              'customID' => 'my-first-request',
              'params' => [
                  'model' => Model::CLAUDE_OPUS_5_5,
                  'maxTokens' => 1024,
                  'messages' => [
                      [
                          'role' => 'user',
                          'content' => [
                              [
                                  'type' => 'document',
                                  'source' => [
                                      'type' => 'base64',
                                      'mediaType' => 'application/pdf',
                                      'data' => $pdf_data,
                                  ],
                              ],
                              [
                                  'type' => 'text',
                                  'text' => 'Which model has the highest human preference win rates across each use-case?',
                              ],
                          ],
                      ],
                  ],
              ],
          ],
          [
              'customID' => 'my-second-request',
              'params' => [
                  'model' => Model::CLAUDE_OPUS_5_5,
                  'maxTokens' => 1024,
                  'messages' => [
                      [
                          'role' => 'user',
                          'content' => [
                              [
                                  'type' => 'document',
                                  'source' => [
                                      'type' => 'base64',
                                      'mediaType' => 'application/pdf',
                                      'data' => $pdf_data,
                                  ],
                              ],
                              [
                                  'type' => 'text',
                                  'text' => 'Extract 5 key insights from this document.',
                              ],
                          ],
                      ],
                  ],
              ],
          ],
      ],
  );

  echo $batch;
  ```

  ```ruby Ruby
  require "open-uri"

  # Lade und kodiere das PDF
  pdf_url = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
  pdf_bytes = URI.open(pdf_url, "rb", &:read)
  pdf_data = [pdf_bytes].pack("m0") # Encode as base64 without newlines

  anthropic = Anthropic::Client.new

  message_batch = anthropic.messages.batches.create(
    requests: [
      {
        custom_id: "my-first-request",
        params: {
          model: Anthropic::Model::CLAUDE_OPUS_5_5,
          max_tokens: 1024,
          messages: [
            {
              role: "user",
              content: [
                {
                  type: "document",
                  source: {
                    type: "base64",
                    media_type: "application/pdf",
                    data: pdf_data
                  }
                },
                {
                  type: "text",
                  text: "Which model has the highest human preference win rates across each use-case?"
                }
              ]
            }
          ]
        }
      },
      {
        custom_id: "my-second-request",
        params: {
          model: Anthropic::Model::CLAUDE_OPUS_5_5,
          max_tokens: 1024,
          messages: [
            {
              role: "user",
              content: [
                {
                  type: "document",
                  source: {
                    type: "base64",
                    media_type: "application/pdf",
                    data: pdf_data
                  }
                },
                {
                  type: "text",
                  text: "Extract 5 key insights from this document."
                }
              ]
            }
          ]
        }
      }
    ]
  )

  puts(message_batch)
  ```
</CodeGroup>

Batches werden asynchron verarbeitet. Um den Fortschritt zu prüfen und die Ergebnisse nach Abschluss der Verarbeitung abzurufen, siehe [Batch-Verarbeitung](https://platform.claude.com/docs/de/build-with-claude/batch-processing).

## Nächste Schritte

<CardGroup cols={2}>
  <Card title="Vision" icon="image" href="https://platform.claude.com/docs/de/build-with-claude/vision">
    Erfahre, wie du die visuellen Token eines Bildes zählst und welche Einschränkungen PDFs mit anderen Vision-Aufgaben teilen.
  </Card>

  <Card title="PDF-Beispiele ausprobieren" icon="file" href="https://platform.claude.com/cookbook/multimodal-getting-started-with-vision">
    Erkunde praktische Beispiele zur PDF-Verarbeitung im Claude Cookbook-Rezept.
  </Card>

  <Card title="API-Referenz ansehen" icon="code" href="https://platform.claude.com/docs/de/api/messages/create">
    Sieh dir die vollständige API-Dokumentation zur PDF-Unterstützung an.
  </Card>
</CardGroup>

## Verfügbarkeit

PDF-Unterstützung ist auf allen Modellen verfügbar und für Zero Data Retention und HIPAA-Bereitschaft berechtigt.

### API-Unterstützung

#### [Messages API](https://platform.claude.com/docs/de/build-with-claude/working-with-messages)

* Verfügbarkeit: Immer aktiv

| Status                | Cloud-Plattformen                                                                                                                                                                                                                                                              |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Verfügbar             | Claude API, [Claude Platform on AWS](https://platform.claude.com/docs/de/build-with-claude/claude-platform-on-aws), [Claude Models on Google Cloud (Anthropic managed)](https://platform.claude.com/docs/de/build-with-claude/claude-models-on-google-cloud/anthropic-managed) |
| Verfügbar<sup>1</sup> | [Microsoft Foundry](https://platform.claude.com/docs/de/build-with-claude/claude-in-microsoft-foundry)                                                                                                                                                                         |
| Verfügbar<sup>2</sup> | [Amazon Bedrock (bedrock-runtime)](https://platform.claude.com/docs/de/build-with-claude/claude-on-amazon-bedrock-legacy)                                                                                                                                                      |
| Verfügbar<sup>2</sup> | [Amazon Bedrock](https://platform.claude.com/docs/de/build-with-claude/claude-in-amazon-bedrock), [Claude Models on Google Cloud (Google managed)](https://platform.claude.com/docs/de/build-with-claude/claude-models-on-google-cloud/google-managed)                         |

1. `file_id`-Quellen erfordern ein Deployment vom Typ Hosted on Anthropic.
2. Nur Base64-Quellen.

#### [Managed Agents](https://platform.claude.com/docs/de/managed-agents/overview)

* Verfügbarkeit: Immer aktiv

| Status    | Cloud-Plattformen              |
| --------- | ------------------------------ |
| Verfügbar | Alle unterstützten Plattformen |

### Datenverarbeitung

[Übersicht über die Datenverarbeitung](https://platform.claude.com/docs/de/manage-claude/api-and-data-retention#feature-eligibility)

| Element | Zero Data Retention                                                                                                                                                 | HIPAA                                                                                                             |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| Status  | Berechtigt (ausgenommen: [Abgedeckte Modelle](https://platform.claude.com/docs/de/manage-claude/api-and-data-retention#model-specific-data-retention-requirements)) | Berechtigt                                                                                                        |
| Details | —                                                                                                                                                                   | Die HIPAA-Berechtigung gilt für PDFs, die inline über die Messages API gesendet werden, nicht über die Files API. |

Zutreffende Endpunkte:

* `/v1/messages`
