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
| Scope | Operations |
|---|---|
models:read | GET /v1/models |
inference:chat | POST /v1/chat/completions, GET /v1/requests/{id}, GET /v1/usage |
status:read | GET /api/v1/status |
Both the operation scope and the model entitlement/allowlist are enforced.
Environment variables
| Variable | Purpose |
|---|---|
NINETWOS_API_KEY | Project-scoped bearer token. |
NINETWOS_BASE_URL | Canonical API base URL: https://api.ninetwos.com/v1. |
NINETWOS_MODEL | Public 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.