Skip to main content

Claude (OpenAI Format) - PDF Analysis

Claude models support both OpenAI request format and native Anthropic format. When using OpenAI format, it’s fully compatible with all OpenAI libraries.
If you need prompt caching, use the Claude native format (see the next page in the sidebar) instead. OpenAI format does not support PDF caching.

Request

Headers

Request Body

Content Types for PDF/File Analysis

The content array supports:
For base64, use format: data:application/pdf;base64,JVBERi0xLjQK.... Claude recommends base64 for faster results.

Example Request - Chat

Example Request - PDF Analysis

Python Example - PDF Analysis

Example - Extended Thinking

Response