Learn how to authenticate with the MythicDot API using API keys. Secure your integration with best practices.
The MythicDot API uses API keys for authentication. Include your API key in the Authorization header of each request. Keep your API keys secure and never expose them in client-side code.
Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Full access to all API endpoints. Use only in secure server-side environments.
sk-...Scoped access to specific projects. Ideal for microservices and team separation.
sk-proj-...API keys should never be included in client-side code, public repositories, or browser requests. Always call the API from your backend server.
Sign up for a MythicDot account at mythicdot.ai/signup.
Navigate to the Dashboard and click on "API Keys" in the sidebar.
Click "Create new secret key" and give it a descriptive name like "production-server".
Copy your key immediately — you won't be able to see it again. Store it in a secure password manager or secrets vault.
import os from mythicdot import MythicDot # Recommended: Load from environment variable client = MythicDot(api_key=os.environ.get("MYTHICDOT_API_KEY")) # Or: The SDK automatically reads MYTHICDOT_API_KEY from env client = MythicDot() # Make a request response = client.chat.completions.create( model="mythic-4", messages=[{"role": "user", "content": "Hello!"}] )
curl https://api.mythicdot.ai/v1/chat/completions \ -H "Authorization: Bearer $MYTHICDOT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "mythic-4", "messages": [{"role": "user", "content": "Hello!"}] }'
import MythicDot from 'mythicdot'; // Automatically reads from MYTHICDOT_API_KEY env var const client = new MythicDot(); // Or explicitly pass the key const client = new MythicDot({ apiKey: process.env.MYTHICDOT_API_KEY });
The SDK recognizes these environment variables:
| Variable | Description |
|---|---|
MYTHICDOT_API_KEY |
Your API key (required) |
MYTHICDOT_ORG_ID |
Organization ID (optional, for multi-org accounts) |
MYTHICDOT_BASE_URL |
API base URL (optional, for testing) |
You can manage your API keys in the Dashboard: