BrainLink Developer Quickstart
Integrate BrainLink and list your app in the AI store in 5 minutes.
BrainLink Developer Docs
Integrating BrainLink in your app allows your users to connect their brains with a single click. This allows you to get rid of the inference costs and provides your app with a simple way to monetize without paywalls or sign-up forms.
By integrating BrainLink your app is automatically listed in the BraiLink AI store, which is a powerful distribution channel and source of users.
We are devs building for fellow devs.
Integrating BrainLink
Register your application with BrainLink
Register your application with BrainLink
If your are still testing your app and have no public URL, skip the registration and use
5e476497-d7a1-4d27-8ad3-616210cf754d
as the app client ID. The user will be redirected tohttp://localhost:3000
as callback URL.
- Create your own BrainLink account by going to the dashboard.
- Click on the top right menu icon and click on “Register application” under the developer section.
- Fill the form with your application data. If you application is a desktop app, the callback URL should point to localhost. For the callback URL, if you don’t plan to redirect the user to a specific page after connecting their account, just provide the base URL of the application. In most of the cases, it matches the application website URL.
- Copy the application client ID that is shown after the registration.
For React based frameworks like Next.js
For React based frameworks like Next.js
If you are using React based frameworks like Next.js, you can directly import the BrainLink button:
To see complete examples for different frameworks see our examples repository.
For the rest
For the rest
You can also import the BrainLink SDK script directly:
Then, create a button and set as the on-click
attribute the BrainLink.startCodeExchange(appClientId, appCallbackUrl);
method.
The application client ID must be the one you generated in the previous step and the callback URL is optional. You just need to provide a callback URL if you want
the user to be redirected to a different page after connecting his BrainLink account, otherwise, it will remain on the same page.
And that’s all! Now your users will pay for the inference they consume by connecting their BrainLink account with your application in one click, so you don’t have to request them API keys.
Running inference
BrainLink’s API is fully OpenAI compatible, so you can directly use the OpenAI SDK or any other compatible one, just change the baseURL
to https://www.brainlink.dev/api/v1
.
For example: