API Keys

Use your account from other apps via REST API

Create new key

The key will be shown once — copy it immediately.

↑ Name দিন তারপর "Generate key" চাপুন

Your keys

How to use

Send the key in the X-API-Key header (or as Authorization: Bearer <key>). CORS is enabled for any origin.

# Get your profile (test the key) curl /api/v1/me \ -H "X-API-Key: kh_live_xxxxxxxx" # AI chat curl -X POST /api/v1/ai/chat \ -H "X-API-Key: kh_live_xxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"messages":[{"role":"user","content":"Hello!"}]}' # List your conversations curl /api/v1/conversations \ -H "X-API-Key: kh_live_xxxxxxxx" # Send a message curl -X POST /api/v1/conversations/<id>/messages \ -H "X-API-Key: kh_live_xxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"content":"Hi from another app"}'
All endpoints
  • GET /api/v1/me — your profile
  • GET /api/v1/profiles/:username — public profile
  • GET /api/v1/conversations — your chats
  • POST /api/v1/conversations — create direct/group
  • GET /api/v1/conversations/:id/messages — read messages
  • POST /api/v1/conversations/:id/messages — send a message
  • POST /api/v1/ai/chat — AI completions (Lovable AI)