> 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, and to interact with mock APIs and MCP servers, you must have a Fabricate API key.

Each Fabricate API key is granted access to specific workspaces and is assigned an account role.

Account owners can generate new Fabricate API keys as needed. API keys have no effect on an account's user seats.

## 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. The list includes the key configuration and indicates who created the key.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FKukkoS9KfaHNSfZ0FIlL%2FAccount_APIKeys.png?alt=media&amp;token=19765b4c-1d50-4618-80b9-ad13ff5e0626" 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%2FpOlSf5TWgaGBksXzp5du%2FAccount_CreateAPIKey.png?alt=media&amp;token=ad737d55-e123-4665-a0b3-49b42ee822aa" 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 limit 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 by default 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, toggle **Grant access to all workspaces** to the off position. You can then add the API key as needed to specific workspaces.
* For the Auditor account role, API keys are not by default granted specific access to existing workspaces, and the toggle is in the off position.\
  \
  To grant additional access to the account workspaces, toggle **Grant access to all workspaces** to the on position, 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 **Data Profiling** dropdown list, select the AI model to use for data profiling.
4. From the **Freeform Text** dropdown list, select the category of 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**.

## Editing an API key

### Changing the API key configuration <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%2FnPS6z3pJ7IhUrqJtTv1W%2FAccount_APIKeysRoleDropdown.png?alt=media&amp;token=094936a2-26fd-44da-9e9e-4c407899ddfb" alt=""><figcaption><p>Account Role dropdown list for an API key</p></figcaption></figure>

### Changing the AI spend limit for an API key

You can change the AI spend limit directly from the **API Keys** list.

You can edit the regular spend limit, and set a temporary increased spend limit for the current billing period. For example, you might grant the API key a temporary increase to use to complete a special project.

To change the AI spend limit:

1. In the **AI Spend Limit** column for the API key, click the edit icon.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2F2LsikCXiLnd4MvJ2rj71%2FAccount_APIKeysAISpendLimit.png?alt=media&amp;token=113dea9d-39e0-412a-958d-2d3d9584a87a" alt=""><figcaption><p>Edit AI Spend Limit panel for an API key</p></figcaption></figure>

2. On the **Edit AI Spend Limit panel**, in the **Billing-period spend limit** field, provide the maximum AI spend per billing period for the API key. You can either type the value directly, or use the up and down arrows to increase or decrease the value.\
   \
   If the current value is different from the default, then to reset it to the default, click **Reset to Default**.
3. In the **Temporary Spend Increase** field, provide a larger spend limit that only applies to the current billing period. You can either type the value directly, or use the up and down arrows to increase or decrease the value.\
   \
   The value must be larger than **Billing-period spend limit**. The value represents the total increased spend limit, not the difference between the regular limit and the temporary increased limit. For example, if the billing-period spend limit is $5, then to temporarily increase it to $10, in the field, set the value to 10.
4. Click **Save**.

When a temporary increase is in effect, the **AI Spend Limit** column indicates the increased limit and when it expires.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FzmpeUiYLR3PI0jqD0jyH%2FAccount_APIKeyAITempIncrease.png?alt=media&amp;token=f86f1d26-b3d7-4601-b7f9-828aed58b395" alt=""><figcaption><p>AI spend limit with a temporary increase in effect</p></figcaption></figure>

## Deleting an API key

To delete an API key:

1. Click its delete icon.
2. On the confirmation panel, click **Confirm**.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tonic.ai/fabricate/fabricate-api/managing-fabricate-api-keys.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
