---
name: ainative-provisioning
description: AINative auto-provisioning flow for new users. Use when explaining setup, debugging login issues, or working on the onboarding experience.
---

# AINative Auto-Provisioning

## How It Works

On `npm install -g @ainative/cody-cli`, users are automatically provisioned with:
- A temporary API key for immediate use
- A ZeroDB project for vector storage and memory
- A claim URL to convert to a permanent account

**No signup. No auth. No credit card.** Users can run `cody` immediately.

## User Flow

1. Install: `npm i -g @ainative/cody-cli`
2. Run: `cody` — works immediately with temporary key
3. Upgrade: `cody login` — converts to permanent account with `sk_` API key
4. Claim: Visit the claim URL to link the project to their AINative account

## API Endpoint

```
POST https://api.ainative.studio/api/v1/public/instant-db
Content-Type: application/json

{ "agree_terms": true, "on_behalf_of": "cody-cli" }
```

Returns: API key, project ID, claim URL, expiration, and usage limits.

## After Login

`cody login` replaces the temporary key with a permanent `sk_` prefixed key tied to the user's account. All existing data (vectors, memory) transfers automatically.

## Troubleshooting

- If provisioning fails, the CLI still works — user can run `cody login` manually
- Network issues during install are handled silently (never blocks npm install)
- Expired temporary keys are refreshed on next `cody` launch
