Authentication
Secure your RubikChat API requests with Bearer Token Authentication.
Introduction
All RubikChat API requests are secured using Bearer Token Authentication.
Before making any API request, you must generate an API Key from your RubikChat workspace and include it in the Authorization header of every request.
Note
Bearer Token Authentication
RubikChat uses Bearer Tokens to authenticate API requests.
Include your API Key in the Authorization header as shown below:
Authorization: Bearer YOUR_API_KEYEvery authenticated request must include this header.
Generate an API Key
- Sign in to your RubikChat Dashboard.
- Navigate to Top Right Corner of Your Dashboard (Profile area) → Settings → API Access Token.
- Click Generate Token.
- Copy and securely store the generated API Access Token.
Warning
Security Best Practices
Your API Key provides access to your RubikChat workspace and AI Agents. To keep your account secure, follow these best practices:
- Never expose API Keys in frontend applications.
- Never commit API Keys to public Git repositories.
- Store API Keys securely using environment variables or a secrets manager.
- Rotate API Keys periodically for improved security.
- Immediately revoke and regenerate any API Key that may have been compromised.
Warning
Example Authentication Request
The following example demonstrates how to authenticate while sending a chat request.
curl -X POST 'https://api-proxy-v1.rubikchat.com/api/v1/chat' \
-H 'Authorization: Bearer YOUR-API-ACCESS-TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"message":"Hello!"
}'If authentication is successful, the API will process your request and return the appropriate response.
Invalid or Missing Authentication
If the API Key is missing, invalid, or expired, RubikChat returns an authentication error. Example response:
{
"error": "Route not found"
}404 Not FoundRate Limiting
To ensure platform stability and fair usage, RubikChat enforces rate limits on API requests.
Rate limits are applied per API Key and may also consider the originating IP address.
Note
Authentication Workflow
The authentication process follows these steps:
- Generate an API Key from the RubikChat Profile → Account Settings.
- Store the API Access Token securely on your server.
- Include the API Access Token as a Bearer Token in every API request.
- RubikChat validates the API Access Token before processing the request.
- If the API Access Token is valid, the requested operation is executed; otherwise, an authentication error is returned.