DeepRead BYOK — Bring Your Own AI Key
Use your own OpenAI, Google, or OpenRouter API key for all DeepRead document processing. Your key, your billing, zero DeepRead LLM costs.
CODEBLOCK0
Page quota is skipped entirely for BYOK users. Process unlimited pages on any plan.
This skill helps agents guide users through BYOK setup on DeepRead. The agent opens the dashboard for key management and uses https://api.deepread.tech for document processing. No system files are modified.
What Changes With BYOK
- - LLM costs: You pay your provider directly instead of DeepRead
- Page quota: Skipped entirely — no monthly limit when using your own key
- API calls: Same endpoints, same headers — zero code changes
- Processing quality: Equivalent models from your provider via tier-based swapping
- Setup: One-time — add your provider key in the dashboard, then forget about it
Supported Providers
- - OpenRouter (
sk-or-...) — Easiest setup. Same models DeepRead uses, just swaps billing to your account. - OpenAI (
sk-proj-...) — Direct to api.openai.com. Best for enterprise agreements and negotiated rates. - Google (
AI...) — Direct to Google AI API. Best for Google Cloud credits and existing billing.
Setup Guide
Step 1: Get Your DeepRead API Key
If you don't have one yet, use the device flow:
CODEBLOCK1
Or sign up directly: https://www.deepread.tech/dashboard/?utm_source=clawhub
Step 2: Add Your Provider Key in the Dashboard
BYOK keys are managed through the DeepRead dashboard:
CODEBLOCK2
In the dashboard:
- 1. Click Add Provider Key
- Select your provider — OpenRouter, OpenAI, or Google
- Paste your API key
- The key is validated against the provider's API before saving
- The key is encrypted at rest and stored securely
That's it. All subsequent API calls automatically route through your key.
Step 3: Process Documents (Same API as Before)
Nothing changes in your code. Same endpoints, same X-API-Key header:
CODEBLOCK3
Under the hood, LLM calls now route through YOUR provider key. Page quota is NOT counted.
Managing Your Key
All key management is done in the dashboard at https://www.deepread.tech/dashboard/byok
- - Toggle on/off: Switch between your key and DeepRead processing without deleting the key
- Replace: Add a new key to replace the existing one (one active key at a time)
- Delete: Permanently removes the key, reverts to DeepRead processing
How Model Swapping Works
When you provide an OpenAI or Google key, DeepRead automatically swaps all pipeline models to equivalents from your provider at the same quality tier:
Top tier — GPT-5 (OpenAI) or Gemini 2.5 Flash (Google)
High tier — GPT-5 Mini (OpenAI) or Gemini 2.5 Flash (Google)
Mid tier — GPT-5 Nano (OpenAI) or Gemini 3 Flash (Google)
Lite tier — GPT-5 Nano (OpenAI) or Gemini 2.5 Flash Lite (Google)
OpenRouter users: No swapping needed — same models, your billing account.
Python Example
CODEBLOCK4
JavaScript Example
CODEBLOCK5
Security
- - Encrypted at rest — Fernet symmetric encryption (AES-128-CBC + HMAC-SHA256)
- Validated before storing — test API call to your provider confirms the key works
- Key hints only — dashboard shows only the last 4 characters for identification
- Separate encryption key — encryption key stored separately from the database
- Soft-delete — removing a key clears the ciphertext from the database
- One key at a time — simple billing, all processing routes through one provider
When to Use BYOK
Use BYOK if:
- - You have an OpenAI enterprise agreement with negotiated rates
- You have Google Cloud credits you want to apply to document processing
- You want zero DeepRead LLM costs and unlimited page processing
- You need all AI calls to go through your own provider account for compliance
- You're on the free tier and want to skip the 2,000 page/month limit
Don't use BYOK if:
- - You're happy with DeepRead's default processing — it works great out of the box
- You don't have an existing AI provider account
- You want DeepRead to handle all billing in one invoice
Works With All DeepRead Skills
BYOK applies to every DeepRead API call — OCR, form fill, and PII redaction:
- - deepread-ocr — Extract text and structured JSON from documents — INLINECODE6
- deepread-form-fill — Fill any PDF form with AI vision — INLINECODE7
- deepread-pii — Redact sensitive data from documents — INLINECODE8
- deepread-agent-setup — Authenticate via OAuth device flow — INLINECODE9
- deepread-byok — Set up Bring Your Own Key (this skill) — INLINECODE10
Support
- - Dashboard: https://www.deepread.tech/dashboard
- BYOK Settings: https://www.deepread.tech/dashboard/byok
- Issues: https://github.com/deepread-tech/deep-read-service/issues
- Email: hello@deepread.tech
Ready? Add your provider key at https://www.deepread.tech/dashboard/byok
技能名称: deepread-byok
DeepRead BYOK — 自带AI密钥
使用您自己的OpenAI、Google或OpenRouter API密钥处理所有DeepRead文档。您的密钥,您的账单,DeepRead LLM成本为零。
不使用BYOK: 您 → DeepRead API → DeepRead支付OpenRouter → 您向DeepRead付费
使用BYOK: 您 → DeepRead API → 您的密钥支付提供商 → DeepRead成本 = $0
BYOK用户完全跳过页面配额。 在任何套餐上处理无限页面。
此技能帮助代理引导用户在DeepRead上完成BYOK设置。代理打开仪表盘进行密钥管理,并使用https://api.deepread.tech进行文档处理。不会修改任何系统文件。
BYOK带来的变化
- - LLM成本:您直接向您的提供商付费,而非DeepRead
- 页面配额:完全跳过 — 使用自己的密钥时无月度限制
- API调用:相同的端点,相同的请求头 — 零代码更改
- 处理质量:通过层级切换使用您提供商的等效模型
- 设置:一次性操作 — 在仪表盘中添加您的提供商密钥,之后无需再管
支持的提供商
- - OpenRouter (sk-or-...) — 最简单的设置。与DeepRead使用的模型相同,仅将账单切换到您的账户。
- OpenAI (sk-proj-...) — 直接连接api.openai.com。最适合企业协议和协商费率。
- Google (AI...) — 直接连接Google AI API。最适合使用Google Cloud积分和现有账单。
设置指南
步骤1:获取您的DeepRead API密钥
如果您还没有密钥,请使用设备流:
bash
DR_RESPONSE=$(curl -s -X POST https://api.deepread.tech/v1/agent/device/code \
-H Content-Type: application/json \
-d {agent_name:Claude Code})
DRDEVICECODE=$(echo $DRRESPONSE | python3 -c import sys,json; print(json.load(sys.stdin)[devicecode]))
DRVERIFYURL=$(echo $DRRESPONSE | python3 -c import sys,json; print(json.load(sys.stdin)[verificationuri_complete]))
echo 打开此URL以授权: $DRVERIFYURL
open $DRVERIFYURL 2>/dev/null
while true; do
sleep 5
DRTOKENRESP=$(curl -s -X POST https://api.deepread.tech/v1/agent/device/token \
-H Content-Type: application/json \
-d {\devicecode\:\$DRDEVICE_CODE\})
DRAPIKEY=$(echo $DRTOKENRESP | python3 -c import sys,json; d=json.load(sys.stdin); print(d.get(api_key,)) 2>/dev/null)
if [ -n $DRAPIKEY ] && [ $DRAPIKEY != ]; then
echo 获取到API密钥: ${DRAPIKEY:0:12}...
printf \nDEEPREADAPIKEY=%s\n $DRAPIKEY >> .env
break
fi
done
或直接注册:https://www.deepread.tech/dashboard/?utm_source=clawhub
步骤2:在仪表盘中添加您的提供商密钥
BYOK密钥通过DeepRead仪表盘管理:
bash
open https://www.deepread.tech/dashboard/byok?utm_source=clawhub
在仪表盘中:
- 1. 点击添加提供商密钥
- 选择您的提供商 — OpenRouter、OpenAI或Google
- 粘贴您的API密钥
- 密钥在保存前会通过提供商API进行验证
- 密钥在静态时加密并安全存储
就这样。所有后续API调用将自动通过您的密钥路由。
步骤3:处理文档(与之前相同的API)
您的代码无需任何更改。相同的端点,相同的X-API-Key请求头:
bash
DRAPIKEY=$(grep ^DEEPREADAPIKEY .env | cut -d= -f2)
curl -X POST https://api.deepread.tech/v1/process \
-H X-API-Key: $DRAPIKEY \
-F file=@document.pdf
在底层,LLM调用现在通过您的提供商密钥路由。页面配额不会被计算。
管理您的密钥
所有密钥管理均在仪表盘中完成,访问 https://www.deepread.tech/dashboard/byok
- - 开启/关闭:在您的密钥和DeepRead处理之间切换,无需删除密钥
- 替换:添加新密钥以替换现有密钥(一次仅一个活跃密钥)
- 删除:永久移除密钥,恢复为DeepRead处理
模型切换机制
当您提供OpenAI或Google密钥时,DeepRead会自动将所有管道模型切换为您提供商的等效模型,保持相同质量层级:
顶级 — GPT-5(OpenAI)或Gemini 2.5 Flash(Google)
高级 — GPT-5 Mini(OpenAI)或Gemini 2.5 Flash(Google)
中级 — GPT-5 Nano(OpenAI)或Gemini 3 Flash(Google)
轻量级 — GPT-5 Nano(OpenAI)或Gemini 2.5 Flash Lite(Google)
OpenRouter用户:无需切换 — 相同模型,使用您的账单账户。
Python示例
python
import requests
import time
一旦在仪表盘中启用BYOK,您现有的代码即可正常工作。
LLM成本计入您的提供商账户。页面配额不会被计算。
APIKEY = skliveYOURKEY
BASE = https://api.deepread.tech
headers = {X-API-Key: API_KEY}
提交文档 — 与往常相同的API调用
with open(invoice.pdf, rb) as f:
job = requests.post(
f{BASE}/v1/process,
headers=headers,
files={file: f},
data={schema: {type:object,properties:{vendor:{type:string},total:{type:number}}}}
).json()
job_id = job[id]
print(f任务 {job_id} — LLM成本计入您的提供商账户)
轮询结果
delay = 3
while True:
time.sleep(delay)
result = requests.get(f{BASE}/v1/jobs/{job_id}, headers=headers).json()
if result[status] == completed:
print(f提取结果: {result[structured_data]})
break
elif result[status] == failed:
print(f失败: {result[error]})
break
delay = min(delay * 1.5, 15)
JavaScript示例
javascript
// 一旦在仪表盘中启用BYOK,您现有的代码即可正常工作。
const APIKEY = skliveYOURKEY;
const BASE = https://api.deepread.tech;
const form = new FormData();
form.append(file, fs.createReadStream(invoice.pdf));
const { id: jobId } = await fetch(${BASE}/v1/process, {
method: POST,
headers: { X-API-Key: API_KEY },
body: form,
}).then(r => r.json());
console.log(任务 ${jobId} — LLM成本计入您的提供商账户);
let delay = 3000;
let result;
do {
await new Promise(r => setTimeout(r, delay));
result = await fetch(${BASE}/v1/jobs/${jobId}, {
headers: { X-API-Key: API_KEY },
}).then(r => r.json());
delay = Math.min(delay * 1.5, 15000);
} while (![completed, failed].includes(result.status));
安全性
- - 静态加密 — Fernet对称加密(AES-128-CBC + HMAC-SHA256)
- 存储前验证 — 向您的提供商发送测试API调用以确认密钥有效
- 仅显示密钥提示 — 仪表盘仅显示最后4个字符用于识别
- 独立加密密钥 — 加密密钥与数据库分开存储
- 软删除 — 移除密钥会清除数据库中的密文
- 一次一个密钥 — 简单的账单管理,所有处理通过一个提供商路由
何时使用BYOK
在以下情况下使用BYOK:
- - 您拥有OpenAI企业协议及协商费率
- 您有希望用于文档处理的Google Cloud积分
- 您希望DeepRead LLM成本为零且无页面处理限制
- 您需要所有AI调用通过自己的提供商账户进行以符合合规要求
- 您正在使用免费套餐并希望跳过每月2,000页的限制
在以下情况下不要使用BYOK:
- - 您对DeepRead的默认处理感到满意 — 开箱即用效果很好
- 您没有现有的AI提供商账户
- 您希望DeepRead在一张发票中处理所有账单
适用于所有