Keys are stored in our D1 database - they persist forever across deployments. Add custom instructions and knowledge to shape your bot's behavior.
Key Management
POST/api/keys/generate
Create a permanent API key with instructions and knowledge.
Request Body
{
"name": "My Bot",
"instructions": "Be helpful and concise",
"knowledge": "Our products: Widget A ($10), Widget B ($20)",
"rateLimit": 30
}
POST/api/keys/updateAuth
Update instructions, knowledge, name, or rate limit of your key.
curl
curl -X POST YOUR_DOMAIN/api/keys/update \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"instructions": "Updated instructions",
"knowledge": "New facts and data for the bot"
}'
Chat API v1
POST/api/v1/chatAuth
Chat with organized answers. Instructions + knowledge are auto-applied. Returns structured response with sections.
curl
curl -X POST YOUR_DOMAIN/api/v1/chat \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"message":"What is quantum computing?"}'