> 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/fabricate/fabricate-api/managing-fabricate-api-keys.md).

# Managing Fabricate API keys

To use the Fabricate API, you must have a Fabricate API key.

## Displaying the list of API keys

To display the list of API keys, click the user icon at the bottom left of Fabricate, then select **Account Settings**.

The **API Keys** page contains the list of API keys for the account.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FoXTKcpVIPG2uhdmrBpkt%2FAccount_APIKeys.png?alt=media&amp;token=b47b3e05-c0d9-4cdc-8fd8-34ceb4a3ccde" alt=""><figcaption><p>API Keys list for an account</p></figcaption></figure>

## Creating an API key

To create an API key, click **New API Key**.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FOfZdg3xI2ShIgraSBL4U%2FAccount_CreateAPIKey.png?alt=media&amp;token=f6f34cd3-eb4b-472e-a94a-79de25f3b6ff" alt=""><figcaption><p>Create New API Key panel to create a new API key for an account</p></figcaption></figure>

### Setting the API key name

On the **Create New API Key** panel, in the **Name** field, provide a name for the API key.

### Setting the API key expiration

By default, API keys do not expire.

To set an expiration, from the **Expires** dropdown list, select when the API key expires. You can select one of the default options (30 days, 90 days, one year), or provide a custom expiration date.

### Setting the API key AI spend limit

By default, an API key is subject to the default [AI spend limit for account users](/fabricate/about-fabricate/fabricate-pricing-and-ai-usage/tracking-and-limiting-ai-usage-and-cost.md#configuring-the-default-per-user-ai-usage-limit).

To  customize the limti for the API key, in the **AI Spend Limit** field, specify the limit.

### Setting the account role for the API key

By default, new API keys are assigned the Member account role. For information about account roles, go to [Assigning account roles to users](/fabricate/fabricate-accounts-and-users/managing-account-membership/managing-account-users/account-roles.md).

To assign a different account role, select the role from the dropdown list.

### Granting access to current account workspaces

By default:

* For account roles other than Auditor, API keys are granted Editor access to all of the current account workspaces. For information about workspace roles, go to [Configuring access to a workspace](/fabricate/workspaces/configuring-access-to-a-workspace.md#about-workspace-roles).\
  \
  To grant a different workspace role, select the role from the dropdown list.\
  \
  To not grant any access to the account workspaces, uncheck the **Grant access to existing workspaces** checkbox. You can then add the API key as needed to specific workspaces.
* For the Auditor account role, API keys are not granted specific access to existing workspaces, and the checkbox is unchecked.\
  \
  To grant additional access to the account workspaces, check the **Grant access to existing workspaces** checkbox, then select the role to assign.

Note that this setting only applies to workspaces that exist when you create the API key. The API key is not automatically granted access to any future workspaces.

### Setting the model preferences for calls to the MCP server

By default, when an API key is used to make calls to the Fabricate MCP server, it uses the [default models that are configured for the account](/fabricate/about-fabricate/fabricate-pricing-and-ai-usage/account-default-available-ai-models.md#ai-models-default).

To customize the models that the API key uses for the MCP server:

1. From the **Data Generation** dropdown list, select the AI model to use for data generation.
2. From the **Validation** dropdown list, select the AI model to use for validation.
3. From the **Freeform Text** dropdown list, select the AI model to use to generate freeform text.

You can select from the [available models for the account](/fabricate/about-fabricate/fabricate-pricing-and-ai-usage/account-default-available-ai-models.md).

### Saving and copying the API key

When you complete the API key configuration:

1. Click **Create API Key**.
2. On the **API key created** panel, Fabricate displays the key.\
   \
   To be able to use the key, you must copy it from this panel. The key is not displayed again. On the **API Keys** page, the keys are masked.\
   \
   To copy the key to the clipboard, click **Copy**.

## Changing the configuration of an API key <a href="#api-key-change-config" id="api-key-change-config"></a>

To change the API key configuration:

1. Click the edit icon for the API key.
2. On the **Edit API Key** panel, update the API key settings.
3. To save the changes, click **Save Changes**.

## Changing the assigned account role for an API key <a href="#api-key-change-account-role" id="api-key-change-account-role"></a>

You can also change the assigned account role directly from the **API Keys** list.

To change the assigned account role for an API key, select the role from the **Account Role** dropdown list.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2F2R3XRm2Gev88syKQHYhh%2FAccount_APIKeysRoleDropdown.png?alt=media&amp;token=58c782df-64f6-48ae-b8b6-6d430b12f26e" alt=""><figcaption><p>Account Role dropdown list for an API key</p></figcaption></figure>

## Deleting an API key

To delete an API key, click its delete icon.


---

# 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/fabricate/fabricate-api/managing-fabricate-api-keys.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.
