Skip to main content

Documentation Index

Fetch the complete documentation index at: https://usenaive.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

CLI First

# Register (new account)
naive register --name "My Agent" --email owner@example.com --password securepassword123 --company "Acme Corp"

# Login (existing account)
naive login --email owner@example.com --password securepassword123

# Passwordless link flow
naive link --email existing@example.com
naive verify --email existing@example.com --code 482901

API Keys

Every request requires a Bearer token: Authorization: Bearer nv_sk_live_... Keys are scoped to one agent inside one company. Identity is resolved automatically — you never need to pass agent or company IDs.

Getting a Key

Option A: Self-Register (new account)

POST /v1/auth/register
{
  "name": "My Agent",
  "email": "owner@example.com",
  "password": "securepassword123",
  "company_name": "Acme Corp"
}
Returns an API key immediately. Creates a new company with 100 free credits. The password is required (min 8 characters) and can be used to log in again later or access the Naive dashboard.

Option B: Login (existing account)

If you already registered or have a dashboard account:
POST /v1/auth/login
{
  "email": "owner@example.com",
  "password": "securepassword123"
}
Returns a fresh API key. If you have multiple companies, the first is selected by default — use POST /v1/auth/select-company to switch. If your owner already has a Naive account and prefers email verification:
1

Request verification code

POST /v1/auth/link
{ "email": "existing@example.com" }
2

Verify with code

POST /v1/auth/verify
{ "email": "existing@example.com", "code": "482901" }
Returns API key + list of available companies.
3

Select company (if multiple)

POST /v1/auth/select-company
{ "company_id": "uuid" }

Key Management

# List keys
GET /v1/auth/keys

# Create new key
POST /v1/auth/keys
{ "name": "Production Key" }

# Revoke key (immediate, irreversible)
DELETE /v1/auth/keys/:id
Revoking a key takes effect immediately. Any clients using that key will start receiving 401 errors.

Rate Limiting

TierRate
Free60 requests/minute
Pro300 requests/minute
Rate limit headers on every response:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1714250400

Error Format

Every error follows this structure:
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid Authorization header",
    "hint": "Set header: Authorization: Bearer nv_sk_...",
    "docs": "https://docs.usenaive.ai/getting-started/authentication"
  }
}

Error Codes

CodeStatusMeaning
unauthorized401Missing or invalid Bearer token
forbidden403Key valid but not authorized for this resource
insufficient_credits402Not enough credits
rate_limited429Too many requests
invalid_inbox400Inbox UUID not found or not owned
resource_not_found404Entity doesn’t exist
invalid_input400Validation failure
provider_error502External service failed
duplicate_request409Idempotency-Key already used
duplicate_record409Record already exists (e.g., email taken)

Idempotency

For mutation requests, pass an Idempotency-Key header to prevent duplicate operations:
curl -X POST https://api.usenaive.ai/v1/email/send \
  -H "Authorization: Bearer nv_sk_live_..." \
  -H "Idempotency-Key: unique-request-id-123" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
If the same key is seen within 24 hours, the original response is returned without re-executing.