Skip to main content

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​

  1. 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_user
    max_budget: 10
    budget_duration: 30d
    models: ["claude-haiku-5-5"]
    default_team_params:
    max_budget: 200
    budget_duration: 30d
    models: ["claude-haiku-5-5", "claude-sonnet-5-5"]
    max_internal_user_budget: 100
    internal_user_budget_duration: 30d

    To let people join some teams on their own from the Teams page, list those team ids under default_internal_user_params.available_teams, for example available_teams: ["team-support"].

    default_team_params fills in fields that a /team/new request does not set. Its models list only applies to teams created automatically from SSO groups.

  2. 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/new and then a link with POST /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.

  3. 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 with default_team_params, see team membership from SSO.

  4. 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/generate with 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"}'
  5. 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.

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"}'
MethodPathSummary
POST/invitation/newCreate an invitation link for a user
GET/invitation/infoGet an invitation link
POST/invitation/updateMark an invitation link accepted
POST/invitation/deleteRevoke 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​

SettingWhereEffect
default_internal_user_paramsspanway_settingsRole, budget, budget duration and models for new users.
default_internal_user_params.available_teamsspanway_settingsTeam 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_paramsspanway_settingsDefaults for new teams, including teams created from SSO groups.
max_internal_user_budgetspanway_settingsThe budget, in US dollars, a new internal_user gets when the request sends none. It is a default, not a ceiling.
internal_user_budget_durationspanway_settingsDefault budget reset period for users.
ui_access_modegeneral_settingsall lets every user sign in, admin_only restricts the UI to admins.
disable_password_login_when_sso_enabledgeneral_settingsRemoves the password login once SSO is configured.
password_policy_min_length, password_policy_require_*general_settingsPassword rules for invited users who sign in with a password.
require_mfa_for_password_logingeneral_settingsAsk every password sign-in for an authenticator code, see two-factor sign-in.
PROXY_BASE_URLenvironmentPublic URL used for SSO redirects and invitation links.
ALLOWED_EMAIL_DOMAINSenvironmentComma separated list of email domains allowed to sign in.
PROXY_ADMIN_IDenvironmentUser id that is promoted to proxy admin on SSO sign-in.
PROXY_LOGOUT_URLenvironmentWhere users go after signing out.
GENERIC_ROLE_MAPPINGS_ROLES, GENERIC_ROLE_MAPPINGS_GROUP_CLAIM, GENERIC_ROLE_MAPPINGS_DEFAULT_ROLEenvironmentMap identity provider groups to Spanway roles.
GENERIC_USER_ROLE_ATTRIBUTEenvironmentClaim that holds the role directly.
GOOGLE_*, MICROSOFT_*, GENERIC_*, SAML_*environmentIdentity provider connection, see Admin UI SSO.

Errors​

ErrorCauseFix
The invitation link opens the sign-in page instead of the onboarding formSSO 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 LoginThe 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 PasswordThe 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/newThe 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 allowedALLOWED_EMAIL_DOMAINS excludes the address.Add the domain, or invite with an allowed address.
New SSO users land in no teamThe 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 keysui_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.