Files and redaction

Any model reads the PDF. No model sees the secret.

Send documents in the shape your SDK uses; models that cannot read files get them as text. Turn on redaction and keys, tokens and personal data are swapped for placeholders before the prompt leaves.

From the live catalog
Models that read files natively
37
Models that get the text
304
File types
23
Largest file
20 MB
Pages read
first 50
Conversion
Free

What it does for an agent

PDFs for every model
304 models read documents as text, 37 natively. The agent sends the same file part to all of them.
Office files and images
bmp, csv, docx, et, gif, htm, html, jpeg, jpg, md and 13 more types.
By URL or inline
A data URL, bare base64 or an https link. Private and loopback addresses are refused.
Secrets swapped out
API keys, tokens and private keys become [[SECRET_1]] style placeholders before the request is forwarded.
Personal data too
secrets_pii adds emails, phone numbers, card numbers, US SSNs and IBANs.
Answers stay readable
The originals are put back in the answer, so the agent works with real values and the model never saw them.

Copy, paste, run

OpenAI SDK: a PDF to any model
python
1import base64
2from openai import OpenAI
3import os
4
5client = OpenAI(
6 base_url="https://api.relayswitch.io/v1",
7 api_key=os.environ["RELAYSWITCH_API_KEY"],
8)
9
10pdf = base64.b64encode(open("contract.pdf", "rb").read()).decode()
11reply = client.chat.completions.create(
12 model="deepseek-v4.1-flash", # reads the PDF as text
13 messages=[{"role": "user", "content": [
14 {"type": "text", "text": "List every termination clause."},
15 {"type": "file", "file": {
16 "filename": "contract.pdf",
17 "file_data": f"data:application/pdf;base64,{pdf}",
18 }},
19 ]}],
20)
21print(reply.choices[0].message.content)
Anthropic SDK: a document by URL
python
1import anthropic
2import os
3
4client = anthropic.Anthropic(
5 base_url="https://api.relayswitch.io/v1",
6 api_key=os.environ["RELAYSWITCH_API_KEY"],
7)
8
9reply = client.messages.create(
10 model="claude-sonnet-5-5",
11 max_tokens=1024,
12 messages=[{"role": "user", "content": [
13 {"type": "document", "source": {
14 "type": "url",
15 "url": "https://example.com/q3-report.pdf",
16 }},
17 {"type": "text", "text": "Summarize revenue by region."},
18 ]}],
19)
20print(reply.content[0].text)
curl: redact one request
bash
1curl -i https://api.relayswitch.io/v1/chat/completions \
2 -H "Authorization: Bearer $RELAYSWITCH_API_KEY" \
3 -H "x-uplink-redact: secrets_pii" \
4 -H "Content-Type: application/json" \
5 -d '{"model": "deepseek-v4.1-flash", "messages": [{"role": "user",
6 "content": "Debug this: AWS_SECRET=... failed for jane@example.com"}]}'
7# The model sees [[SECRET_1]] and a placeholder for the email.
8# x-uplink-redactions: 2 The answer carries the originals back.
Key API: redact by default
bash
1# Every request on this agent's key, redacted by default.
2curl -X PATCH https://api.relayswitch.io/v1/keys/KEY_ID \
3 -H "Authorization: Bearer $ADMIN_KEY" \
4 -H "Content-Type: application/json" \
5 -d '{"redact": "secrets"}'

Models that read files natively

A sample from the live catalog, USD per million tokens.

ModelInputOutput
Claude Fable 5$3.00$15.00
Claude Fable 5.1$6.00$30.00
Claude Haiku 4.5$0.60$3.00
Claude Haiku 5.5$0.06$0.15
Claude Opus 4.6$1.80$7.50
Claude Opus 4.7$1.80$7.50
Claude Opus 4.8$1.80$7.50
Claude Opus 5$1.80$7.50
FAQs

Questions

For agent builders.

Open the console

A key in under a minute

Get a key

Or email hello@relayswitch.io

Hand your agent the documents

Every model reads them, and redaction keeps the secrets on your side.