API Reference
Compass APIs are based on REST APIs that can be accessed through HTTPS requests using JSON objects.
Authentication
Compass uses an API key for authentication. To create the API key, see Manage API Keys section
How to Make Requests?
To make the requests, you need to create an API key, subscribe to Compass APIs, and then associate the API with the Compass API resources by assigning resources to it. See the Products page for available models and contact the Compass team to purchase them.
With the API key and required budget or tokens, you can authenticate and start using the API keys by sending the requests.
From the Products page, click Playground to start using the models and send the requests by providing the API Key in the Configuration Section.
Alternatively, you can pass the Authorization in the header using the format, Authorization: Bearer Your_API_KEY
using Postman or from any similar application.
Authentication through Authorization Headers
Users can authenticate the authorization headers as shown in the below example when sending request from Azure OpenAI or OpenAI:
Azure OpenAI
Include a valid API key in the api-key
header of the request.
curl --location 'https://api.core42.ai/openai/deployments/gpt-4o/chat/completions?api-version=2023-05-15' \
--header 'api-key: Your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"stream": false,
"messages": [
{
"role": "user",
"content": "what is national sport of UAE"
}]
}'
OpenAI
Include a valid API key in the authorization header of the request.
curl --location 'https://api.core42.ai/v1/chat/completions' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-4o",
"stream": false,
"messages": [
{
"role": "user",
"content": "what is national sport of UAE"
}]
}'