# Attaching files

> Upload a spec, notes, a PDF or an image and send it with a research question.

Source: https://deeperesearch.com/docs/api/files/

Attach files when the question depends on something the providers can’t find on the web: a spec, requirements, meeting notes, a PDF or a screenshot. Every provider receives each file as text, sent with the question.

|                   |                                                                                                                                                                                                                                                                     |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Read directly     | Plain text, Markdown, and PDFs with a text layer                                                                                                                                                                                                                    |
| Read by Claude    | Images (`image/png`, `image/jpeg`, `image/webp`) up to 5 MB, and scanned PDFs without a text layer up to 50 pages. Claude transcribes their text and describes what they show (charts, diagrams, screenshots), and providers receive that description, not the file |
| Sent to providers | The first 200,000 characters of each file’s text                                                                                                                                                                                                                    |
| Size              | Up to 25 MB per file, 10 files per research                                                                                                                                                                                                                         |

Caution

Every provider receives what you attach, and images and scanned PDFs are also sent to Anthropic for Claude to read. Don’t attach credentials, keys or personal data you wouldn’t send to them directly.

## Uploading

Files are uploaded straight to storage in three steps, so large files never pass through the API.

1. **Create the file.** Send its name, type and exact size:

   ```bash
   curl https://deeperesearch.com/v1/files \
     -H "Authorization: Bearer $DEEPER_RESEARCH_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{ "filename": "requirements.pdf", "mime_type": "application/pdf", "size_bytes": 482133 }'
   ```

   The response includes the file `id` and an `upload` object with a signed `url`, the `method` (`PUT`), the `headers` to send and when the URL expires.

2. **Upload the bytes** to that URL:

   ```bash
   curl -X PUT "$UPLOAD_URL" \
     -H "Content-Type: application/pdf" \
     --data-binary @requirements.pdf
   ```

3. **Finish the upload:**

   ```bash
   curl -X POST https://deeperesearch.com/v1/files/FILE_ID/complete \
     -H "Authorization: Bearer $DEEPER_RESEARCH_API_KEY"
   ```

   The file’s `status` becomes `processing` while its text is read. Poll [`GET /v1/files/{id}`](https://deeperesearch.com/docs/api/reference/operations/getfile/) until it’s `ready`: usually a few seconds, or up to a minute or two for an image or scanned PDF that Claude reads. `text_chars` shows how much text was found, and `note` explains anything unusual, such as an image Claude described, a file that was cut short, or a scanned PDF too long to read.

## Sending files with research

Pass the ids of ready files as `attachments`:

```json
{
  "query": "Which of these requirements are hardest to meet with off-the-shelf job queues?",
  "vendors": "balanced",
  "max_cost_usd": 20,
  "attachments": ["FILE_ID"]
}
```

A file that isn’t ready yet fails with `attachment_not_ready`; an id that isn’t in your organization fails with `attachment_not_found`.

File statuses: `awaiting_upload`, `processing`, `ready` or `failed`.
