> For the complete documentation index, see [llms.txt](https://docs.toucanai.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toucanai.cloud/embed/authentication/how-to/generate-a-sandbox-token.md).

# Generate a sandbox token

### Objective

In this tutorial, you will learn how to generate a sandbox token in Toucan AI. Sandbox tokens allow you to test embedding your visualizations and dashboards in a controlled environment before using them in production.

***

### Prerequisites

* A Toucan AI [account](https://toucan-toco.gitbook.io/toucan-ai/getting-started/subscribe-to-toucan).
* An [API key](https://toucan-toco.gitbook.io/toucan-ai/embed/authentication) (as seen in the previous tutorial on [how to generate a sandbox API key](https://toucan-toco.gitbook.io/toucan-ai/embed/authentication/how-to/generate-an-api-key)).

***

### Steps

#### 1. Access the Settings Menu

* From the main interface, click on the **Settings** button in the menu.

#### 2. Navigate to the Embed Tab

* In the **Settings** menu, click on the **Embed** tab to access token generation settings.

#### 3. Find the Token Generation Sandbox Section

* Scroll down to the **Token Generation Sandbox** section within the **Embed** tab.
* This section allows you to generate tokens specifically for testing and embedding purposes.

#### 4. Paste Your API Key

* In the **Token Generation Sandbox**, you will see a field to paste your **API key**.
* Copy your API key (generated in the previous tutorial) and paste it into this field.

#### 5. Generate the Token

* If needed, complete **Custom Attributes** to test your Row Level Security
* After pasting the API key, click the **Generate Token** button.
* A sandbox token will be generated and displayed on the screen. This token is valid for a limited time (1 hour by default) and can be used to test embedding visualizations or dashboards.

<figure><img src="/files/PL3c3vo1IkdcaRs4FUNP" alt="Token Generation"><figcaption></figcaption></figure>

#### 6. Copy and Store the Token

* **Copy the token** to use it for embedding dashboards and testing your integrations.
* Store the token securely in your password manager for future use.

***

### Conclusion

Congratulations! You have successfully generated a sandbox token in Toucan AI. This token can now be used to test embedding dashboards and charts within your application in a safe environment before going live in production.

**Suggested Next Steps:** [Token Introspection](https://toucan-toco.gitbook.io/toucan-ai/embed/authentication/how-to/token-introspection)!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.toucanai.cloud/embed/authentication/how-to/generate-a-sandbox-token.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
