Overview
CheckThat AI supports two authentication methods depending on which endpoint you’re using:- API Key in Request Body - For
/chatendpoint - Bearer Token Authentication - For
/v1/chat/completionsendpoint
API Key Authentication
For the/chat endpoint, include your LLM provider’s API key directly in the request body.
Request Format
Your LLM provider’s API key (OpenAI, Anthropic, etc.)
Example Request
Provider-Specific Keys
Depending on the model you’re using, provide the appropriate API key:Free Models (No API Key Required)
Some models don’t require an API key as they’re provided through Together AI:meta-llama/Llama-3.3-70B-Instruct-Turbo-Freedeepseek-ai/DeepSeek-R1-Distill-Llama-70B-free
Bearer Token Authentication
The/v1/chat/completions endpoint uses Bearer token authentication following OpenAI’s standard.
Request Format
Include your API key in theAuthorization header:
Example Request
Using with OpenAI SDK
The Bearer token approach is compatible with OpenAI SDKs:CheckThat AI API Keys
For CheckThat AI-specific features like claim refinement, you may need to provide acheckthat_api_key:
The
checkthat_api_key is used for the refinement model, which may be different from your primary model’s API key.Authentication Errors
Missing API Key
Status Code:401 Unauthorized
Authorization header with a valid Bearer token.
Invalid API Key
Status Code:401 Unauthorized or 403 Forbidden
Expired Token (Supabase JWT)
If using Supabase authentication for restricted endpoints: Status Code:401 Unauthorized
Environment Variables
When running CheckThat AI locally or self-hosting, configure these environment variables:Guest Mode
CheckThat AI can run in “guest mode” when Supabase authentication is not configured:- Supabase JWT authentication is disabled
- API key authentication still works for LLM providers
- Rate limiting is applied to all requests
Security Best Practices
Keep API Keys Secure
Keep API Keys Secure
- Never commit API keys to version control
- Use environment variables or secret management systems
- Rotate keys regularly
- Use separate keys for development and production
Use HTTPS
Use HTTPS
- Always use HTTPS for API requests
- The production API enforces HTTPS connections
- Never send API keys over unencrypted connections
Implement Rate Limiting
Implement Rate Limiting
- Respect rate limits to avoid service disruption
- Implement exponential backoff for retries
- Monitor your API usage
Validate Input
Validate Input
- Sanitize user input before sending to the API
- Implement input validation on the client side
- Handle API errors gracefully
Testing Authentication
Test your authentication setup:Next Steps
Chat Endpoint
Use the /chat endpoint for claim normalization
Chat Completions
Use OpenAI-compatible completions API