Skip to main content
All API requests require authentication using a Bearer token in the Authorization header.

Getting an API Key

  1. Log in to Raccoon AI
  2. Click your profile picture in the top right
  3. Select Manage Account
  4. Go to API Keys
  5. Click Add new key
  6. Copy and securely store your API key
API keys are shown only once. If you lose your key, you’ll need to generate a new one.

Using Your API Key

Include your API key in the Authorization header of all requests:
Authorization: Bearer YOUR_API_KEY

Example Request

curl -X GET https://api.raccoonai.tech/chats \
  -H "Authorization: Bearer sk_live_abc123xyz"

WebSocket Authentication

For WebSocket connections, pass the token as a query parameter:
wss://api.raccoonai.tech/ws/chat/{taskId}?token=YOUR_API_KEY&message_id={messageId}&last_stream_entry_id=0-0

Authentication Errors

401 Unauthorized

Returned when the API key is missing or invalid:
{
  "error": "unauthorized",
  "message": "Invalid or missing API key"
}

403 Forbidden

Returned when the API key doesn’t have permission for the requested resource:
{
  "error": "forbidden",
  "message": "You don't have access to this resource"
}