Get startedAPI referenceGoing to productionExplore models

Account & operations

New API compatibility

Connect New API-compatible tools to your PicoX account to query account information and balance, and manage your own API keys.

Create a management token

  1. Open Console → Settings → Account → Access tokens. Open account settings
  2. Choose a name, expiration and permissions, then create the token. For key management tools, select both key read and key write permissions.
  3. Copy the token and numeric New API user ID. The secret is shown once; you can revoke it from the same settings panel.

Tokens expire after 30 days by default. The console offers 1, 7, 30 or 90 days, or no expiry. The session API accepts 0 for no expiry or 1–366 days. Each account can have 20 active tokens.

Choose the right credential

Management Access Tokens begin with pico_pat_ and work only on the personal management endpoints below. Model requests and API-key balance queries use pk_live_ API keys. Management tokens cannot access administrator or console session APIs.

Base URL and authentication

Use https://picox.ai as the base URL, without /v1. Send the Access Token as a Bearer token. New-Api-User is optional; if provided, it must match the token owner's numeric user ID.

Environment
export PICO_BASE_URL="https://picox.ai"
export PICO_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
export PICO_NEW_API_USER="YOUR_NUMERIC_USER_ID"

Token permissions

PermissionAccess
account:readRead your account, balance, cumulative usage and available model IDs.
keys:readList, search and inspect your own API keys. Existing secrets are masked.
keys:writeCreate, edit, enable, disable and delete your own API keys.

Permissions are independent: key write access does not include key read access. A token never grants access to another account.

Supported management endpoints

MethodEndpointPermission
GET/api/user/selfaccount:read
GET/api/user/modelsaccount:read
GET/api/token/keys:read
GET/api/token/searchkeys:read
GET/api/token/{id}keys:read
POST/api/token/keys:write
PUT/api/token/keys:write
PUT/api/token/?status_only=truekeys:write
DELETE/api/token/{id}keys:write

Use the numeric IDs returned by these endpoints. List and search accept p (default 1) and page_size (default 10, maximum 100); ps and size are aliases. Search uses keyword for names or key prefixes. Trailing slashes are optional.

Request examples

Run the environment setup above first. Replace key ID 123 with the numeric ID returned when listing or creating your key.

curl "$PICO_BASE_URL/api/user/self" \
  -H "Authorization: Bearer $PICO_ACCESS_TOKEN" \
  -H "New-Api-User: $PICO_NEW_API_USER"
curl "$PICO_BASE_URL/api/token/?p=1&page_size=10" \
  -H "Authorization: Bearer $PICO_ACCESS_TOKEN" \
  -H "New-Api-User: $PICO_NEW_API_USER"
curl "$PICO_BASE_URL/api/token/" \
  -H "Authorization: Bearer $PICO_ACCESS_TOKEN" \
  -H "New-Api-User: $PICO_NEW_API_USER" \
  -H "Content-Type: application/json" \
  -d '{"name":"Integration key","remain_quota":5000000,"unlimited_quota":false,"expired_time":-1}'
curl -X PUT "$PICO_BASE_URL/api/token/?status_only=true" \
  -H "Authorization: Bearer $PICO_ACCESS_TOKEN" \
  -H "New-Api-User: $PICO_NEW_API_USER" \
  -H "Content-Type: application/json" \
  -d '{"id":123,"status":2}'
curl -X DELETE "$PICO_BASE_URL/api/token/123" \
  -H "Authorization: Bearer $PICO_ACCESS_TOKEN" \
  -H "New-Api-User: $PICO_NEW_API_USER"

Creation returns the new secret once in data.key. GET responses mask it. Deleting a key invalidates it while retaining usage and accounting history.

Quota units and key settings

  • 500,000 quota units equal USD 1. The create example gives the key a USD 10 budget; it does not add funds to the account.
  • Account quota is available wallet funds plus unexpired gifts, floored at zero. Credit lines and subscription allowances are not included. used_quota is cumulative recorded spend; request_count is the recorded request count. balance_micros and used_micros provide exact micro-dollar values.
  • For finite keys, editing remain_quota sets the remaining budget and preserves past spending. A new finite key requires positive quota. unlimited_quota removes only the key budget cap; account billing policies still apply.
  • Set expired_time to Unix seconds, or -1 for no expiry. Status 1 enables a key and 2 disables it. Read responses also use 3 for expired and 4 for exhausted; enabling does not clear these restrictions.
  • Edits accept name, status, remain_quota, unlimited_quota, expired_time, model_limits_enabled, model_limits and allow_ips. Omitted fields and native supplier, RPM, concurrency and discount settings are preserved.
  • model_limits is a comma-separated list of known model IDs and requires model_limits_enabled=true to enable restrictions. allow_ips accepts IPs or CIDRs separated by commas or newlines; null or an empty string clears IP restrictions. Account access policies still apply.

Responses and compatibility limits

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

{"success":false,"message":"Access token is missing, invalid, revoked, or expired.","error":"invalid_access_token"}

HTTP 400 indicates invalid fields or an unsupported option, 401 invalid authentication, 403 missing token permission, 404 a missing or unowned key, and 409 a key limit or unavailable secret. Check both HTTP status and success.

This covers personal account and API key management. Administrator endpoints and New API's own token-issuance endpoints are not supported. Cross-group selection, nonempty auto_groups and cross_group_retry=true are rejected. Empty group uses the account's current group.

Existing key secrets cannot be retrieved because only hashes are stored. POST /api/token/{id}/key returns 409 key_secret_unavailable and never silently resets a key. Secret-key search using the token query parameter is also unsupported; use keyword instead.

Balance queries with an API key

Tools that only have a model API key can use the billing endpoints below. Authenticate with an API key, not a management Access Token. The paths also work without the /v1 prefix.

Request
export PICO_API_KEY="YOUR_API_KEY"
curl "$PICO_BASE_URL/v1/dashboard/billing/subscription" \
  -H "Authorization: Bearer $PICO_API_KEY"
curl "$PICO_BASE_URL/v1/dashboard/billing/usage" \
  -H "Authorization: Bearer $PICO_API_KEY"

hard_limit_usd is in USD and total_usage is in US cents. Remaining USD equals hard_limit_usd minus total_usage divided by 100. These results include available gifts and respect the presented key's budget; they do not use the 500,000-unit quota format above.

Copied