Capabilities

Text and CSV files

Send a plain-text or CSV file with your question and the model reads its contents as part of the prompt. Use it to summarise notes, ask questions of a spreadsheet export, or have a reasoning model work through a dataset — without pasting the file into the message yourself.

Files are sent inside the request. There is no separate upload step and no file ID to manage, and nothing is stored: the file exists only for the request that carries it.

What you can send

  • File types: plain text (text/plain, .txt) and CSV (text/csv, .csv). The file must be non-empty UTF-8 text; base64 may use either alphabet and may be line-wrapped.
  • Size: up to 1 MB per file. A request can carry several files.
  • Models: any chat model. The file counts toward the model's context window like any other text, so a long file needs a model and a context size that can hold it.

Anything else — PDFs, spreadsheets in other formats, images sent as files, a file that is too large or isn't valid UTF-8 — is refused with a 400 error that names the file and says why. A file is never silently ignored. For images, use vision.

Chat completions

Add a file content part to a user message. file_data is the file's content as a base64 data URI (data:text/csv;base64,…); plain base64 works too when filename ends in .txt or .csv. file_id isn't supported.

curl https://api.pendra.ai/api/v1/chat/completions \
  -H "Authorization: Bearer pdr_sk_..." \
  -H "Content-Type: application/json" \
  -d @- <<EOF
{
  "model": "qwen3.6:27b",
  "messages": [{
    "role": "user",
    "content": [
      {"type": "text", "text": "Which region had the highest revenue?"},
      {"type": "file", "file": {
        "filename": "sales.csv",
        "file_data": "data:text/csv;base64,$(base64 < sales.csv | tr -d '\n')"
      }}
    ]
  }]
}
EOF

Responses API

Use an input_file part with filename and file_data, next to your input_text. file_id and file_url aren't supported.

curl https://api.pendra.ai/v1/responses \
  -H "Authorization: Bearer pdr_sk_..." \
  -H "Content-Type: application/json" \
  -d @- <<EOF
{
  "model": "qwen3.6:27b",
  "input": [{
    "role": "user",
    "content": [
      {"type": "input_text", "text": "Which region had the highest revenue?"},
      {"type": "input_file",
       "filename": "sales.csv",
       "file_data": "data:text/csv;base64,$(base64 < sales.csv | tr -d '\n')"}
    ]
  }]
}
EOF

Anthropic Messages API

Use a document block. The source is either base64 (with media_type text/plain or text/csv) or text; title becomes the file name the model sees. url and file-ID sources aren't supported.

curl https://api.pendra.ai/v1/messages \
  -H "x-api-key: pdr_sk_..." \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d @- <<EOF
{
  "model": "qwen3.6:27b",
  "max_tokens": 1024,
  "messages": [{
    "role": "user",
    "content": [
      {"type": "document",
       "title": "sales.csv",
       "source": {"type": "base64", "media_type": "text/csv",
                  "data": "$(base64 < sales.csv | tr -d '\n')"}},
      {"type": "text", "text": "Which region had the highest revenue?"}
    ]
  }]
}
EOF

What the model sees

Pendra places the file's text in the prompt where the file part sits, inside a tagged block that carries its name and type, so the model can tell the file apart from your question and from other files:

<file name="sales.csv" type="text/csv">
region,revenue
north,1200
south,3400
</file>

The file's content is passed through as written (a leading byte-order mark is dropped), so refer to files by name in your question — "in sales.csv, which region…" — when you attach more than one.

Usage and billing

The file's text is part of the prompt, so it is counted in prompt_tokens / input_tokens and shown in your usage like any other input. A large CSV can be a lot of tokens: a 1 MB file is roughly a quarter of a million.

Private inference

Files travel inside the request body, so with private inference they are encrypted end to end with the rest of the prompt.

In the Playground

Click the paperclip beside the message box (or drop files onto it) to attach one or more .txt or .csv files of up to 1 MB. They appear as chips above the box and are sent with your next message. Other file types and larger files are refused with a message before anything is sent.

Field-by-field detail is in the Chat completions, Responses and Anthropic Messages references.