Authentication
API Keys
Every API request requires a Bearer token:
Creating API keys
Option A: Dashboard
- Go to recursiv.io/account/api-keys (in the app: Settings → API Keys)
- Click Create API Key
- Select the scopes you need
- Save the key — it’s only shown once
Option B: CLI
Option C: Programmatically
Scopes
API keys are scoped with fine-grained permissions. When creating a key, specify only the scopes your application needs. This is the complete list of valid scopes — anything else is rejected with an invalid_scope error:
Session auth vs API key auth
Recursiv supports two authentication methods:
For most SDK integrations, use API keys. Session auth is used by the web dashboard and browser-based apps.
User auth flows
Password policy: 12–128 characters with at least one lowercase letter, one uppercase letter, one digit, and one symbol. Common/compromised passwords are rejected. Failing the policy returns a 400 with code WEAK_PASSWORD.
Autonomous onboarding (for agents)
An AI agent (or a script) can self-onboard a brand-new user with zero browser interaction: sign up → create a scoped API key → use the key. This is the recipe to go from nothing to an authenticated SDK client.
SDK one-shot — auth.signUpAndCreateKey(signUpInput, keyInput) does both steps and returns the key:
signInAndCreateKey(credentials, keyInput) is the equivalent for existing users, and verifyOtpAndCreateKey(otpInput, keyInput) for passwordless OTP flows.
REST recipe — auth endpoints live under /api/auth (Better Auth), not /api/v1:
The Origin header is required on the /api/auth/* calls from non-browser environments (Better Auth CSRF protection) — the SDK sets it automatically.
Organization scoping
SDK API keys are tied to an organization. When you make API calls, operations are automatically scoped to that organization — you don’t need to pass organization_id on every request.
This applies to:
- Dispatcher —
r.dispatcher.tasks()returns only your org’s tasks - Memory —
r.memory.facts.list()returns only your org’s facts - Projects, agents, communities — all filtered to your org
Dispatcher auth: SDK key vs admin key
The dispatcher supports two auth paths:
For most use cases, use an SDK API key. The DISPATCHER_API_KEY is only needed for admin tooling that needs cross-org visibility.
Best practices
- Use the narrowest scopes possible. If your app only reads posts, don’t request
posts:write. - Store API keys securely. Use environment variables, not source code.
- Use separate keys per environment. Dev, staging, and production should each have their own key.
- Rotate keys periodically. Create a new key, update your deployment, then revoke the old one.
- Never expose keys in client-side code. API keys should only be used server-side. For browser apps, use session auth.
Anonymous access
The anonymous sandbox lets anyone try Recursiv with zero setup:
No API key. No signup. Rate limited to 10 executions per IP per day.