Documentation /docs/authentication-api-keys

Authentication & API Keys

Every public Docspeed customer API request uses bearer auth:

Authorization: Bearer YOUR_DOCSPEED_API_KEY

What to send

  • Send the bearer header on every public customer API request, including POST /api/v1/*, POST /v1/*, and GET /v1/*.
  • Use the same hosted API key across upload, parse, OCR, layout, tables, schema builder, extract, Ask, Compare, Synthesize, agents, and jobs.
  • Store keys in a server-side secret manager, not source control or browser code.
  • Rotate keys by issuing a replacement key, updating your secret manager, validating traffic with the new key, and revoking the old key.

API keys and playground sign-in

Playground sign-in is for the hosted browser evaluation surface. Production integrations should call the API from your backend using a Docspeed API key.

Do not copy playground session credentials into production code. If you need a production API key, create or request one for the target workspace/environment and keep it server-side.

Server-side proxy pattern

Customer-facing applications should call your own backend first. Your backend can then attach the Docspeed bearer token and forward only the document operation your app supports.

browser/mobile app -> your backend -> Docspeed API

This keeps the API key out of browser bundles, logs, and mobile app binaries.

Missing or invalid auth

Requests without a valid key return 401 Unauthorized.

{
  "detail": "Missing bearer token"
}

Invalid keys also return 401. Rate-limited keys return 429 and may include a Retry-After header.

  • Local development: environment variables
  • CI/CD: your deployment secret manager
  • Customer-facing apps: backend proxy or server-side token injection

cURL

curl -sS "https://api.docspeed.ai/v1/files/file_123" \
  -H "Authorization: Bearer ${DOCSPEED_API_KEY}"

Python

import os
import requests

response = requests.get(
    "https://api.docspeed.ai/v1/files/file_123",
    headers={"Authorization": f"Bearer {os.environ['DOCSPEED_API_KEY']}"},
    timeout=60,
)
print(response.status_code, response.json())

TypeScript

const response = await fetch("https://api.docspeed.ai/v1/files/file_123", {
  headers: { Authorization: `Bearer ${process.env.DOCSPEED_API_KEY}` },
});

console.log(response.status, await response.json());