POST /api/v1/api-keys

Authentication

Bearer Token API Key (cookie: better-auth.session_token)

Request Body

application/json
name string
type string
Enum: live, publishable
project_id string
allowed_domains string[]
Array of:

Responses

201 API key created (plaintext returned only once)
application/json
id string REQUIRED
key string REQUIRED
prefix string REQUIRED
name string REQUIRED
type string REQUIRED
Enum: live, publishable
project_id string | null REQUIRED
allowed_domains string[] REQUIRED
Array of:
curl -X POST 'https://littledemo.com/api/v1/api-keys' \  -H 'Authorization: Bearer YOUR_API_TOKEN' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "type": "live",  "project_id": "string",  "allowed_domains": [    "string"  ]}'
const response = await fetch('https://littledemo.com/api/v1/api-keys', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN",      "Content-Type": "application/json"  },  body: JSON.stringify({    "name": "string",    "type": "live",    "project_id": "string",    "allowed_domains": [      "string"    ]  })});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://littledemo.com/api/v1/api-keys', headers=headers, json={  "name": "string",  "type": "live",  "project_id": "string",  "allowed_domains": [    "string"  ]})print(response.json())
201 Response
{  "id": "<string>",  "key": "<string>",  "prefix": "<string>",  "name": "<string>",  "type": "live",  "project_id": "<string>",  "allowed_domains": [    "<string>"  ]}
Ask a question... ⌘I