Menu

Letting users bring their own AI key without storing it in plaintext
📰

Letting users bring their own AI key without storing it in plaintext

DEV Community: postgres·James Ngandu·6 days ago
#DBpy3uQS
#devtopostgresql#devto#dev#user#provider
Reading 0:00
15s threshold

A single AI key shared by every user of a small app is a bad deal. The free tier runs out, one noisy user consumes the quota, and the owner pays for everyone. Letting each reader bring their own key fixes that, but it creates a different problem: now the app stores secrets that belong to other people.

ARN.IO is a reading app with a book assistant. Readers can ask about a summary, a chapter or a theme. I added a bring-your-own-key setting this week. The rule is simple: a key can go in, but it never comes back out.

What the user sees

The account page has an AI tab with four fields:

Provider

Model

API base URL

API key

The provider list covers Groq, OpenAI, OpenRouter, DeepSeek, Google Gemini, Mistral and a custom OpenAI-compatible endpoint. Choosing a preset fills in the base URL and a default model. The key field is a password input and is never prefilled, even when a key is already saved.

After saving, the page shows which provider is active and offers a Remove Key button.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.