Self-serve onboarding
Self-serve onboarding lets developers get access to the gateway without filing a ticket. They sign in to the Admin UI with SSO or an invitation link, are created as internal users with default settings, land in the right teams, and create their own keys within the limits you set. Admins keep control through defaults, team membership and budgets rather than by approving each key.
When you would use this
Forty developers join over a quarter. Instead of creating a key for each, you set defaults that give every new user a 10 dollar monthly budget and one model, connect SSO so that the identity provider's groups put each person in the right team, and let them create their own keys. A developer who needs more asks for it with an access request, and the team admin approves it in the Admin UI.
Before you start
Decide the defaults for new users and teams, below. For SSO, follow Admin UI SSO first. For invitation links without SSO, set PROXY_BASE_URL to the public URL of the gateway so the links point at it, and configure email if you want the gateway to send them.
Step by step
-
Set the defaults. Add them to the config, or open Internal Users and edit the Default User Settings tab, and Teams and edit the Default Team Settings tab.
spanway_settings:default_internal_user_params:user_role: internal_usermax_budget: 10budget_duration: 30dmodels: ["claude-haiku-5-5"]default_team_params:max_budget: 200budget_duration: 30dmodels: ["claude-haiku-5-5", "claude-sonnet-5-5"]max_internal_user_budget: 100internal_user_budget_duration: 30dTo let people join some teams on their own from the Teams page, list those team ids under
default_internal_user_params.available_teams, for exampleavailable_teams: ["team-support"].default_team_paramsfills in fields that a/team/newrequest does not set. Itsmodelslist only applies to teams created automatically from SSO groups. -
Invite a person. In the Admin UI open Internal Users, click + Invite User, type the User Email, pick the Global Proxy Role and a Team, and click Invite User. The Invitation Link dialog shows the link to copy, and the gateway emails it when Send invitation email is ticked and email is configured. Over the API create the user with
/user/newand then a link withPOST /invitation/new.curl -X POST http://localhost:4000/invitation/new \-H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \-d '{"user_id": "user-123"}'{"id": "inv-5c2d","user_id": "user-123","is_accepted": false,"accepted_at": null,"expires_at": "2026-11-28T09:00:00Z","created_at": "2026-11-21T09:00:00Z","created_by": "admin","updated_at": "2026-11-21T09:00:00Z","updated_by": "admin"}The link is
<PROXY_BASE_URL>/ui/onboarding?invitation_id=inv-5c2d. It expires exactly seven days after it was created, to the second. -
The person signs in. On the link they set their own password, or with SSO they sign in through the identity provider for the first time. The gateway creates the internal user with the role, budget and models from
default_internal_user_params. If the identity provider sends group claims, the user is added to the matching teams, and teams that do not exist yet can be created automatically withdefault_team_params, see team membership from SSO. -
The person creates a key. They open Virtual Keys, click + Create New Key, pick their Team and a Key Name, and click Create Key. Each key is limited by the user's budget and the team's models. Over the API that is
/key/generatewith their own session or key.curl -X POST http://localhost:4000/key/generate \-H "Authorization: Bearer $MEMBER_KEY" -H "Content-Type: application/json" \-d '{"team_id": "team-ds", "key_alias": "my-experiments"}' -
They ask for more when they need it. Enterprise deployments let them file an access request from Access Requests with + New Request, which a team admin or proxy admin approves. Without it, users ask an admin to update their team or key.
What you should see
The new user appears on Internal Users with the default role and budget, and in the teams their groups map to. The invitation shows "Pending, expires" in the dialog until it is used and "Accepted" after. The user's first key appears on Virtual Keys under their user id and team, and GET /key/info on it shows the team's models and the user's budget as its limits.
Invitation links
Proxy admins, organization admins and team admins create a link with /invitation/new, read it with /invitation/info and revoke it with /invitation/delete. An admin viewer can read links but not create or delete them. Finishing sign-up on /ui/onboarding marks the link accepted on the gateway through /onboarding/claim_token, so nobody needs to call anything else. A proxy admin can also mark a link accepted by hand with /invitation/update. In the Admin UI, invite a user from Internal Users and copy the link it shows. Generate new link revokes the old one and makes a new one, and Revoke link stops it at once. Invitation links are part of the free gateway.
curl -X POST http://localhost:4000/invitation/update \
-H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \
-d '{"invitation_id": "inv-5c2d", "is_accepted": true}'
curl -X POST http://localhost:4000/invitation/delete \
-H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \
-d '{"invitation_id": "inv-5c2d"}'
| Method | Path | Summary |
|---|---|---|
| POST | /invitation/new | Create an invitation link for a user |
| GET | /invitation/info | Get an invitation link |
| POST | /invitation/update | Mark an invitation link accepted |
| POST | /invitation/delete | Revoke an invitation link |
A link names the invited user and the admin who created it, so erasing either person deletes it. Expired links are kept until maximum_invitation_retention_period deletes them, counted from when they expired.
All settings for self-serve and SSO flow
| Setting | Where | Effect |
|---|---|---|
default_internal_user_params | spanway_settings | Role, budget, budget duration and models for new users. |
default_internal_user_params.available_teams | spanway_settings | Team ids people may join on their own from the Teams page. A team in the list shows under Available Teams, and joining adds the person as a plain member without any budget or model settings. A team not in the list can only be joined when a team admin adds the person. Unset means no team is open for self-service. Set it in the config file, the Admin UI has no control for it. |
default_team_params | spanway_settings | Defaults for new teams, including teams created from SSO groups. |
max_internal_user_budget | spanway_settings | The budget, in US dollars, a new internal_user gets when the request sends none. It is a default, not a ceiling. |
internal_user_budget_duration | spanway_settings | Default budget reset period for users. |
ui_access_mode | general_settings | all lets every user sign in, admin_only restricts the UI to admins. |
disable_password_login_when_sso_enabled | general_settings | Removes the password login once SSO is configured. |
password_policy_min_length, password_policy_require_* | general_settings | Password rules for invited users who sign in with a password. |
require_mfa_for_password_login | general_settings | Ask every password sign-in for an authenticator code, see two-factor sign-in. |
PROXY_BASE_URL | environment | Public URL used for SSO redirects and invitation links. |
ALLOWED_EMAIL_DOMAINS | environment | Comma separated list of email domains allowed to sign in. |
PROXY_ADMIN_ID | environment | User id that is promoted to proxy admin on SSO sign-in. |
PROXY_LOGOUT_URL | environment | Where users go after signing out. |
GENERIC_ROLE_MAPPINGS_ROLES, GENERIC_ROLE_MAPPINGS_GROUP_CLAIM, GENERIC_ROLE_MAPPINGS_DEFAULT_ROLE | environment | Map identity provider groups to Spanway roles. |
GENERIC_USER_ROLE_ATTRIBUTE | environment | Claim that holds the role directly. |
GOOGLE_*, MICROSOFT_*, GENERIC_*, SAML_* | environment | Identity provider connection, see Admin UI SSO. |
Errors
| Error | Cause | Fix |
|---|---|---|
| The invitation link opens the sign-in page instead of the onboarding form | SSO is enabled, so invitations do not create a stored link. | The user signs in through SSO. The invite only creates the user. |
| The onboarding page shows "Failed to load invitation" and "The invitation link may be invalid or expired." with Back to Login | The gateway answered 401 with Invitation link has expired. (older than seven days), Invitation link does not exist in db. (revoked or mistyped), Invitation link has already been used. or User does not exist in db. | Click Generate new link in the dialog, or call /invitation/new again. |
| An error under the password after Sign Up or Reset Password | The gateway refused the password or the claim, for example a password that breaks the password policy, one found in a breach list, Invalid onboarding session for invitation link. when the page was opened from another link, or 500 Failed to create onboarding session. Please retry the invitation link. | Pick a password that meets the policy, or open the link again. |
403 on /invitation/new | The caller is an admin viewer or an internal user. | Use a proxy admin, organization admin or team admin. |
400 You can only create invitations for users in your organization or team. | An organization or team admin invited a user outside their scope. | Add the user to your organization or team first, or ask a proxy admin. |
400 saying the email domain is not allowed | ALLOWED_EMAIL_DOMAINS excludes the address. | Add the domain, or invite with an allowed address. |
| New SSO users land in no team | The identity provider sends no group claim, or the claim name is not configured. | Set the group claim as team membership from SSO describes. |
| New users cannot create keys | ui_access_mode is admin_only, or the team's member permissions do not allow /key/generate. | Set ui_access_mode: all, and allow the route as team member permissions describes. |
Related
- Users for roles and user budgets.
- Team budgets and access control for keeping self-serve keys inside team limits.
- Access requests for letting users ask for more.
- Admin UI SSO and team membership from SSO for the identity provider side.
- Internal Users page for the invite dialog and link controls.