Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.medera.info/llms.txt

Use this file to discover all available pages before exploring further.

Option 1 — Clerk JWT (end-user)

End-user sign-in is handled by Clerk on the frontend. After sign-in, the Clerk JWT is automatically attached to every request the frontend makes.
import { useAuth } from '@clerk/clerk-react';

const { getToken } = useAuth();
const token = await getToken();

const res = await fetch('https://api.medera.ai/api/patients', {
  headers: { 'Authorization': `Bearer ${token}` },
});

Option 2 — Developer API Key (server-to-server)

For backend integrations and batch jobs, use a Developer API Key created in the Console under Settings → Developer API Keys.
curl https://api.medera.ai/api/agent-workflows \
  -H "X-API-Key: $MEDERA_API_KEY"
API keys support the following scopes:
ScopeAllows
read:dataRead non-PHI resources (workflows, deployments, templates)
write:dataCreate / update non-PHI resources
execute:agentsTrigger agent / workflow executions
read:phiRead PHI (patients, sessions) — requires active BAA
write:phiWrite PHI — requires active BAA
adminAdmin operations (separate issuer)

Option 3 — Internal service-to-service

The AI Services (port 8000) and backend (port 3001) communicate using a tenant-scoped X-Service-Key header. This is for internal use; do not expose to clients.

SDK setup

import { MederaClient } from '@medera/sdk';

const client = new MederaClient({
  apiKey: process.env.MEDERA_API_KEY!,
  // or:
  // accessToken: clerkJwt,
});
from medera import MederaClient

client = MederaClient(api_key=os.environ["MEDERA_API_KEY"])