For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
跳至內容

Create and Manage API Tokens

Learn how to create, manage, disable, and replace ApiSmart API Keys for secure API authentication.

ApiSmart uses API Tokens to authenticate requests from your applications.

Each Token can be managed separately and may have its own usage limit.

🔐 Security warning: Anyone with access to a valid API Token may be able to make requests and consume your wallet balance. Keep every Token secure.


🔑 Open API Token Management

To manage your API keys:

  1. Sign in to ApiSmart.

  2. Open Console in the left navigation.

  3. Select API Tokens.

The page displays the integration information required for API requests:

It also shows your existing API Tokens, usage limits, status, creation time, and available actions.


Create an API Token

To create a new key:

  1. Open Console → API Tokens.

  2. Select Create API Key.

  3. Enter a token name.

  4. Enable Set Usage Limit when needed.

  5. Enter the maximum amount the key can consume.

  6. Select Confirm.

  1. Copy and securely save the new key.

Choose a Clear Token Name

Use a name that identifies where the Token will be used.

Examples:

For multiple projects, consider:

Example:


💰 Set a Usage Limit

The optional usage limit controls how much one API Token can consume.

For example:

Although the account has $49 available, that API key can consume only $5.


Copy and Store Your API Token

Copy the key after creation and save it in a secure location.

The management table displays only a masked version of the Token.

If available, please use the copy button.

Store the Key in an Environment Variable

macOS or Linux

Windows PowerShell

Do not store production keys directly in source code.


Use Your API Token

ApiSmart uses Bearer authentication.

Include the key in the request header:

Test the Key with cURL

A successful request should return an API response rather than an authentication error.

Chat Completions Example

After confirming that the Token works, see Chat Completions API, Image Generation API, or Video Generation API for complete request examples.


Understand the API Token Table

The API Token Management table displays the following information:

Field
Description

Name

Token name assigned during creation

Key

Masked API Token value

Used / Remaining

Consumed and remaining allowance under the usage limit

Created At

Date and time the Token was created

Status

Whether the Token is currently enabled or disabled

Code Integration

Ready-to-copy authentication example

Actions

Edit, Disable, or Delete the Token


Edit an API Token

Select Edit next to a Token to update its available settings.

Depending on the current dashboard options, you may be able to change:

  • Token Name

  • Usage Limit

Changing the Token Name does not change the actual Token value.

After updating the usage limit, check Used / Remaining to confirm the new allowance.


Disable or Delete an API Token

Use Disable when a Token should no longer be allowed to make requests.

Use Delete when the Token is no longer required.

Before changing a Token used by an application, confirm that the application has been updated to use the correct replacement Token.


🔐 API Token Security

  • Keep API Tokens private.

  • Store Tokens in environment variables or another secure server-side location.

  • Never expose Tokens in public repositories or browser-side code.

  • Disable a Token immediately if it may have been exposed.

  • Review Usage Logs for unfamiliar activity.

For detailed security guidance, see Secure Your API Keys.


🛠️ Troubleshoot API Key Problems

The API Token Is Not Working

Check that:

  • The complete Token was copied

  • The Token status is Enabled

  • The Token has remaining allowance

  • Your wallet has sufficient balance

  • The API Base URL is correct

  • The request uses Bearer authentication


The Account Has Balance, but Requests Still Fail

Wallet balance and API Token limits are separate controls.

Check:

  • Wallet → Current Balance

  • API Tokens → Used / Remaining

  • Token status

  • Model ID

  • API endpoint

  • Request format


I See Usage I Do Not Recognize

  • Disable the affected API Token.

  • Create a replacement Token.

  • Update your application.

  • Review Console → Usage Logs.

  • Save unfamiliar Request IDs and contact support if needed.

🔐 Never provide your full API Token to support.


🚀 Next Steps

Continue with:

最後更新於

這有幫助嗎?