Authentication
The API Gateway (api.timepointai.com) is the auth authority for the Timepoint ecosystem. It owns JWT issuance, OAuth provider integration, API key validation, and credit management. Backend services like Flash have auth disabled and trust identity headers from the Gateway.
Auth Schemes
Bearer JWT (End Users)
The Gateway issues JWTs via OAuth sign-in (Apple, Google, GitHub) and demo auth flows. Consumer apps send the JWT as a Bearer token to the Gateway, which validates it and proxies requests to backend services with anX-User-ID header.
API Keys (External Developers)
API keys are validated by the Gateway. They function like Bearer tokens for programmatic access:X-Service-Key (Service-to-Service)
Used for direct service-to-service calls between backend services. Service keys are configured per-service via environment variables.X-Admin-Key (Admin Operations)
Used for privileged admin operations on backend services. Admin keys are configured per-service via environment variables.OAuth Providers
The Gateway supports three OAuth providers for end-user authentication:| Provider | Flow | Notes |
|---|---|---|
| Apple Sign-In | OAuth 2.0 / OIDC | Primary auth for iOS apps |
| OAuth 2.0 | Web and cross-platform | |
| GitHub | OAuth 2.0 | Developer access |
/api/v1/auth/* endpoints, which issue Gateway JWTs upon successful authentication.
Public Access (No Auth)
The Clockchain public API requires no authentication:Gateway Proxy Pattern
When a consumer request hits the Gateway:- Client sends
Authorization: Bearer <jwt>toapi.timepointai.com - Gateway validates the JWT and extracts the user identity
- Gateway proxies the request to the appropriate backend service
- Backend services are internal only and not directly accessible to consumers
Gateway-Native Endpoints
These endpoints are handled directly by the Gateway (not proxied to any backend):| Path | Description |
|---|---|
/api/v1/auth/* | OAuth flows, JWT issuance, token refresh |
/api/v1/users/* | User profile management |
/api/v1/credits/* | Credit balance and usage |
/health | Gateway health check |