I built a portable AI account that connects to apps with one click

8 pointsposted 4 days ago
by miguelaeh

1 Comments

miguelaeh

4 days ago

Hi HN!

I believe there are many issues for devs and users with the current approach of copy-pasting AI provider API keys into applications.

I have built brainlink.dev as a solution to this and would love to get your feedback.

It is a portable AI account that users can connect with one click to every application that integrates the SDK. It works as follows:

1. The user clicks the connect button to link his brainlink account with the app. 2. The app obtains an access token to perform inference on behalf of the user, so the user pays for the usage.

Behind the scenes, a secure Auth Code Flow with PKCE takes place so that the app obtains an access and refresh token instead of directly an API key. When the application calls a model providing a user access token, the user pays for the inference.

I believe this approach offers multiple benefits to both, developers and users.

As a developer:

- I can build and test my app against a specific model without being tied to what API key the user provided, ensuring that everyone gets the same UX.

- I can easily move my app to a different model at any time. Without brainlink, if users add, let's say, an OpenAI API key, to change to Claude I would need to ask every user to update their API key.

- Asking for API keys goes against the ToS of most providers

As a user:

- The initial friction of configuring API keys disappears, especially for non-technical users who don't know what's an API key.

- My privacy increases because AI providers can't track my usage as it goes through the proxy.

- I have a single account that I can connect to multiple apps and see how much each app is consuming

- I can easily revoke connections (tokens)

I tried to make it very simple to integrate with an embeddable button, but you can also create your own button. Here is a live demo with a very simple chat: https://demo.brainlink.dev

I would love to hear your feedback and would be happy to help anyone who wants to integrate it.