API Reference

List API keys

List API keys. Fields and permissions follow this gateway implementation.

GET https://api.tu-zi.com/api/token/
Preview guide

Paste into an AI assistant to help with integration. Documentation and examples only; no real credentials.

Preview guide

List API keys

Updated · Reviewed

Endpoint and authentication

GET https://api.tu-zi.com/api/token/

Transport: json

Use an account system token and New-Api-User (account ID), or a valid site login session. Manage system tokens in account settings. Inference API keys are not substitutes.

Authorized OAuth access tokens are also supported; required scope: token:read

Authorization: Bearer YOUR_SYSTEM_TOKEN
New-Api-User: YOUR_USER_ID

Before running

Replace https://api.tu-zi.com with this site origin (do not append /v1 twice), and YOUR_MODEL with the exact marketplace model ID. Install requests for Python; use Node.js 20+ and save JavaScript as .mjs. WebSocket samples list their own dependencies.

Set SYSTEM_TOKEN and USER_ID in the environment; keep system tokens out of frontend code. Replace YOUR_SYSTEM_TOKEN and YOUR_USER_ID in cURL.

Start with a minimal request, then read the result using the response fields below. For async APIs, a returned task ID requires polling; acceptance does not mean generation has finished.

Query parameters

FieldTypeRequiredDescription / constraints
pintegerNoPage number starting at 1. Example: 1
page_sizeintegerNoPage size up to 100; omitted uses the site setting. Example: 10
keywordstringNoName keyword.
tokenstringNoKey filter.
groupstringNoGroup filter.
statusintegerNo1 enabled, 2 disabled, 3 expired, 4 exhausted.
expired_onlybooleanNoOnly expired tokens.
negative_quota_onlybooleanNoOnly negative-quota tokens.
last_used_beforeintegerNoLast-used upper bound, Unix seconds.
sort_bystringNoid, remain_quota, accessed_time or expired_time.
sort_orderstringNoasc or desc.

Response fields

FieldTypeDescription / constraints
successbooleanBusiness success; do not rely only on HTTP status.
messagestringResult or error message.
data.pageintegerCurrent page.
data.page_sizeintegerEffective page size.
data.totalintegerTotal records.
data.itemsarrayRecords in the current page.
data.items[].keystringMasked key, never the full credential.
data.items[].is_expiredbooleanWhether expired.
data.items[].idintegerToken ID.
data.items[].user_idintegerOwner user ID.
data.items[].statusinteger1 enabled, 2 disabled, 3 expired, 4 exhausted.
data.items[].created_timeintegerCreation timestamp in Unix seconds.
data.items[].accessed_timeintegerLast access timestamp in Unix seconds.
data.items[].used_quotaintegerConsumed internal quota units.
data.items[].unlimited_countbooleanWhether request count is unlimited; derived from remain_count.
data.items[].mj_cdnstringMidjourney CDN configuration.
data.items[].mj_cdn_addrstringMidjourney CDN address.
data.items[].storage_enabledbooleanStorage setting.
data.items[].DeletedAtstring | nullSoft-deletion timestamp; normally null for active records.
data.items[].namestringName, up to 50 bytes.
data.items[].expired_timeintegerUnix seconds; -1 means no expiry. Set explicitly.
data.items[].remain_quotaintegerInitial quota, nonnegative.
data.items[].unlimited_quotabooleanUnlimited quota.
data.items[].remain_countintegerRequest-count limit; 0 means unlimited.
data.items[].groupstringAuthorized groups, comma separated.
data.items[].model_limits_enabledbooleanEnable model restrictions.
data.items[].model_limitsstringComma-separated model IDs.
data.items[].allow_ipsstring | nullAllowed IP/CIDR, one per line.
data.items[].exclude_ipsstring | nullBlocked IP/CIDR, one per line.
data.items[].cross_group_retrybooleanCross-group retry setting.
data.items[].routing_preferencestringprice or quality.
data.items[].routing_quality_thresholdinteger30, 40, 50, 60, 70, 80, 85, 90, 95.
data.items[].mj_modestringMidjourney mode; omitted uses site default.
data.items[].rate_limits_enabledbooleanEnable token rate limits.
data.items[].rate_limits_timeintegerRate-limit window in seconds; effective when enabled and both time and count are positive.
data.items[].rate_limits_countintegerRate-limit request count.
data.items[].rate_limits_contentstringMessage returned when the token rate limit is reached; empty uses the default message.

Illustrative response; some endpoints show essential fields only. Optional fields may be absent.

{
  "success": true,
  "message": "",
  "data": {
    "page": 1,
    "page_size": 10,
    "total": 0,
    "items": []
  }
}

Errors and retries

Check HTTP status and success. Business validation errors may return HTTP 200 with {"success":false,"message":"..."}; some include error.code. Authentication may return 401/403 and rate limiting 429. HTTP 200 alone does not guarantee success.

Use bounded exponential backoff for reads. Do not blindly retry task creation, generation, or key mutations, to avoid duplicate billing or execution.