4Z API

Create token

Endpoint: POST https://4zapi.com/api/token/

Create an API token. On success, data is the full key string (sk-...); store it immediately.

Parameters

  • New-Api-User (header, string, required): Current user ID; must match the authenticated identity

Request body (application/json)

  • name (string, required): Name
  • allow_ips (string): IP allowlist
  • expired_time (integer): Expiry unix seconds; `-1` never expires
  • group (string): User group
  • mj_custom_proxy (string): Midjourney custom proxy
  • mj_image_mode (string): Midjourney image mode
  • model_limits (string): Model limit configuration
  • model_limits_enabled (boolean): Whether model limits are enabled
  • remain_quota (integer): Remaining quota
  • routing_priority (string): Routing priority
  • unlimited_quota (boolean): Whether quota is unlimited

Request example

{
  "allow_ips": "",
  "expired_time": -1,
  "group": "",
  "mj_custom_proxy": "",
  "mj_image_mode": "default",
  "model_limits": "",
  "model_limits_enabled": false,
  "name": "my-token",
  "remain_quota": 500000,
  "routing_priority": "",
  "unlimited_quota": false
}