Every request to the ShuttleAI API requires a valid API key. Keys are prefixed with shuttle- and sent as a Bearer token in the Authorization header.
Getting your API key
Log in to the ShuttleAI Dashboard
Navigate to API Keys
Copy your master key, or create a sub-key for specific use cases
Never share your API key or commit it to version control. Treat it like a password.
Using your key
Include your API key in the Authorization header of every request:
Authorization: Bearer shuttle-xxxxxxxxxxxxx
With the OpenAI SDK
from openai import OpenAI
client = OpenAI(
api_key = "shuttle-xxx" ,
base_url = "https://api.shuttleai.com/v1"
)
With cURL
curl https://api.shuttleai.com/v1/chat/completions \
-H "Authorization: Bearer shuttle-xxx" \
-H "Content-Type: application/json" \
-d '{"model": "shuttleai/auto", "messages": [{"role": "user", "content": "Hi"}]}'
Environment variables
Store your key in an environment variable to keep it out of your code:
Linux / macOS
Windows (PowerShell)
Windows (CMD)
export SHUTTLEAI_API_KEY = "shuttle-xxx"
Then reference it in your code:
import os
from openai import OpenAI
client = OpenAI(
api_key = os.environ[ "SHUTTLEAI_API_KEY" ],
base_url = "https://api.shuttleai.com/v1"
)
Sub-keys
Sub-keys let you create scoped API keys for different applications or team members. You can create up to 10 sub-keys per account.
Manage sub-keys from the API Keys page in the dashboard. Each sub-key can be individually renamed or revoked without affecting your master key.
See API Keys for a full guide on managing your keys.