> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/app/setting-up-your-database/spark-sdk/setting-up-the-spark-sdk.md).

# Setting up the Spark SDK

After you create the workspace, including the data connections, the next step is to set up the SDK.

For a Spark SDK workspace, at the top right corner of the workspace management view, the **Generate Data** button is replaced with an **SDK Setup** button.

<figure><img src="/files/E207qpq0uNn3BBb7UP7A" alt=""><figcaption><p>SDK Setup option for a Spark SDK workspace</p></figcaption></figure>

To get started, click **SDK Setup**.

## Generating an API token

On the **API Token** tab of the setup panel, to create an API Token, click **Create API token**.

<figure><img src="/files/ahCHSzwtRvze54uGHvDb" alt=""><figcaption><p>API Token tab of the Spark SDK setup panel</p></figcaption></figure>

After you create the API token, use the copy icons to copy the following values, which you will need to run the data generation:

* API token
* Workspace ID

<figure><img src="/files/QnK6hzU3Z1SUKaIHw4oH" alt=""><figcaption><p>API Token tab with a generated token</p></figcaption></figure>

When you're finished, click **Next**.

## Downloading the Structural SDK JAR file

On the **Download SDK** tab of the SDK setup panel, to download the Structural SDK JAR file, click  **Download the JAR**.

<figure><img src="/files/w5W4AdmoXYjqN71Qp2mL" alt=""><figcaption></figcaption></figure>

Place the JAR file on the Spark master node. Your Spark jobs must include this JAR file.

You can optionally include the SDK as a Maven dependency. To display the repository entries for the Spark SDK, On the **Download SDK** tab, click **Maven**.

<figure><img src="/files/3zbevdl3hOGmwkpKhxH4" alt=""><figcaption><p>Maven dependency entries for the Spark SDK</p></figcaption></figure>


---

# 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.tonic.ai/app/setting-up-your-database/spark-sdk/setting-up-the-spark-sdk.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.
