Getting started

Authentication

Every request must carry a secret key in the Authorization header. Keys are created in the portal and shown only once — Dheep stores a SHA-256 hash.

Header format

text
Authorization: Bearer dheep_sk_xxxxxxxxxxxxxxxxxxxx

Examples

curl
curl https://api.dheep.co.za/v1/chat/completions \
  -H "Authorization: Bearer $DHEEP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"dheep-chat","messages":[{"role":"user","content":"Ping"}]}'
node.js
const response = await fetch("https://api.dheep.co.za/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.DHEEP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "dheep-chat",
    messages: [{ role: "user", content: "Ping" }],
  }),
});

const data = await response.json();
python
import os, requests

response = requests.post(
    "https://api.dheep.co.za/v1/chat/completions",
    headers={"Authorization": f"Bearer {os.environ['DHEEP_API_KEY']}"},
    json={"model": "dheep-chat", "messages": [{"role": "user", "content": "Ping"}]},
    timeout=30,
)
print(response.json())

Key hygiene

  • Use one key per environment so you can revoke a single deployment.
  • Store keys in environment variables or a secret manager, never in a repository.
  • Never call the API from a browser or mobile client — proxy through your own backend.
  • Regenerate immediately if a key is exposed; the previous secret stops working at once.

A leaked key allows anyone to spend against your token allowance. Disable it from the API keys page before investigating.