> For the complete documentation index, see [llms.txt](https://docs.apismart.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apismart.ai/welcome-to-apismart/api-keys/create-and-manage-api-keys.md).

# Create and Manage API Keys

Learn how to create, use, edit, disable, and delete ApiSmart API Keys for secure API authentication.

API Keys are credentials used to authenticate requests to the ApiSmart API.

You can create and manage your API Keys from the ApiSmart Console. Each key can be used to access supported API endpoints and models available to your account.

### 🔑 Create an API Key

Sign in to the ApiSmart Console and go to:

**Console → API Keys**

Click **Create API Key** to create a new credential.

<figure><img src="https://3886476465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9rNjqyBvjfy7u1IjU03v%2Fuploads%2F2twZekDMOGW3VV6iu4nP%2F%E5%B1%80%E9%83%A8%E6%88%AA%E5%8F%96_20260822_182828.png?alt=media&amp;token=99990ad2-f83e-4d79-bd55-e54ff7c52c90" alt=""><figcaption></figcaption></figure>

When creating a key, use a descriptive name that helps you identify where it will be used.

For example:

* Development
* Production
* Backend Service
* Internal Testing

Using separate API Keys for different applications or environments makes them easier to manage later.

After creating the key, store it securely and use it only in trusted applications.

### 🔗 Use Your API Key

The standard ApiSmart API Base URL is:

`https://gw.apismart.ai/v1`

Authenticate requests by including your API Key in the `Authorization` header:

```http
Authorization: Bearer <your-api-key>
```

Replace `<your-api-key>` with your actual API Key.

For example, you can test your key by requesting the available model list:

```bash
curl https://gw.apismart.ai/v1/models \
  -H "Authorization: Bearer <your-api-key>"
```

If authentication succeeds, the API returns the models currently available through the platform.

### 🗂️ Manage Existing API Keys

The **API Keys** page lists the credentials you have created.

<figure><img src="https://3886476465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9rNjqyBvjfy7u1IjU03v%2Fuploads%2FRIMHInCOBW3JUvkGAkdw%2F%E5%B1%80%E9%83%A8%E6%88%AA%E5%8F%96_20260822_183023.png?alt=media&amp;token=7058c5df-b81c-449b-980d-f24d5bea212d" alt=""><figcaption></figcaption></figure>

For each key, you can review information such as:

* Key name
* Key identifier
* Usage or remaining balance information
* Creation time
* Current status
* Integration example

You can also search for an existing key by its name or prefix.

### ✏️ Edit an API Key

Use **Edit** when you need to update the information associated with an existing API Key.

<figure><img src="https://3886476465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9rNjqyBvjfy7u1IjU03v%2Fuploads%2FhM3rYACsjwnVHUWgffem%2F%E5%B1%80%E9%83%A8%E6%88%AA%E5%8F%96_20260822_183241.png?alt=media&amp;token=bbd9ff3b-532c-4c9a-8f24-394ed1d1a967" alt=""><figcaption></figcaption></figure>

For example, you may want to rename a key so that its purpose is easier to identify.

Use clear names such as:

`Production Backend`

or:

`Development Testing`

This becomes especially useful when your account contains multiple API Keys.

### ⏸️ Disable an API Key

If you want to temporarily prevent a key from making API requests, select **Disable**.

<figure><img src="https://3886476465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9rNjqyBvjfy7u1IjU03v%2Fuploads%2F2zntNiTqetWsxSBLi2Vc%2F%E5%B1%80%E9%83%A8%E6%88%AA%E5%8F%96_20260822_183746.png?alt=media&amp;token=8943ee79-bc56-402d-b21c-5340c0c12be9" alt=""><figcaption></figcaption></figure>

A disabled key can no longer be used to authenticate API requests.

Disabling a key is useful when:

* An application is temporarily inactive
* You are investigating unexpected usage
* You want to stop access without immediately deleting the key

If the key is needed again, you can re-enable it from the Console when the option is available.

### 🗑️ Delete an API Key

Use **Delete** when an API Key is no longer required.

<figure><img src="https://3886476465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9rNjqyBvjfy7u1IjU03v%2Fuploads%2FBUTGkF00OygD8HiunM0n%2F%E5%B1%80%E9%83%A8%E6%88%AA%E5%8F%96_20260822_183809.png?alt=media&amp;token=49d37915-5b2a-424a-aee7-42b4bc2e53b8" alt=""><figcaption></figcaption></figure>

Delete keys that belong to applications, environments, or services that are no longer in use.

Before deleting a key, make sure no active application still depends on it. Requests using a deleted key will no longer authenticate successfully.

### ⚠️ Keep API Keys Secure

API Keys provide access to your ApiSmart account and should be treated as sensitive credentials.

Do not:

* Share API Keys publicly
* Commit API Keys to public Git repositories
* Include API Keys directly in publicly accessible client-side code
* Send full API Keys in screenshots, logs, or support requests

For detailed security recommendations, see [**Secure Your API Keys**](https://docs.apismart.ai/welcome-to-apismart/api-keys/secure-your-api-keys.md).

### 🛠️ Authentication Issues

If the API returns:

`401 invalid_api_key`

check the following:

1. The API Key was copied correctly
2. The key is currently enabled
3. The request uses the `Bearer` authentication scheme
4. The `Authorization` header is formatted correctly
5. There are no missing characters or additional spaces

The expected format is:

```http
Authorization: Bearer <your-api-key>
```

If the key is valid but a specific model returns:

`403 model_not_allowed`

the model is not currently enabled for that API Key or account.

See [**Models and Model IDs**](https://docs.apismart.ai/models-and-pricing/models-and-model-ids.md) for more information about model access.

### ➡️ Next Steps

After creating your API Key, continue with:

* [**Secure Your API Keys**](https://docs.apismart.ai/welcome-to-apismart/api-keys/secure-your-api-keys.md) — Learn recommended security practices
* [**Models and Model IDs**](https://docs.apismart.ai/models-and-pricing/models-and-model-ids.md) — Find models available through the API
* [**Quick Start**](https://docs.apismart.ai/welcome-to-apismart/quick-start.md) — Send your first API request
* [**API Basics**](https://docs.apismart.ai/api-guides/api-basics.md) — Learn common API conventions
* [**Chat Completions API**](https://docs.apismart.ai/api-guides/chat-completions-api.md) — Start building with text models
* [**Image Generation API**](https://docs.apismart.ai/api-guides/image-generation-api.md) — Generate and edit images
* [**Video Generation API** ](https://docs.apismart.ai/api-guides/video-generation-api.md)— Create video generation workflows
