Skip to content

Commit e0cdcf9

Browse files
authored
Show how to get API keys (#166)
1 parent 2a4cfd5 commit e0cdcf9

File tree

11 files changed

+139
-26
lines changed

11 files changed

+139
-26
lines changed

pages/home/_meta.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export default {
4242
quickstart: {
4343
title: "Quickstart",
4444
},
45+
"api-keys": {
46+
title: "Get an API key",
47+
},
4548
"use-tools": {
4649
title: "Tool Calling",
4750
},

pages/home/api-keys.mdx

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: "Getting Your API Key"
3+
description: "Learn how to obtain and manage your Arcade API key"
4+
---
5+
6+
import { Steps, Tabs } from "nextra/components";
7+
8+
# Getting Your API Key
9+
10+
11+
Before you begin, you'll need an Arcade account - if you haven't created one yet, you can [sign up here](https://api.arcade.dev/signup). Once you have an account, you can generate API keys through either our dashboard or CLI.
12+
13+
14+
<Tabs items={["Dashboard", "CLI"]}>
15+
16+
17+
<Tabs.Tab>
18+
19+
### Using the Dashboard
20+
21+
<div className="flex justify-center my-4">
22+
<video
23+
src="/videos/API_Keys.mp4"
24+
autoPlay
25+
muted
26+
playsInline
27+
className="w-full max-w-[900px] rounded-xl shadow-2xl"
28+
controls
29+
></video>
30+
</div>
31+
32+
<Steps>
33+
### Navigate to API Keys page
34+
Visit the [API Keys page](https://api.arcade.dev/dashboard/api-keys) in Arcade Dashboard.
35+
36+
### Create a new API key
37+
1. Click the `Create API Key` button in the top right
38+
2. Enter a descriptive name to help identify your key
39+
3. Click `Create API Key` to generate your key
40+
41+
### Save your API key securely
42+
1. Copy your API key immediately - it will only be shown once
43+
2. Store it securely
44+
3. You can always generate new keys if needed
45+
46+
</Steps>
47+
48+
</Tabs.Tab>
49+
50+
<Tabs.Tab>
51+
52+
### Using the CLI
53+
54+
<Steps>
55+
56+
### Install and login
57+
1. Install the Arcade CLI:
58+
```bash
59+
pip install arcade-ai
60+
```
61+
2. Start the login process:
62+
```bash
63+
arcade login
64+
```
65+
66+
### Complete setup
67+
The CLI will automatically:
68+
- Print your API key to the console
69+
- Save your credentials to `~/.arcade/credentials.yaml`
70+
71+
</Steps>
72+
73+
</Tabs.Tab>
74+
</Tabs>
75+
76+
<Warning type="warning">
77+
API keys are administrator credentials. Anyone who has your API key can make requests to Arcade as you. Always store your API keys in a safe place, such as system environment variables, and never commit them to version control, share them publicly, or use them in browser or frontend code.
78+
</Warning>
79+
## Next Steps
80+
81+
Once you have your API key, you can:
82+
- [Start using tools](use-tools/call-tools-directly)
83+
- [Call tools with LLMs](use-tools/call-tools-with-models)
84+
- [Create custom tools](custom-tools)

pages/home/custom-tools.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ pip install arcade-ai
2626
arcade login
2727
```
2828

29-
<Tip>Obtaining an API key through the Arcade dashboard is coming soon!</Tip>
30-
3129
### Try `arcade chat`
3230

3331
With Arcade CLI installed, you can test out our API with the `arcade chat` command:

pages/home/langchain/use-arcade-tools.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ pip install langchain-arcade langchain-openai langgraph
2323

2424
Provide your Arcade and OpenAI API keys. You can store them in environment variables or directly in your code:
2525

26+
> Need an Arcade API key? Visit the [Get an API key](/home/api-keys) page to create one.
27+
28+
2629
```python
2730
import os
2831

pages/home/langchain/user-auth-interrupts.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ pip install langchain-arcade langchain-openai langgraph
2323

2424
Make sure you have set your Arcade API key (and any other relevant keys) in the environment, or assign them directly in the code:
2525

26+
> Need an Arcade API key? Visit the [Get an API key](/home/api-keys) page to create one.
27+
2628
```python
2729
import os
2830

pages/home/use-tools/call-tools-directly.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@ You still get the benefits of Arcade managing authorization and tool execution,
1818
### Prerequisites
1919

2020
- [Set up Arcade](/home/quickstart)
21+
- Create an Arcade [API key](/home/api-keys), if you haven't already
2122

2223
### Set environment variables
2324

24-
You can find your API key in `~/.arcade/credentials.yaml`.
25+
You can find your Arcade API key in one of these locations:
2526

27+
- [Arcade Dashboard](https://api.arcade.dev/dashboard/api-keys) under API Keys
28+
- `~/.arcade/credentials.yaml`
29+
30+
Export your Arcade API key as an environment variable:
2631
```bash
2732
export ARCADE_API_KEY=<your-api-key>
2833
```

pages/home/use-tools/call-tools-with-models.mdx

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,59 @@ To do this, you'll build an AI chatbot that can star GitHub repositories on your
1717
### Prerequisites
1818

1919
- [Set up Arcade](/home/quickstart)
20-
- Sign up for an [OpenAI account](https://platform.openai.com/signup) and follow their [quickstart guide](https://platform.openai.com/docs/quickstart)
20+
- Create an Arcade [API key](/home/api-keys), if you haven't already
21+
- Export your Arcade API key as an environment variable:
22+
```bash
23+
export ARCADE_API_KEY=<your-api-key>
24+
```
2125

22-
### Initialize the OpenAI client
26+
### Install OpenAI Client
2327

24-
Create a new file in your favorite editor. If you followed the OpenAI quickstart guide, use the `example.py` or `example.mjs` file you created.
28+
Below we show you Python and JavaScript installation commands, but you can find installation instructions for other languages in the [OpenAI libraries documentation](https://platform.openai.com/docs/libraries):
2529

26-
Use the OpenAI client, and change the base URL and API key to point to Arcade:
30+
<Tabs items={["Python", "JavaScript"]}> <Tabs.Tab>
2731

28-
<Tabs items={["Python", "JavaScript"]}>
29-
<Tabs.Tab>
32+
```bash
33+
pip install openai
34+
```
3035

31-
```python file=<rootDir>/examples/code/home/use-tools/call-tools-with-models/github_stars_chatbot.py#L1-L8 {1,6-7}
36+
</Tabs.Tab> <Tabs.Tab>
3237

38+
```bash
39+
npm install openai
3340
```
3441

35-
</Tabs.Tab>
42+
</Tabs.Tab> </Tabs>
3643

37-
<Tabs.Tab>
44+
### Set up your OpenAI client
3845

39-
```js {1,5-6}
40-
import OpenAI from "openai";
46+
Create a new file in your favorite editor (e.g. `example.py` or `example.mjs`) and initialize the OpenAI client with Arcade's base URL and API key to enable tool access:
4147

42-
//# Initialize the OpenAI client, pointing to Arcade
43-
const openai = new OpenAI({
44-
apiKey: process.env.ARCADE_API_KEY,
48+
<Tabs items={["Python", "JavaScript"]}> <Tabs.Tab>
49+
50+
```python {1, 5-6}
51+
import os
52+
from openai import OpenAI
53+
54+
client = OpenAI(
55+
base_url="https://api.arcade.dev/v1",
56+
api_key=os.environ.get("ARCADE_API_KEY")
57+
)
58+
59+
```
60+
61+
</Tabs.Tab> <Tabs.Tab>
62+
63+
```typescript
64+
import { OpenAI } from "openai";
65+
66+
export const client = new OpenAI({
4567
baseURL: "https://api.arcade.dev/v1",
68+
apiKey: process.env["ARCADE_API_KEY"],
4669
});
4770
```
4871

49-
</Tabs.Tab>
50-
51-
</Tabs>
72+
</Tabs.Tab> </Tabs>
5273

5374
Requests made with this client will be routed to Arcade first, then to OpenAI. The AI model will instantly have access to the tools provided by Arcade.
5475

public/videos/API_Keys.mp4

2.18 MB
Binary file not shown.

src/components/pages/quickstart/Prerequisites/openai.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { Steps, Tabs } from "nextra/components"; import { Info } from "lucide-re
44
- Arcade API key
55

66
<Tip>
7-
To obtain an API key, please refer to the [SDK
8-
installation](/home/custom-tools/) page.
7+
To obtain an API key, please refer to the [Get an API key](/home/api-keys) page.
98
</Tip>
109

1110
### Install and use Arcade

src/components/pages/quickstart/Prerequisites/python.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { Info } from "lucide-react";
55
- Arcade API key
66

77
<Tip>
8-
To obtain an API key, please refer to the [SDK
9-
installation](/home/custom-tools/) page.
8+
To obtain an API key, please refer to the [Get an API key](/home/api-keys) page.
109
</Tip>
1110

1211
### Install and use Arcade

0 commit comments

Comments
 (0)