Analyze and extract information from various file types using Anthropic native format
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
model | string | ✅ Yes | claude-opus-4-1-20250805 | - | The model identifier. Use claude-opus-4-1-20250805 for this model |
messages | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a role (user/assistant) and content. Content can include text blocks or document blocks with base64 or URL sources. Supported formats: PDF, DOCX, XLSX, TXT, CSV, JSON, XML, HTML. Max file size: 20MB. See Messages Structure below for details |
max_tokens | integer | ✅ Yes | - | 1-32000 | Maximum number of tokens to generate. The model may stop before reaching this limit |
temperature | number | ❌ No | 1.0 | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic |
top_p | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top_p. Recommended for advanced use only. Do not use with temperature |
top_k | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only |
stream | boolean | ❌ No | false | - | Whether to stream the response incrementally using server-sent events |
stop_sequences | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters |
messages array should have the following structure:
| Field | Type | Required | Range | Description |
|---|---|---|---|---|
role | string | ✅ Yes | - | The role of the message. Can be: user or assistant |
content | array/string | ✅ Yes | - | The content of the message. Can be a string or an array of content blocks |
content is an array, each element can be one of the following types:
| Field | Type | Required | Range | Description |
|---|---|---|---|---|
type | string | ✅ Yes | - | Must be text |
text | string | ✅ Yes | - | The text content |
| Field | Type | Required | Range | Description |
|---|---|---|---|---|
type | string | ✅ Yes | - | Must be document |
source | object | ✅ Yes | - | The document source (base64 or URL) |
| Field | Type | Required | Range | Description |
|---|---|---|---|---|
type | string | ✅ Yes | - | Must be url |
url | string | ✅ Yes | - | The URL of the document file |
| Field | Type | Required | Range | Description |
|---|---|---|---|---|
type | string | ✅ Yes | - | Must be base64 |
media_type | string | ✅ Yes | - | The MIME type of the document (e.g., application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document) |
data | string | ✅ Yes | - | Base64-encoded document data |
| Format | MIME Type | Extension |
|---|---|---|
application/pdf | .pdf | |
| Word | application/vnd.openxmlformats-officedocument.wordprocessingml.document | .docx |
| Excel | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | .xlsx |
| Plain Text | text/plain | .txt |
| CSV | text/csv | .csv |
| JSON | application/json | .json |
| XML | application/xml or text/xml | .xml |
| HTML | text/html | .html |