Skip to main content
All API endpoints use the prefix https://api.tennda.ai. Use HTTPS in production to protect authentication tokens; HTTP is recommended for development only.A complete management system for user API tokens, supporting create, update, delete, batch operations, and quota & permission control.
Note: API keys are tokens you generate under Personal Center → Access Tokens for accessing /api routes.

User Authentication

The following endpoints require user login authentication. Include Authorization in the request headers.
string
required
User login token, format: Bearer your_user_token

Common Response Structure

All endpoints return a unified JSON envelope:

Token Object Fields

Token objects returned by list, search, detail, and update endpoints include the following fields (key is masked in list/detail/update responses):

List All Tokens

  • HTTP Method: GET
  • Path: /api/token/
  • Description: Paginated list of all tokens for the current user
Query Parameters
integer
default:"1"
Page number
integer
default:"20"
Page size
Request Example
Success Response
Error Response
Response Fields

Search Tokens

  • HTTP Method: GET
  • Path: /api/token/search
  • Description: Search the user’s tokens by keyword and token value
Query Parameters
string
Search keyword; matches token name
string
Token value search; supports partial match (sk- prefix optional); supports % wildcards, up to 2
integer
default:"1"
Page number
integer
default:"20"
Page size; max 100
Request Example
Success Response
Error Response
Response Fields

Get Single Token

  • HTTP Method: GET
  • Path: /api/token/:id
  • Description: Get detailed information for a specific token
Path Parameters
integer
required
Token ID
Request Example
Success Response
Error Response
Response Fields

Create Token

  • HTTP Method: POST
  • Path: /api/token/
  • Description: Create a new API token; batch creation is supported
Request Body
string
required
Token name; max length 30 characters
integer
Expiration timestamp; -1 means never expires
integer
Remaining quota
boolean
Whether quota is unlimited
boolean
Whether model limits are enabled
array
Allowed model list
string
Allowed IP addresses, comma-separated
string
Billing group
Request Example
Success Response
Error Response
Response Fields
On success, the response body does not include a data field and does not return the full key. Use Get Token Key to retrieve the full key when needed.

Update Token

  • HTTP Method: PUT
  • Path: /api/token/
  • Description: Update token configuration; supports status-only updates and full updates
Request Body
integer
required
Token ID
boolean
Whether to update status only
Other fields are the same as Create Token and are all optional. Request Example (full update)
Request Example (status only)
Success Response
Error Response
Response Fields

Delete Token

  • HTTP Method: DELETE
  • Path: /api/token/:id
  • Description: Delete a specific token
Path Parameters
integer
required
Token ID
Request Example
Success Response
Error Response
Response Fields

Batch Delete Tokens

  • HTTP Method: POST
  • Path: /api/token/batch
  • Description: Batch delete multiple tokens
Request Body
array
required
List of Token IDs to delete; required and must not be empty
Request Example
Success Response
Error Response
Response Fields

Get Token Key

  • HTTP Method: POST
  • Path: /api/token/:id/key
  • Description: On-demand retrieval of the full (unmasked) key for a specific token; rate-limited
Path Parameters
integer
required
Token ID
Request Example
Success Response
Error Response
Response Fields
This endpoint returns the full key. Store it securely and avoid displaying it in plaintext in logs or frontend pages.

Batch Get Token Keys

  • HTTP Method: POST
  • Path: /api/token/batch/keys
  • Description: Batch retrieve full keys for multiple tokens; max 100 per request
Request Body
array
required
List of Token IDs to retrieve keys for; required and must not be empty; max 100
Request Example
Success Response
Error Response
Response Fields