Integrate ChatGPT with Google Sheets in 3 Minutes (No Scripts Required)

Using our API you can get ChatGPT responses directly in your Google Sheets using a single formula! No need to mess around with app scripts or extensions.

Simply use the following formula:

=IMPORTXML("", "/")

That's it! The cell value will be equal to the response from ChatGPT.

Getting Your API Key

As you can see in the formula, you have to insert your API key. This step requires having an active, paid subscription with Koala which start at just $9/month.

If you don't already have an account then first Register.

Then, you can sign up for a paid plan.

Once you have an active plan visit your Account page. Click the Add API Key button to create an API key. Then, copy the value of the created key, it will look like this: a0ce8c2f-60ad-4edc-89eb-bd6da042e572.

Now you can use this key in your formula, for example:

=IMPORTXML("", "/")

Important: Keep your API key secret and don't share it with other people.

Real-Time Data Integration

If you would like your response to incorporate real-time data from search engine results then you can simply add &realTimeData=true to the end of the URL.

For example for a prompt of "great danes":

=IMPORTXML(" danes&key=YOUR_API_KEY&realTimeData=true", "/")

This would output something like:

Great Danes are a breed of working dogs that originated in Germany at least 400 years ago. They were used for boar hunting and as guardians of German nobility. Great Danes are typically swift, alert, courageous, friendly, and dependable dogs. They are one of the two largest dog breeds in the world, along with the Irish Wolfhound. Male Great Danes can reach up to 32 inches at the shoulder and weigh a massive 175 pounds, while females are slightly smaller, at up to 30 inches. Great Danes are sociable, friendly, and eager to please, and they respond well to firm, consistent training methods. They need to have human contact, affection, and socialization with other dogs. (sources: [Wikipedia](, [AKC](, [Britannica](

Example 1

If you want to use the value of another cell in your prompt, like in the image above, then you can use & or CONCATENATE() to do so.

Here is an example using &:

=IMPORTXML(""&A1, "/")

And here is how to do the exact same thing with CONCATENATE():


Both of these formulas simply use the value of the A1 cell as the prompt.

Example 2

You can also put a prompt template in a cell and then call SUBSTITUTE() to dynamically replace one or more parts of it. This can make it easier to edit the prompt (or maybe even use a dynamic prompt that is the result of another prompt!)

Here is the formula used:


In this example, the prompt template is stored in a cell, in this case B1. It contains the following text:

How many calories are in a single serving of the following food on average: [FOOD]. Return only the number of calories, no explanation, do not return a range. Example: 100.

Then we are using SUBSTITUTE() to dynamically change the value of "[FOOD]" to whatever is stored in the provided cell (ex: Celery, Kale, etc).

Now you can easily update the prompt template just by changing the cell value and all of the results will be refreshed!