In this post, we’ll learn how to set up an OpenAI account and obtain API keys to use with Goose AI.
What is Goose?
Goose is your all-in-one on-demand tool. It helps developers by allowing them to assign tasks to Goose, which completes them swiftly and efficiently.
How to Install Goose
To install Goose, use pipx
. First, ensure pipx
is installed by running the following commands:
brew install pipx
pipx ensurepath
How to Obtain Your API Key from OpenAI
To access your OpenAI API key, follow these steps:
- Navigate to the OpenAI API Keys page.
- Sign up or log in to your OpenAI account on the website.
- Once logged in, you will be redirected to the API key management page. Click on "Create new secret key" to generate your API key.
- Copy and securely store your API key, as it will only be shown once. Use this key to integrate OpenAI with your applications.
Adding Credits for API Usage
To interact with the Goose terminal, you need to have credits available in your OpenAI account. Follow the steps below to add credits:
- Click on Settings at the top-right corner of the OpenAI platform, then select Billing.
- Under the Billing section, click on Add Payment Method to enter your payment details.
- Once your payment method is successfully added, you will be prompted to purchase credits for API usage. The minimum purchase amount is $5. Complete the purchase to activate your API for use with Goose AI.
After adding credits, you are ready to leverage Goose AI for your tasks.
Using OpenAI as the Provider in Goose
After obtaining your API credits and API key, follow these steps to configure Goose with OpenAI as the provider:
- Open your terminal and start a Goose session by typing:
goose session start
When prompted, enter the OpenAI API key you copied earlier and press Enter.
Confirm by typing y to save your API key for future sessions.
Once the setup is complete, you can begin writing prompts in the terminal to interact with Goose AI.
Writing Simple Prompts
Once your terminal session is active, you can assign tasks to your AI agents, such as automating coding tasks or completing existing code. Let's generate a simple prompt using the terminal.
For example, we can ask Goose to create a simple calculator project using Vite with Vue as the framework.
Type the following instruction in the terminal:
Create a calculator in vite using vue as the framework
As shown above, Goose successfully created a folder named calculator and initialized the project. Next, we can open the project in VS Code by instructing Goose to open the folder in the editor.
open the directory in vscode you just created
Voila it opens vscode
I believe now you get a glimpse on how to use goose ai using the openAI.
Top comments (0)