# Creating and revoking Textual API keys

{% hint style="info" %}
**Required global permission:** Create an API key
{% endhint %}

To be able to use the Textual SDK, you must have an API key.

Alternatively, you can use the Textual API to [obtain a JSON Web Token (JWT)](/textual/tonic-textual-api/jwt-for-authentication.md) to use for authentication.

## Viewing the list of API keys <a href="#textual-api-keys-list" id="textual-api-keys-list"></a>

You manage keys from the **User API Keys** section of the **User Profile** page.

To display the **User Profile** page:

1. Click the user icon at the bottom of the navigation menu.
2. In the user menu, click **User Profile**.

<figure><img src="/files/k4sciWdX4RoXUye6uiqu" alt=""><figcaption><p>User API Keys list on the User Profile page</p></figcaption></figure>

## Creating a Textual API key

To create a Textual API key:

1. From the **User API Keys** section, click **Create New Key.**
2. In the **API Key Name** field, type a name to use to identify the key.

<figure><img src="/files/ZGt0keS82fP5xgVUr3rM" alt=""><figcaption><p>API key creation panel</p></figcaption></figure>

3. Click the save icon.

Textual adds the key to the list.

## Copying a Textual API key

To copy the text of an API key, so that you can use it in an SDK or API request, click its copy icon.

## Revoking a Textual API key

To revoke a Textual API key, in the **User API Keys** list, click the **Revoke** option for the key to revoke.

## Configuring the API key as an environment setting <a href="#textual-api-key-environment-setting" id="textual-api-key-environment-setting"></a>

You cannot instantiate the SDK client without an API key.

Instead of providing the key every time you call the Textual API, you can configure the API key as the value of the [environment variable](/textual/textual-install-administer/configuring-textual/textual-env-var-configure.md) `TONIC_TEXTUAL_API_KEY`.&#x20;


---

# Agent Instructions: 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:

```
GET https://docs.tonic.ai/textual/tonic-textual-api/textual-api-keys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
