Authorization header:
Using an API key
Rotating or revoking keys
If a key is ever exposed you can disable or delete it from the portal and generate a new one immediately. Requests bearing a revoked key will receive a401 error.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
API Authentication & Headers
Authorization header:
Authorization: Bearer <SUDO_API_KEY>
fetch('https://sudoapp.dev/api/v1/chat/completions', {
method: 'POST',
headers: {
Authorization: 'Bearer <SUDO_API_KEY>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }],
}),
});
import requests, json
url = 'https://sudoapp.dev/api/v1/chat/completions'
headers = {
'Authorization': 'Bearer <SUDO_API_KEY>',
'Content-Type': 'application/json',
}
payload = {
'model': 'gpt-4o',
'messages': [{ 'role': 'user', 'content': 'Hello!' }],
}
r = requests.post(url, headers=headers, data=json.dumps(payload))
print(r.json())
curl https://sudoapp.dev/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SUDO_API_KEY" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello!"}]}'
401 error.
| Header | Example | Notes |
|---|---|---|
Authorization | Bearer sk-abc123 | Required |
Content-Type | application/json | Required |