You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
+
<Warningtype="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)
Copy file name to clipboardExpand all lines: pages/home/use-tools/call-tools-with-models.mdx
+38-17Lines changed: 38 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,38 +17,59 @@ To do this, you'll build an AI chatbot that can star GitHub repositories on your
17
17
### Prerequisites
18
18
19
19
-[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
+
-ExportyourArcadeAPIkeyasanenvironmentvariable:
22
+
```bash
23
+
export ARCADE_API_KEY=<your-api-key>
24
+
```
21
25
22
-
### Initialize the OpenAI client
26
+
### Install OpenAI Client
23
27
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):
25
29
26
-
Use the OpenAI client, and change the base URL and API key to point to Arcade:
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:
41
47
42
-
//# Initialize the OpenAI client, pointing to Arcade
43
-
constopenai=newOpenAI({
44
-
apiKey:process.env.ARCADE_API_KEY,
48
+
<Tabsitems={["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
+
exportconst client =newOpenAI({
45
67
baseURL: "https://api.arcade.dev/v1",
68
+
apiKey: process.env["ARCADE_API_KEY"],
46
69
});
47
70
```
48
71
49
-
</Tabs.Tab>
50
-
51
-
</Tabs>
72
+
</Tabs.Tab> </Tabs>
52
73
53
74
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.
0 commit comments