PAI

PersonalAI Platform

PAI

Developers

Connect any platform to PersonalAI

Use PAI as a single gateway for auth, events, and assistant. Every platform shares the same user context and consent rules, while usage is metered by tenant for billing.

Self-serve platform keys

Platform creators can generate a tenant and service key here. The key is shown once, so store it securely.

Platform ownership is tied to your signed-in email address.

1. Register a client

Create an OAuth client for your platform from the developer console or API.

POST /api/console/clients
Authorization: Bearer <PAI_JWT>
{
  "name": "Acme Careers",
  "client_id": "acme-careers",
  "redirect_uris": ["https://careers.acme.com/auth/callback"],
  "scopes": ["openid", "profile", "email"]
}

2. OAuth login

Use Authorization Code + PKCE to log users in.

GET /oauth/authorize?response_type=code&client_id=acme-careers
  &redirect_uri=https://careers.acme.com/auth/callback
  &scope=openid%20profile%20email
  &state=STATE&code_challenge=PKCE&code_challenge_method=S256

3. Exchange token

Exchange the code for tokens server-side.

POST /oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code
code=CODE
redirect_uri=https://careers.acme.com/auth/callback
client_id=acme-careers
code_verifier=PKCE_VERIFIER

4. Send events

Log activity so PAI can build recommendations.

POST /api/events
x-service-key: <SERVICE_INGEST_KEY>
x-user-id: <PAI_USER_ID>
x-tenant-id: acme-careers
x-platform: acme-careers

{ "source": "acme-careers", "verb": "search", "props": { "query": "backend" } }

5. Get recommendations

Use email activity or authenticated user context.

GET /api/suggest/email?value=user@email.com
x-service-key: <SERVICE_INGEST_KEY>

6. Read memories

Use the memory graph for personalization.

GET /api/memories?limit=25
Authorization: Bearer <PAI_JWT>

Required headers

  • x-tenant-id identifies the platform for billing and usage.
  • x-platform tags events for cross-platform insight.
  • x-service-key enables server-to-server ingestion.
  • Authorization: Bearer for user-scoped requests.