Skip to main content

Authentication

All API requests require an API key passed as a Bearer token in the Authorization header.

API Key Format

Keys are prefixed with sd_ followed by 48 hex characters:

sd_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4

Using Your Key

Include it in every request:

curl -X POST https://developer-api.qomplement.com/v1/extract \
-H "Authorization: Bearer sd_YOUR_API_KEY" \
-F "file=@document.pdf"

Python

import requests

headers = {"Authorization": "Bearer sd_YOUR_API_KEY"}

response = requests.post(
"https://developer-api.qomplement.com/v1/extract",
headers=headers,
files={"file": open("document.pdf", "rb")},
)

JavaScript

const form = new FormData();
form.append("file", fs.createReadStream("document.pdf"));

const response = await fetch("https://developer-api.qomplement.com/v1/extract", {
method: "POST",
headers: { Authorization: "Bearer sd_YOUR_API_KEY" },
body: form,
});

Go

req, _ := http.NewRequest("POST", "https://developer-api.qomplement.com/v1/extract", body)
req.Header.Set("Authorization", "Bearer sd_YOUR_API_KEY")
req.Header.Set("Content-Type", writer.FormDataContentType())

resp, err := http.DefaultClient.Do(req)

Getting an API Key

  1. Sign in at developers.qomplement.com
  2. Navigate to API Keys from the sidebar
  3. Click Create API Key and give it a name
  4. Copy the key immediately — it's only shown once
caution

Your API key is displayed only once when created. Store it securely. If you lose it, you'll need to create a new one.

Security Best Practices

  • Never commit keys to version control — use environment variables
  • Don't expose keys in client-side code — make API calls from your backend
  • Rotate keys periodically — revoke old keys and create new ones
  • Use separate keys per environment — dev, staging, production
# Store in environment variable
export QOMPLEMENT_API_KEY="sd_your_key_here"

# Use in your code
curl -H "Authorization: Bearer $QOMPLEMENT_API_KEY" ...
# Python — load from environment
import os

API_KEY = os.environ["QOMPLEMENT_API_KEY"]
headers = {"Authorization": f"Bearer {API_KEY}"}
// Node.js — load from environment
const API_KEY = process.env.QOMPLEMENT_API_KEY;
const headers = { Authorization: `Bearer ${API_KEY}` };

Key Properties

Each API key has:

PropertyDescription
nameHuman-readable label
owner_emailEmail of the key owner
rate_limit_per_minuteMax requests per minute (default: 60)
monthly_request_limitMax requests per month (default: 10,000)
is_activeWhether the key is active
last_used_atTimestamp of last API call

Unauthorized Responses

If your key is missing, invalid, or revoked:

{
"detail": "Could not validate credentials"
}

HTTP Status: 401 Unauthorized or 403 Forbidden