How to Use and Set Up BYOK (Bring Your Own Key) in Afforai

Try BYOK in Afforai

This is Fujii. In this article, I will explain how to use your own API key in Afforai.

I got a question on YouTube.

How to Use and Set Up BYOK (Bring Your Own Key) in Afforai

It says "Bring Your Own Key via OpenRouter (GPT4, Claude, Sonnet, Gemini, etc)" but I don't know how to set it up. I would appreciate it if you could explain it to me.

Normal use of Afforai does not require BYOK settings. If you wish to set up your own, please continue reading below.

This article first explains BYOK. Then,

  • Secure Setup Method
  • How to manage costs to avoid going broke from overuse of APIs
  • How to Customize AI Models in Afforai

in turn.

What is Bring Your Own Key (BYOK)?

First, the acronym for Bring Your Own Key.BYOKIt is.

Afforai's chat function is unlimited.

*There is a fair use policy, though, so you may be banned if you use the service in a way that breaks the service.

But what if you want to use an AI model that is not supported by Afforai?

That is BYOK. Use your own API key,That's what I mean.

You can use the encrypted OpenRouter API key (rest assured that the API key is not viewed by Afforai's management).

Explanation of OpenRouter from registration to fee payment

first (of all)OpenRouterFirst, we will use OpenRouter. Simply put, it is a platform where you can use various AI models. Think of it as a place where you can access and run a variety of free and paid AI models.

To use BYOK in Afforai, use this OpenRouter.

If you do not have an OpenRouter account, please continue reading below. If you already know that, please skip to the bottom of the page.

How to create an OpenRouter account [How to register].

First.Official SiteGo to the "Create an account" page. Although it is in English, you can easily create an account for free by following these steps▼.

First, press the "SIgn In" button from the top page.

To create an OpenRouter account, press the Sign In button

A login form will appear. There is a Sign up link at the bottom. Please press it.

Then the account login page will open.

Here you will find the form below.

Register a new OpenRouter account by setting your email address and password12 here
  • Email address (Enter your email address)
  • Password (you can choose your own password)

Set these two freely. After setting, press the button.

You will then receive a confirmation email.

You will receive a confirmation email from your OpenRouter account at the email address you set up.

Check your email inbox and you will find a confirmation email from OpenRouter.

If you did not receive it, it is in your spam folder. Most likely, this will not happen, but please check just in case.

Please press the button in the e-mail you receive. This completes your registration.

Open your email inbox and you should see an email from OpenRouter.

How to pay for OpenRouter [Stripe can be used].

The following OpenRouter payment methods.

Press "Credits" from the menu in the upper right corner.

Press credits to pay for OpenRouter

Go to the Credits page. Press "Manage Credits.

When OpenRouter credits opens, press manage credits.

If you would like to receive a receipt, check the "Send me invoices" box that opens here.

Press "Use checkout page" to settle your payment on the payment page.

You can choose your OpenRouter payment method here

You will need to enter your personal information. This area can be entered in Japanese, so the explanation is omitted.

First you will need to enter your personal information; you will need to enter the OpenRouter payer's information here

If you have a credit card stored in Stripe, you will immediately see the payment options as shown below.

If you check the "Use checkout page" checkbox, you will be able to pay on the Stripe payment page.

It is possible to pay for OpenRouter via stripe

You can pay by Stripe as follows. If you are worried about using a credit card on an overseas site, don't worry.

It is possible to make OpenRouter payments on the stripe page

Manage OpenRouter Keys

To manage API keys, press "Keys" from the top right corner of the OpenRouter dashboard.

Set Keys in OpenRouter.

You can manage each setting of the key and set billing limits. Be sure to check the settings carefully to prevent overuse.

API key will be displayed

Press Manege to set the Credit limit as shown in the image below. This is optional, but recommended.

If set here, once the amount of credits ($USD) consumed by this API key reaches this amount, it cannot be used any more.

Be sure to set the credit limit here to prevent overuse with OpenRouter!

For unlimited use, you do not need to enter anything.

API usage can also be monitored from Activity.

It is possible to see how much API is being used by pressing the Activity button.

You have complete control over key usage.

In the OpenRouter setup, you can freely choose the AI model.

You can specify which AI model to use in the OpenRouter configuration

Again, there is no need to configure any OpenRouter settings for normal use with Afforai; there is no need to configure BYOK.

This option is for those who are not satisfied with Afforai's default AI model.

How to set up BYOK in Afforai

First, open an Afforai chat.

To start the setup on the Afforai side, first open a chat.

Press the "Custom" AI model setting in the menu.

The "Custom" item is at the bottom of the list, so do that.

Now press the "Connect to OpenRouter" button.

You will need to connect to your OpenRouter account. connect to OpenRouter

You will be redirected to the OpenRouter page. Press Authorize here.

Authorization request opens.

It will then automatically return to Afforai.

You will then be automatically redirected to Afforai

Notes on using BYOK in Afforai

  • Using BYOK with Afforai will incur API fees from your OpenRouter account.
  • It is recommended that spending limits be set in order to control spending.important

Needless to say, using BYOK incurs API costs. You can avoid overuse by limiting it.

However, OpenRouter is not my service. Therefore, I am not responsible for its configuration and usage. Please do so at your own risk.

How to Customize BYOK in Afforai

How to set up BYOK on the Afforai side.

When you connect the OpenRouter key, you will see the settings to customize OpenRouter in Afforai.

BYOK mode

Option to configure the usage of the OpenRouter key. The following options are provided

  • Disabled: The key remains connected to Afforai but is not used.
  • Afforai Pick: Uses the same model as the Afforai system.
  • Custom: Users can choose their own model.
  • OpenRouter's Default: The model is selected through the OpenRouter UI. This option is not recommended as different models cannot be selected for different operations.

Multimodal Model

This model answers the question with an image (used for file annotation).

Query Model

This model is responsible for answering questions (used at query time).

JSON Model

This model is responsible for generating JSON objects for use in intermediate processing.

Tips for setting up BYOK in Afforai

Afforai can use its own API key. This option is not necessary for normal users, but by connecting the API key with BYOK, you can use AI models that are not normally available in Afforai.

Here is some advice before you set it up. The following advice from Afforai is pasted below.

  • Initially, start with the Afforai selection to understand how to use the keys.
  • If you want to choose your own model, we recommend that you change only the Query Model and leave the others as GPT-3.5.
  • If you want to customize the model significantly, choose the cheapest option possible for each model, and gradually increase the performance of the model to find the cosmetics that are best suited to your needs.

Note: It is strongly recommended to select a model with at least 16,000 tokens in the context window. This will help maintain AI performance.

Selecting a model with less than 16,000 tokens will degrade the quality of the AI output and may not generate citations.

We hope this will be helpful to those who use BYOK in Afforai.

The Web Attracting Customers Guidebook 3.0 for the One-Stop Entrepreneur

Free e-book, "How to Create Content That Attracts Customers."
It's hard to create blog posts, videos, and social networking posts to attract web visitors. It takes time and you don't know if the content you create will produce results.

In this free report, I share all of my actual tips and tricks for attracting web customers.

If you put into practice what is written in this free report, you will be able to create a large amount of content to attract customers and get more potential customers more easily than before.

Download your free report now and get more prospects online.