Skip to Content
NineTwo's

Authentication

Project-scoped bearer keys, scopes, and the coded error envelope.

Bearer API keys

Send the API key in the Authorization header:

Authorization: Bearer ntw_...

The canonical key format is ntw_ followed by 43 base64url characters. Keys are project-scoped and carry operation scopes plus a model allowlist. They are not user session tokens and must not be used in browser bundles.

Scopes

ScopeOperations
models:readGET /v1/models
inference:chatPOST /v1/chat/completions, GET /v1/requests/{id}, GET /v1/usage
status:readGET /api/v1/status

Both the operation scope and the model entitlement/allowlist are enforced.

Environment variables

VariablePurpose
NINETWOS_API_KEYProject-scoped bearer token.
NINETWOS_BASE_URLCanonical API base URL: https://api.ninetwos.com/v1.
NINETWOS_MODELPublic model ID, currently zuv-0.5. Discover availability through /v1/models.

Authentication failures

All public errors use one coded envelope:

{
  "error": {
    "code": "invalid_key",
    "message": "API key is malformed or unknown."
  }
}

Common authentication/authorization codes include unauthenticated, invalid_key, credential_expired_or_revoked, scope_denied, model_not_authorized, organization_unavailable, and project_unavailable. See Errors and retries for retry classification.

Treat a key as compromised if it appears in logs or source control. Rotate it and update the server-side secret store; never embed it in client-side code.

On this page