Authentication
The CompactifAI API uses API keys for authentication. This guide will walk you through the process of obtaining and using your API key.
How to Get Started
Section titled “How to Get Started”The CompactifAI API is currently available exclusively through the AWS Marketplace. Follow these steps to get started:
1. Subscribe via AWS Marketplace
Section titled “1. Subscribe via AWS Marketplace”- Go to our AWS Marketplace listing.
- Review the product details, pricing information, and terms of service.
- To begin the subscription process:
- Click “View purchase options” to explore available plans.
- Choose your preferred subscription plan (at the moment, we only offer a pay-as-you-go plan).
- Click “Subscribe” at the bottom of the page.
- Proceed to “Set up your account” to finalize your registration.
- Complete the registration form with the required details.
- Submit the form and await a confirmation email from our team.
2. Complete Subscription Verification & Access the Dashboard
Section titled “2. Complete Subscription Verification & Access the Dashboard”Once you’ve submitted your subscription:
- Our team will review your application, typically within 24 hours.
- Upon approval, you’ll receive a welcome email containing instructions for MultiverseIAM access.
- This email will include a unique login link to MultiverseIAM.
- Click the link and use your subscription email address to log in.
- You will then receive a one-time passcode (OTP) via email. Enter this OTP to complete the login.
- After successful login, you’ll be redirected to the MultiverseIAM Dashboard.
3. Accessing and Managing Your API Key from the Dashboard
Section titled “3. Accessing and Managing Your API Key from the Dashboard”From the MultiverseIAM dashboard, you can:
- View and copy your API key.
- Rotate your API key. You can achieve this by clicking the “Refresh Token” button which appears on the welcome page of the MultiverseIAM dashboard.
Usage Example
Section titled “Usage Example”You must include your API key in the Authorization
header of each API request using the Bearer token scheme:
Authorization: Bearer YOUR_API_KEY
Example Request
Section titled “Example Request”curl https://api.compactif.ai/v1/chat/completions \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_KEY" \-d '{ "model": "cai-llama-3-1-8b-slim", "messages": [ {"role": "user", "content": "Hello!"} ]}'
import requests
api_key = "YOUR_API_KEY"url = "https://api.compactif.ai/v1/chat/completions"
headers = { "Content-Type": "application/json", "Authorization": f"Bearer {api_key}"}
# API request payloaddata = { "model": "cai-llama-3-1-8b-slim", "messages": [ {"role": "user", "content": "Hello!"} ]}
response = requests.post(url, headers=headers, json=data)print(response.json())
async function callCompactifAI() {const response = await fetch('https://api.compactif.ai/v1/chat/completions', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY' }, body: JSON.stringify({ model: 'cai-llama-3-1-8b-slim', messages: [ {role: 'user', content: 'Hello!'} ] })});
const data = await response.json();console.log(data);}
callCompactifAI();