s46.apiv1

s46 API

Production contract for s46 consumers: an org-scoped, invite-gated control plane plus a vendor-compatible model gateway.

Two base URLs

The control plane handles identity and configuration; the harness gateway handles model calls.

https://api.s46.dev

Auth, account, teams, sessions, admin, models, worker control.

https://gateway.s46.dev

OpenAI-, and Anthropic-compatible model calls.

Build in this order

#StepWhere
1Check status endpoints and wire JSON error handling.Operations
2Implement auth; store device-bound access and refresh credentials.Auth
3Read the current account, then resolve the selected team's metadata.Account · Teams
4Use the team's endpoint, defaultModel, and models to call the gateway.Gateway
5If the user is an org/team admin, expose admin and model-policy routes.Admin · Models
6If you are building infrastructure, implement the worker control protocol.Worker control

Core rules

  • The API is org-scoped. Teams use canonical @org/team identifiers, e.g. @s46/engineering.
  • User-facing clients use user-scoped bearer tokens from the invite-gated device flow.
  • Admin authorization accepts only owner and admin roles.
  • Membership roles are exactly owner, admin, member, and viewer.

Request conventions

Authenticated JSON endpoints expect a bearer token and JSON content negotiation:

Authorization: Bearer <accessToken>
Accept: application/json
Content-Type: application/json

Browser flows may instead use the HTTP-only s46_access / s46_refresh cookies returned when a login or refresh request sends X-S46-Use-Cookies: true.

Path parameters must be URL path-escaped. This matters for team IDs, emails, device IDs, worker/job/session IDs:

ValuePath segment
@s46/engineering%40s46%2Fengineering
dscape@s46.devdscape%40s46.dev
@dscape/auth-redirect-fix%40dscape%2Fauth-redirect-fix

Query parameters must be query-escaped, e.g. ?team=%40s46%2Fengineering.

Route groups

GroupPrefixStart here
Operations/healthz · /readyz · /debug/varsStatus and diagnostics
Auth/v1/auth · /deviceSign in and refresh
Account/v1/me · /v1/devicesUser and devices
Teams / sessions/v1/teams · /v1/sessionsTeam config and sessions
Admin/v1/adminOrgs, people, workers, jobs
Models/v1/admin/models · /v1/admin/model-policiesCertified models and policy
Worker control/v1/worker · /v1/internalRegister and lease jobs
Harness gatewaygateway.s46.devModel APIs

Error envelope

Every JSON failure uses the same shape. Branch on HTTP status plus error.code; never parse message for control flow.

{
  "error": {
    "code": "invalid_request",
    "message": "invalid request"
  }
}

See the full status and code catalog →

On this page