Skip to content

Configure Google Cloud

Justin Weisz edited this page May 18, 2026 · 4 revisions

Important

The instructions below reflect the general steps needed to set up AI services on Google Cloud. As cloud service providers redesign their user interfaces, the specific steps you need to perform may vary.

There are three AI services you can set up on Google Cloud:

  1. Cloud Speech-to-Text API
  2. Cloud Text-to-Speech API
  3. Cloud Vision API

Sign up for Google Cloud

To create your own instances of these services, you first need to sign up for a Google Cloud account if you do not have one already. Visit Google Cloud and click "Get started for free" to create a new account. If you have an existing Google account, you will still need to register for Google Cloud.

Note

As part of the sign up process, you may be asked to enter credit card information for billing. Google Cloud offers trial versions of many services, including Speech-to-Text, Text-to-Speech, and Vision, so you should be able to try these services with your TJBot at no cost.

Create a project

Google Cloud organizes service instances into projects. First, create a project for your TJBot's cloud services.

  1. Open the Project Picker and click "New project".
  2. Give your project a name, such as "My First Project".

Enable cloud services

  1. In the Cloud sidebar, navigate to APIs & Services > Enabled APIs & services.
  2. Click the button "+ Eanble APIs and services" (toward the top of the UI). This will take you to the API Library.
  3. Search for the APIs you wish to enable and click "Enable" to enable the service.
  • Cloud Vision API
  • Cloud Speech-to-Text API
  • Cloud Text-to-Speech API

Tip

One of TJBot's recipes, tj-the-translator, makes use of the Cloud Translation API. You may wish to enable it at this time.

Next, you will need to authorize your IAM account to be able to access each service.

  1. In the Cloud sidebar, navigate to APIs & Services > Credentials.
  2. Click "+ Create credentials" and select "Service account."
  3. Type a name for the service account, such as "tjbot". The service account ID will automatically be generated from the naem you give it.
  4. Click "Create and continue".
  5. Ignore the optional sections for "Permissions" and "Principles with access" and click "Done."
  6. Click on your new service account in the "Service Account" list
  7. Navigate to the "Permissions" tab and click "Manage access"
  8. Under "Assign roles," click "+ Add role."
  9. Add the "Cloud Speech Client" (and optionally, "Cloud Translation API User") roles.
  10. Click "Save".

Create authentication credentials

Now it is time to create authentication credentials for your service account.

  1. On the page for your service account, click the "Keys" tab.
  2. Click "Add key" and choose "JSON" for the key type. Click "Create."

After clicking "Create," your computer will download a .json file containing the authentication credentials.

Warning

This .json file contains authentication credentials for your Google Cloud services. Keep this file secret and do not share it. Also, do not check it in to a Github repository or other source control system. Otherwise, others may be able to use your Google Cloud services, including services for which you may be billed.

Configure TJBot to use Google Cloud services

Your credentials file will be named after your Google Cloud project, such as omega-bonsai-314200-251cc63fc5a0.json. Copy it to your TJBot's ~/.tjbot directory.

cd ~/Downloads
scp omega-bonsai-314200-251cc63fc5a0.json pi@tjbot.local:~/.tjbot

Note

The exact commands you use will differ. This example assumes the JSON file was downloaded to your ~/Downloads/ folder as omega-bonsai-314200-251cc63fc5a0.json, that the account name on your Raspberry Pi is pi, and that the network address of your TJBot is tjbot.local.

To enable Google Cloud's AI services, update the following settings in your tjbot.toml file:

[listen.backend]
type = 'google-cloud-stt'

[see.backend]
type = 'google-cloud-vision'

[speak.backend]
type = 'google-cloud-tts'

If you wish to store your credentials file in an alternative location, simply update your tjbot.toml configuration to specify that location. The relevant keys to update are:

[listen.backend.google-cloud-stt]
credentialsPath = "<path to your .json credentials file>"

[see.backend.google-cloud-vision]
credentialsPath = "<path to your .json credentials file>"

[speak.backend.google-cloud-tts]
credentialsPath = "<path to your .json credentials file>"

Google Cloud-specific settings

Each Google Cloud AI service has a number of service-specific settings you can configure, such as the voice used for Text-to-Speech and confidence thresholds for computer vision tasks. Please review tjbot.toml to learn more about these settings.

Clone this wiki locally