📖 To learn more, take a look at our complete API

📤 Example Request

  1. Generate an api key below👇

  2. Install node-fetch & add the GOOEY_API_KEY to your environment variables.
    Never store the api key in your code and don't use direcly in the browser.

$ npm install node-fetch
$ export GOOEY_API_KEY=sk-xxxx
  1. Use this sample code to call the API.
    If you encounter any issues, write to us at [email protected] and make sure to include the full code snippet and the error message.
import fetch from 'node-fetch';

const payload = {
  "input_prompt": "Create 3 lines only from this paragraph for a small monologue\n",
  "messages": [
    {
      "role": "user",
      "content": "How to do irrigation in a chilli field?"
    },
    {
      "role": "assistant",
      "content": "Irrigate chilli fields after planting, then based on needs: once a week in hot months and every 10-12 days in cold months. Ensure even water distribution, avoiding excess accumulation, which harms plants. In rainy season, adjust irrigation accordingly. \ud83c\udf31\ud83d\udca7"
    },
    {
      "role": "user",
      "content": "Speak about bees and their importance for pollination and therefore existence of humankind"
    },
    {
      "role": "assistant",
      "content": "Bees are tiny creatures that play a monumental role in our ecosystem. They are not just producers of honey; they are essential pollinators. Every time a bee visits a flower, it transfers pollen from one bloom to another, facilitating the production of seeds and fruits. This process, known as pollination, is crucial for the growth of many plants and crops that humans rely on for food. Without bees, we would face the loss of a vast array of our favorite foods, such as apples, almonds, and even coffee. \ud83c\udf3c\ud83c\udf6f\n\nHowever, the plight of bees is dire. They are facing rapid decline due to pesticides, pollution, and climate change. This decline poses a significant threat not only to biodiversity but also to our food security. If we care about food, nature, and life itself, we must prioritize the protection of bees and their habitats. \ud83c\udf0d\ud83d\udc94\n\nIn my work as a forest ecologist in Araku Valley, I see the fragility of these pollinators firsthand. Training communities to safeguard the remaining bee populations is part of my mission to ensure that these vital creatures continue to thrive alongside us. It's a hopeful vision where both real bees and synthetic pollinators, like RoBees, can coexist, ultimately allowing nature to reclaim its throne. \ud83d\udc1d\u2728"
    }
  ]
};

async function gooeyAPI() {
  const response = await fetch("https://api.gooey.ai/v2/agent?example_id=5j5xrzzcth9h", {
    method: "POST",
    headers: {
      "Authorization": "bearer " + process.env["GOOEY_API_KEY"],
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });

  if (!response.ok) {
    throw new Error(response.status);
  }

  const result = await response.json();
  console.log(response.status, result);
}

gooeyAPI();
  1. Generate an api key below👇

  2. Install requests & add the GOOEY_API_KEY to your environment variables.
    Never store the api key in your code.

$ python3 -m pip install requests
$ export GOOEY_API_KEY=sk-xxxx
  1. Use this sample code to call the API.
    If you encounter any issues, write to us at [email protected] and make sure to include the full code snippet and the error message.
import os
import requests

payload = {
    "input_prompt": "Create 3 lines only from this paragraph for a small monologue\n",
    "messages": [
        {"role": "user", "content": "How to do irrigation in a chilli field?"},
        {
            "role": "assistant",
            "content": "Irrigate chilli fields after planting, then based on needs: once a week in hot months and every 10-12 days in cold months. Ensure even water distribution, avoiding excess accumulation, which harms plants. In rainy season, adjust irrigation accordingly. 🌱💧",
        },
        {
            "role": "user",
            "content": "Speak about bees and their importance for pollination and therefore existence of humankind",
        },
        {
            "role": "assistant",
            "content": "Bees are tiny creatures that play a monumental role in our ecosystem. They are not just producers of honey; they are essential pollinators. Every time a bee visits a flower, it transfers pollen from one bloom to another, facilitating the production of seeds and fruits. This process, known as pollination, is crucial for the growth of many plants and crops that humans rely on for food. Without bees, we would face the loss of a vast array of our favorite foods, such as apples, almonds, and even coffee. 🌼🍯\n\nHowever, the plight of bees is dire. They are facing rapid decline due to pesticides, pollution, and climate change. This decline poses a significant threat not only to biodiversity but also to our food security. If we care about food, nature, and life itself, we must prioritize the protection of bees and their habitats. 🌍💔\n\nIn my work as a forest ecologist in Araku Valley, I see the fragility of these pollinators firsthand. Training communities to safeguard the remaining bee populations is part of my mission to ensure that these vital creatures continue to thrive alongside us. It's a hopeful vision where both real bees and synthetic pollinators, like RoBees, can coexist, ultimately allowing nature to reclaim its throne. 🐝✨",
        },
    ],
}

response = requests.post(
    "https://api.gooey.ai/v2/agent?example_id=5j5xrzzcth9h",
    headers={
        "Authorization": "bearer " + os.environ["GOOEY_API_KEY"],
    },
    json=payload,
)
assert response.ok, response.content

result = response.json()
print(response.status_code, result)
  1. Generate an api key below👇

  2. Install curl & add the GOOEY_API_KEY to your environment variables.
    Never store the api key in your code.

export GOOEY_API_KEY=sk-xxxx
  1. Run the following curl command in your terminal.
    If you encounter any issues, write to us at [email protected] and make sure to include the full curl command and the error message.
curl 'https://api.gooey.ai/v2/agent?example_id=5j5xrzzcth9h' \
  -H "Authorization: bearer $GOOEY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "input_prompt": "Create 3 lines only from this paragraph for a small monologue\n",
  "messages": [
    {
      "role": "user",
      "content": "How to do irrigation in a chilli field?"
    },
    {
      "role": "assistant",
      "content": "Irrigate chilli fields after planting, then based on needs: once a week in hot months and every 10-12 days in cold months. Ensure even water distribution, avoiding excess accumulation, which harms plants. In rainy season, adjust irrigation accordingly. \ud83c\udf31\ud83d\udca7"
    },
    {
      "role": "user",
      "content": "Speak about bees and their importance for pollination and therefore existence of humankind"
    },
    {
      "role": "assistant",
      "content": "Bees are tiny creatures that play a monumental role in our ecosystem. They are not just producers of honey; they are essential pollinators. Every time a bee visits a flower, it transfers pollen from one bloom to another, facilitating the production of seeds and fruits. This process, known as pollination, is crucial for the growth of many plants and crops that humans rely on for food. Without bees, we would face the loss of a vast array of our favorite foods, such as apples, almonds, and even coffee. \ud83c\udf3c\ud83c\udf6f\n\nHowever, the plight of bees is dire. They are facing rapid decline due to pesticides, pollution, and climate change. This decline poses a significant threat not only to biodiversity but also to our food security. If we care about food, nature, and life itself, we must prioritize the protection of bees and their habitats. \ud83c\udf0d\ud83d\udc94\n\nIn my work as a forest ecologist in Araku Valley, I see the fragility of these pollinators firsthand. Training communities to safeguard the remaining bee populations is part of my mission to ensure that these vital creatures continue to thrive alongside us. It'"'"'s a hopeful vision where both real bees and synthetic pollinators, like RoBees, can coexist, ultimately allowing nature to reclaim its throne. \ud83d\udc1d\u2728"
    }
  ]
}'

🎁 Example Response

{4 Items
"id"
:
string
"w4nndmtp8kr5"
"url"
:
string
"https://gooey.ai/agent/"
"created_at"
:
string
"2025-04-08T18:17:24.675501+00:00"
"output"
:
{14 Items
"final_prompt"
:
[6 Items
0
:
{
}2 Items
1
:
{
}2 Items
2
:
{
}2 Items
3
:
{
}2 Items
4
:
{
}2 Items
5
:
{
}2 Items
]
"output_text"
:
[1 Items
0
:
string
""Bees are tiny, yet they do something monumental f"
]
"output_audio"
:
[1 Items
0
:
string
"https://storage.googleapis.com/dara-c1b52.appspot."
]
"output_video"
:
[1 Items
0
:
string
"https://storage.googleapis.com/dara-c1b52.appspot."
]
"raw_input_text"
:
string
"Create 3 lines only from this paragraph for a smal"
"raw_tts_text"
:
NULL
"raw_output_text"
:
[1 Items
0
:
string
""Bees are tiny, yet they do something monumental f"
]
"references"
:
[5 Items
0
:
{
}4 Items
1
:
{
}4 Items
2
:
{
}4 Items
3
:
{
}4 Items
4
:
{
}4 Items
]
"final_search_query"
:
string
"Create a small monologue by condensing the informa"
"final_keyword_query"
:
NULL
"output_documents"
:
NULL
"reply_buttons"
:
NULL
"finish_reason"
:
[1 Items
0
:
string
"stop"
]
"metrics"
:
NULL
}
}

Please Login to generate the $GOOEY_API_KEY