To build your own AI agent with tochat, you need a “brain.” That brain is Google’s powerful Gemini AI model. To connect to it, you need a special password called an API Key.
Don’t worry, this is the most technical part of the whole process, and it’s actually very easy. Think of it like getting a key to a new apartment. Google gives you the key for free, and you just need to plug it into tochat to unlock the door to your new AI workforce.
Best of all, Google’s free tier is incredibly generous, so you can likely run your agent for free for a long time!
What You’ll Need
- A Google (Gmail) account.
- 2 minutes of your time.
Step 1: Go to Google AI Studio
First, head over to Google’s official platform for managing their AI models. Click the link below to open it in a new tab: Go to Google AI Studio
If you aren’t already signed in to your Google account, you will be prompted to do so. Sign in with the account you want to use for your business.
Step 2: Accept the Terms
If this is your first time visiting, Google will show you a welcome screen and ask you to accept their Terms of Service. Go ahead and read through them, then check the boxes to accept and continue.
Step 3: Create an API Key
Once you’re in the main dashboard, look at the menu on the left-hand side. You will see a button labeled “Get API key” (it usually has a little key icon next to it). Click that button.
On the next screen, click the “Create API key” button. A pop-up window will appear asking where you want to create the key.

For simplicity, click on the option that says “Create API key in new project”. This keeps things neat and tidy.
Step 4: Copy Your New Key
After a few seconds, Google will generate your unique API key. It will look like a long string of random letters and numbers (e.g., AIzaSyD...).
Treat this key like a password. Do not share it publicly. Anyone with this key can use your Google account’s AI quota.
Click the “Copy” button next to your API key. Copy your new API key to your clipboard.

Step 5: Paste it into tochat
Now, go back to your tochat Dashboard. Click + Agent button at the top corner. The popup will appear asked you to input the Gemini API key. Click submit button to verify that your API key is working. If it’s verified, then you’ll redirected to the edit agent page.
That’s it! Your agent is now connected to Google’s powerful brain and is ready to be trained. You can now proceed to the “Source” tab to upload your PDFs and documents.