Secure API access with bearer token authentication
POST /authAssuranceHub uses API keys to authenticate requests. You can manage your API keys in your dashboard and must include them in all API requests.
Security Notice
Never expose your API keys in client-side code, public repositories, or version control. Always use environment variables or secure key management services.
Sign in to your AssuranceHub dashboard
Navigate to dashboard.assurancehub.ai
Go to API Keys section
Click on "Settings" → "API Keys" in the sidebar
Generate a new API key
Click "Generate New Key" and give it a descriptive name
Copy and secure your key
Your key will only be shown once. Store it securely.
ash_test_••••••••••••••••••••••••••••••••API keys start with ash_ followed by environment (test/live) and unique identifier
Include your API key in the Authorization header as a Bearer token:
Authorization: Bearer ash_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAlternatively, you can use the X-API-Key header:
X-API-Key: ash_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxximport os
import requests
from typing import Dict, Any
# Store your API key securely
API_KEY = os.environ.get('ASSURANCEHUB_API_KEY')
API_BASE_URL = 'https://api.assurancehub.ai/v1'
class AssuranceHubClient:
def __init__(self, api_key: str):
self.api_key = api_key
self.headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
def test_bias(self, prompt: str, response: str) -> Dict[str, Any]:
"""Test for bias in AI responses"""
endpoint = f"{API_BASE_URL}/evaluate/bias"
payload = {
"prompt": prompt,
"response": response,
"customer_id": "your-customer-id"
}
response = requests.post(
endpoint,
json=payload,
headers=self.headers
)
if response.status_code == 401:
raise Exception("Invalid API key")
elif response.status_code == 429:
raise Exception("Rate limit exceeded")
return response.json()
# Example usage
client = AssuranceHubClient(API_KEY)
result = client.test_bias(
prompt="Tell me about successful entrepreneurs",
response="Most successful entrepreneurs are men..."
)const axios = require('axios');
// Store your API key securely
const API_KEY = process.env.ASSURANCEHUB_API_KEY;
const API_BASE_URL = 'https://api.assurancehub.ai/v1';
class AssuranceHubClient {
constructor(apiKey) {
this.apiKey = apiKey;
this.headers = {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
};
}
async testBias(prompt, response) {
const endpoint = `${API_BASE_URL}/evaluate/bias`;
try {
const result = await axios.post(endpoint, {
prompt: prompt,
response: response,
customer_id: 'your-customer-id'
}, {
headers: this.headers
});
return result.data;
} catch (error) {
if (error.response?.status === 401) {
throw new Error('Invalid API key');
} else if (error.response?.status === 429) {
throw new Error('Rate limit exceeded');
}
throw error;
}
}
}
// Example usage
const client = new AssuranceHubClient(API_KEY);
const result = await client.testBias(
"Tell me about successful entrepreneurs",
"Most successful entrepreneurs are men..."
);# Store your API key securely
export ASSURANCEHUB_API_KEY="your-api-key-here"
# Make an authenticated request
curl -X POST https://api.assurancehub.ai/v1/evaluate/bias \
-H "Authorization: Bearer $ASSURANCEHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Tell me about successful entrepreneurs",
"response": "Most successful entrepreneurs are men...",
"customer_id": "your-customer-id"
}'| Plan | Requests/Hour | Requests/Day | Burst Rate |
|---|---|---|---|
| Starter | 100 | 1,000 | 10/min |
| Professional | 1,000 | 10,000 | 50/min |
| Enterprise | 10,000+ | Unlimited | Custom |
Rate Limit Headers: We include rate limit information in response headers:
X-RateLimit-Limit - Your rate limitX-RateLimit-Remaining - Requests remainingX-RateLimit-Reset - Time when limit resets (Unix timestamp)Invalid or missing API key. Check your authentication headers.
Valid key but insufficient permissions for this resource.
Rate limit exceeded. Check rate limit headers for reset time.