On This Page
Bring Your Own Key (BYOK)
Connect your OpenAI or Anthropic API key to Sortio and run AI file organization on any model they offer — billed to your provider account.
What is BYOK?
60-second walkthrough.
Sortio normally uses its own managed AI via subscription credits. BYOK (Bring Your Own Key) lets you supply your own OpenAI or Anthropic API key so Sortio calls those models on your behalf — billed directly to your provider account.
💳 No credit usage
Calls use your provider account, not Sortio credits.
🎛️ Your models, your rates
Pick any supported model and pay the provider's per-token price.
✨ Premium model access
Use whatever chat model your provider exposes — Sortio fetches the list from their API and lets you pick.
🧩 Works with everything
Same KG extraction, same Automations, same Spaces.
When to use BYOK vs Cloud vs Ollama
Sortio supports three AI backends. Each has a different privacy posture, cost model, and setup effort — here's how they compare.
Sortio Cloud
Privacy: Standard TLS
Cost: Included in subscription
Setup: Zero
Best for: General users who want it to just work
Local (Ollama)
Privacy: Maximum (fully offline)
Cost: Free (hardware only)
Setup: Install Ollama + pick a model
Best for: Sensitive files or offline use
BYOK
Privacy: Goes to OpenAI/Anthropic directly
Cost: Pay provider per-token
Setup: Paste API key
Best for: You already have API credits or want specific premium models
💡 Tip: Switch any time
You can switch providers any time from Settings without re-indexing. Knowledge Graph data persists across provider changes.
Supported providers and models
BYOK currently supports OpenAI and Anthropic. Paste a key for one or both — Sortio remembers each independently.
OpenAI
API key format
sk-...
Get a key
platform.openai.com/api-keysModels
Sortio fetches your available chat models directly from OpenAI when you click Load. Pick whichever makes sense for your workload — smaller models are fast and cheap per call, larger models are more accurate for nuanced extractions.
Anthropic
API key format
sk-ant-...
Get a key
console.anthropic.com/settings/keysModels
Sortio fetches your available Claude models from the Anthropic API when you click Load. Smaller Claude models handle per-file classification quickly; larger ones are better for complex entity extraction.
Setting up BYOK
Setup takes about a minute. You'll paste your key, test it, and save.
Step-by-Step
1
Open Settings
Click the gear icon in the sidebar, or press ⌘, (Cmd+comma).
2
Select Bring Your Own Key
In the AI Provider section, choose the BYOK radio. New options appear below.
3
Choose OpenAI or Anthropic
Use the tab buttons labeled OpenAI and Anthropic.
4
Paste your API key
Paste into the password-masked field. If a key is already saved, you'll see a Current: sk-...xxxx preview below.
5
Click Load
Sortio fetches your available models from the provider's API and populates the Model dropdown. You can also type a model name directly if needed.
6
Click Test Key
Sends a minimal test call. A green key is valid means you're wired up; errors are surfaced verbatim.
7
Click Save
Commits your configuration. The app header now shows BYOK (openai) or BYOK (anthropic).
✅ You're done
That's it. Every Sort, every Space index, every Automation lookup now routes through your API key.
How is my API key stored?
Your API key never leaves your machine except to call the provider you chose. Here's exactly where it lives and how it's protected.
Local storage only
Keys live in Sortio's local SQLite database under setting keys openai_api_key and anthropic_api_key.
Encrypted at rest
The database file is encrypted using SQLCipher with a machine-specific derived key. The file is useless if copied to another computer.
Transmitted only to the provider
Keys are transmitted only to api.openai.com or api.anthropic.com over HTTPS. Never sent to Sortio's servers, never logged, never in analytics.
Masked in the UI
Display is always masked — the UI only shows sk-...xyz.
⚠️ If you suspect a key has been compromised
Deleting Sortio does not remove your API key from OpenAI or Anthropic. If you suspect compromise, revoke the key from your provider's dashboard.
See Security & Privacy for broader disk-encryption details.
Understanding costs
BYOK doesn't consume Sortio credits. You're billed by OpenAI or Anthropic directly for every call Sortio makes on your behalf.
Rough guidance
Classification per file is small — typically ~500–2k input tokens and ~100 output tokens. Indexing a Space of a few hundred files on a small, cheap model is usually well under a dollar. Check your provider's dashboard to confirm cost for your specific model choice.
Provider pricing pages
💡 Tip: Use a cheap model for the classification pass
Use a cheap/fast model for the per-file classification pass — the bulk of Sortio's work is many small calls, so the cost per file matters more than single-call accuracy. If a particular Space has unusually dense or nuanced content, switch to a stronger model and re-index just that Space.
ℹ️ No in-app cost estimate yet
Sortio doesn't currently show a per-call cost estimate in the app for BYOK. Monitor spend on your provider's dashboard.
Switching providers and troubleshooting
Switching is as simple as changing the AI Provider radio and clicking Save. Keys and model selections for each provider persist independently — you can flip between OpenAI and Anthropic without re-entering keys.
Troubleshooting
"Invalid API key" on Test Key
Verify the key in your provider dashboard, check for stray whitespace when pasting, and confirm billing is set up on the provider side.
"Load" returns nothing or fails
Save the key first — Sortio reads the saved key for the model fetch. For Anthropic, the fallback list is used if the live fetch fails.
Rate limits / 429 errors
Both providers throttle new accounts. Upgrade your tier with the provider, or switch to a smaller model.
I changed my key upstream
Paste the new key, click Save, then Test Key to confirm.
Related documentation
- Local Models Setup — run Ollama locally for maximum privacy
- Spaces — monitored folders powered by your chosen AI
- Rules Engine — deterministic Automations that run before AI
