Generate API Key
Now let's create a Cencori API key that your application will use to make requests.
Cencori uses prefixed API keys to help you identify their type:
| Prefix | Type | Use Case |
|---|---|---|
| csk_ | Secret | Server-side only, full access |
| cpk_ | Publishable | Browser-safe, domain-restricted |
| csk_test_ | Test | Development environment |
For this tutorial, we'll create a secret key for server-side use:
Go to API Keys
In your project sidebar, click API Keys
Click "Generate New Key"
Choose "Secret" as the key type
Copy the key immediately
It will only be shown once!
Copy your key now! For security, we only show the full key once. If you lose it, you'll need to generate a new one.
Save your key in a .env.local file:
Make sure .env.local is in your .gitignore!