Skip to main content

Authentication

Octomil uses three authentication mechanisms: API keys for server-to-server calls, device tokens for on-device SDKs, and JWT-based sessions for the dashboard.

API Keys

API keys authenticate control-plane requests (model management, rollouts, federation operations). Keys are scoped to an organization and carry permission scopes.

Creating keys

octomil api-keys create --name "ci-pipeline" --scopes models:read,models:write,rollouts:write

Scopes

ScopeAccess
models:readList and retrieve models and versions
models:writeCreate models, upload versions
devices:readList and retrieve devices
devices:writeRegister devices, manage groups
rollouts:writeCreate and delete rollouts
federations:adminFull federation management
training:writeStart rounds, configure strategies
experiments:writeCreate and manage experiments

Using keys

curl https://api.octomil.com/api/v1/models \
-H "Authorization: Bearer edg_live_your_key_here"

Keys are prefixed edg_live_ (production) or edg_test_ (sandbox).

Device Tokens

Device tokens authenticate mobile and edge devices. The lifecycle is: bootstrap, refresh, revoke.

Bootstrap flow

  1. Device calls POST /api/v1/devices/register with a bootstrap token (embedded in the app binary or fetched from your backend).
  2. Server returns a device-specific API key and a refresh token.
  3. SDK stores the key in the platform keychain (iOS Keychain, Android Keystore).
let client = OctomilClient(bootstrapToken: "edg_bootstrap_...")
try await client.register(deviceId: UIDevice.current.identifierForVendor!.uuidString)
// Key stored in iOS Keychain automatically

Token refresh

Tokens expire after 24 hours by default. SDKs handle refresh automatically using the refresh token. Configure expiry via the dashboard or CLI:

octomil org settings --device-token-expiry 48h

Revocation

Revoke a device token to immediately block a device from participating in training or receiving model updates:

octomil devices revoke <device-id>

RBAC

Octomil uses three organization roles.

RolePermissions
OwnerFull access. Billing, member management, delete org.
AdminManage models, devices, rollouts, experiments. Cannot delete org or manage billing.
MemberRead-only access to models and devices. Can submit training updates.

Assigning roles

octomil org members add user@example.com --role admin
octomil org members update user@example.com --role member

Compliance presets and MFA

HIPAA and PCI presets enforce MFA for all users. GDPR and SOC 2 presets enforce MFA for admins only. See Compliance for details.

Rate Limits

SurfaceLimit
Control plane (per device)100 req/min
Inference (per key)1000 req/min
Device registration10 req/min per IP

Rate-limited responses return 429 with a Retry-After header.