HomeQuickstart

Let’s get started with Arcade

Arcade allows LLMs to call tools on behalf of users while taking care of the authorization flow using OAuth 2.0 or API key authentication.

An example of a tool is Google.SendEmail. With Arcade, a user interacting with an LLM in a chat interface could ask:

send an email to [email protected] with the subject “Meeting” and the body “Let’s meet at 3pm tomorrow”

Our tool catalog covers multiple services, such as Slack, Notion, X, Dropbox, GitHub, Drive, Calendar, and many more.

In the example above, the user may have previously analyzed a set of pages from Notion, for example. After chatting with the LLM, they would send an email to a colleague summarizing the analysis. All of our digital life can now be integrated with the reasoning power of LLMs. Arcade enables developers to easily integrate that power into any application, workflow, or AI Agent.

You can skim through the code below to see how it works. In order to run it, you’ll need to:

Prerequisites

  1. Create an Arcade account
  2. Get an Arcade API key and take note, you’ll need it in the next steps.

Install the OpenAI SDK:

pip install openai

Implement the tool call

Create a new file, open it with your preferred editor and enter the code indicated in the next steps.

touch example_openai.py

Next we’ll edit that file and add some code. Open the file you just created in your preferred editor.

First, we need to instantiate the OpenAI client pointing to the Arcade’s endpoint and using the Arcade API key you created prior.

from openai import OpenAI
 
client = OpenAI(base_url="https://api.arcade.dev/v1", api_key="arcade_api_key")

Next, we define the parameters for the request. In the prompt below, you can replace [email protected] with your own email address. The Gmail tool will send a message to yourself, which you’ll be able to see in your inbox.

prompt = "send an email to [email protected] with the subject 'Meeting' and the body 'Let's meet at 3pm tomorrow'"
tools = ["Google.SendEmail"]
model = "gpt-4o"
user_id = "[email protected]"

In a real application, the prompt would come from your user and the user_id would be a unique identifier for your application’s user (could be an email address, a UUID, etc.). In this example, use your own email address.

And, finally, we send the request:

response = client.chat.completions.create(
    model=model,
    messages=[{"role": "user", "content": prompt}],
    tools=tools,
    tool_choice="generate",
    user=user_id,
)
 
print(response.choices[0].message.content)

Execute the code

python3 example_openai.py

Authorize the tool

The first time you run this, you will see a URL to authorize the tool to send the message on your behalf:

Please go to this URL and authorize the action: https://accounts.google.com/o/oauth2/v2/auth?...

Once you’ve followed the URL and completed the authorization flow, run the script again. You should see a message like this:

The email with the subject "Meeting" and body "Let's meet at 3pm tomorrow" has been sent to [email protected].

Next steps

Learn more about tools and how they work. Or follow other examples listed below:

  • Choosing among multiple tools: In the example we followed above, only a single tool was used: Google.SendEmail. Check out this guide where we provide multiple tools for the LLM to choose from. It also features a simple multi-turn conversation loop.
  • Call tools directly, without LLM involvement: In some cases, you may want full control of which tool is called and how. Check the Call Tools Directly guide to learn how to call tools directly.
  • Create your own custom tools to fit any specific use case needed in your application, workflow, or AI Agent.