API Reference

Search API keys

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

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

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

Preview guide

Search API keys

Updated · Reviewed

Endpoint and authentication

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

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; keep system tokens out of frontend code.

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

Authorization: Bearer YOUR_SYSTEM_TOKEN
New-Api-User: YOUR_USER_ID

Before calling

  • Examples use this site's address. For another gateway, replace only the site address and keep the full endpoint path.
  • Python / JavaScript read SYSTEM_TOKEN (account system token) and USER_ID (account ID) from the environment. In cURL, replace YOUR_SYSTEM_TOKEN and YOUR_USER_ID.

Confirming success

Check HTTP status, the business status in the body and the required result fields. Do not rely only on HTTP 200 or the script exit code.

  • Require success=true and inspect data. Read configuration back through its retrieval endpoint after changing it.
  • Empty lists may be valid but do not prove a specific resource exists.

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. HTTP 200 alone does not guarantee success.

  • Business validation: errors may return HTTP 200 with {"success":false,"message":"..."}; some include error.code.
  • Authentication failures: may return 401/403.
  • Rate limiting: may return 429.
  • Use bounded exponential backoff for reads encountering transient errors; fix parameter, authentication, quota, or configuration failures first.
  • Do not blindly retry task creation, generation, or key mutations, to avoid duplicate billing or execution.