Magisterium API Early Access
Get up and running with the Magisterium API in a few minutes.
Create an API Key
Go to your API Console to create an API Key.
Set up your API Key
Configure your API key as an environment variable. This approach streamlines your API usage by eliminating the need to include your API key in each request. Moreover, it enhances security by minimizing the risk of inadvertently including your API key in your codebase.
In your terminal of choice:
export MAGISTERIUM_API_KEY=<your-api-key-here>
Or, in your project’s .env
file
MAGISTERIUM_API_KEY=<your-api-key-here>
Requesting your first chat completion
Execute this curl command in the terminal of your choice:
curl -X POST https://www.magisterium.com/api/v1/chat/completions \
-H "Authorization: Bearer $MAGISTERIUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mai-1",
"messages": [
{
"role": "user",
"content": "What is the Magisterium?"
}
]
}'