Enterprise
Spanway is commercially licensed. The gateway runs without a license, and a license key enables the enterprise features listed on this page. Licenses are signed tokens that the gateway verifies offline against a public key bundled with Spanway. There is no license server, nothing is sent to Spanway at startup, and air-gapped deployments work the same way as connected ones. To obtain a license, contact sales@spanway.ai.
A real-world scenario
A gateway runs with a license that lists evals and compliance. The finance team now wants invoices, so the operator gets a reissued key that also lists billing. They replace the key, restart, and confirm that billing is in allowed_features before telling finance the Billing page is ready.
Steps
-
Put the new key in
SPANWAY_LICENSEon every gateway container and restart them, as shown in Set the license key. -
Confirm the features with the API.
curl http://localhost:4000/health/license -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -
In the Admin UI, open the account menu at the bottom of the left sidebar and check that Tier reads Enterprise. Then open the page the feature belongs to, for example Billing, which no longer shows the license notice.
-
Call one route of the feature to be sure the server agrees.
curl http://localhost:4000/billing/account/list -H "Authorization: Bearer $SPANWAY_MASTER_KEY"
Expected result
allowed_features lists billing (or *), the Billing page loads without a notice, and the route answers 200 instead of 403.
Set the license key
Put the key in the SPANWAY_LICENSE environment variable of every gateway container, or in the environment_variables block of config.yaml. The same image runs every tier, so adding the key is the whole upgrade from Starter.
export SPANWAY_LICENSE="<your license key>"
docker run -p 4000:4000 -v "$PWD/config.yaml:/app/config.yaml" \
-e SPANWAY_MASTER_KEY -e SPANWAY_LICENSE \
registry.spanway.ai/spanway/spanway-ai:2.0.0 --config /app/config.yaml
environment_variables:
SPANWAY_LICENSE: os.environ/SPANWAY_LICENSE
The license is an RS256 signed token issued by Spanway. It carries the licensee, an expiry date, the list of licensed features (* for all features), and optional limits on the number of users and teams. An invalid, tampered or expired key is treated as no license, and the gateway keeps running with enterprise features disabled. A key that expires while the gateway runs stops granting its features from the day after its last valid day, and an hourly re-check turns the remaining Enterprise switches off without a restart. The key itself is never logged.
The key can also be set as general_settings.spanway_license in the config file or the database. It is unset by default, and once a config load reads it, it replaces the value of SPANWAY_LICENSE. Keep it in one place, the environment variable in a secret is the safer choice because the config file is often in version control.
Cloud marketplace listings on AWS, Azure and Google Cloud are planned and not available yet. Once a listing ships, a gateway installed from it will read its features from the marketplace entitlement instead and need no license key.
Verify the license
curl http://localhost:4000/health/license -H "Authorization: Bearer $SPANWAY_API_KEY"
{
"has_license": true,
"license_type": "enterprise",
"expiration_date": "2027-03-31",
"allowed_features": ["*"],
"limits": {"max_users": 250, "max_teams": 40}
}
has_license is true whenever a key or a marketplace entitlement is configured, even an invalid or expired one, so read license_type to know whether the license is active. It is enterprise with an active license and starter without one, and an invalid or expired key answers starter with an empty allowed_features list. While it is starter, enterprise routes return 403 with a message that names the feature and explains how to set SPANWAY_LICENSE. The Admin UI shows the same status in the account menu.
Feature names
A license lists the features it grants by name, or * for every feature. When the license is valid but does not list the feature a route needs, the route returns 403 with a message that names the missing feature, for example Your Spanway license does not include the 'billing' feature. Features outside this table, such as SSO and audit logs, only need a valid license.
| Feature name | What it unlocks |
|---|---|
access_requests | Every /access_request route |
admin_mcp | The hosted admin MCP server at /admin/mcp and the native Admin Assistant for Slack connect flow. Without it the mount does not start, every request to it is refused and the Slack connect page answers 403 |
agent_governance | Agent governance: identity provider binding, per-session limits, required trace ids, the kill switch, and agent runs in the run ledger |
agent_server_tools | Server tools such as web fetch inside custom agents. Server tools on chat completions need no license |
auto_router | More than one auto router per routing capability, instead of one |
billing | Every /billing route |
cloud | The /cloud routes |
code_graph | Every /code_graph route and the spanway_code MCP server of the code graph |
compliance | Every /compliance route except evidence exports, and the data subject control in compliance reports |
compliance_evidence | Compliance evidence exports and scheduled evidence generation |
custom_agents | Every /v1/custom_agents route and invoking a custom agent over A2A |
custom_roles | Every /role route |
environments | Every /v1/environments route to export, plan, approve and apply environment promotion bundles |
evals | Every /eval route, including schedules and red teaming, and the scheduled eval runs themselves |
guardrails | Setting guardrails, policies or disable_global_guardrails on keys, teams, organizations and projects, requests that use them, and dynamic guardrail extra_body params |
human_approval | Every /v1/approvals route for human approval policies and decisions. Policies that already exist stay enforced without it |
ip_allowlist | general_settings.allowed_ips and setting allowed_ips on keys, teams, organizations and projects |
key_controls | Setting tags or team_member_key_duration on keys, teams, organizations and projects |
key_hygiene | Every /key/hygiene route, the unused key auto-expiry job, the maximum key lifetime (gateway wide and per organization) and the key expiry emails |
organization_sso | Every /organization/sso route, organization sign-in from the login page and organization-scoped SCIM tokens |
passthrough_routes | Setting allowed_passthrough_routes or denied_passthrough_routes on keys and teams, which is how a non-admin key is granted a custom pass-through route that requires a key. Organizations and projects refuse both fields |
scoped_integrations | Setting logging, prompts or secret_manager_settings on keys, teams, organizations and projects |
spend_reports | The spend report endpoints /global/spend/report, /key/spend/report, /user/spend/report, /team/spend/report and /organization/spend/report |
workflow_definitions | Every /v1/workflows/definitions route, for saved workflow definitions. Running a definition also needs workflow_runner |
workflow_history | The workflow runner's step attempt history, re-run from a step and pinned test data. It also needs workflow_runner |
workflow_queue_workers | Running workflow runner steps on dedicated workers, with the producer and worker roles and --workflow_worker. It also needs workflow_runner |
workflow_retries | Workflow runner retry policies, total step timeouts, on failure alerts and compensating runs, and the dead letter routes. The runner checks it again before it schedules or runs each retry, so a run whose licence lost it fails its step with feature_unlicensed instead of retrying. It also needs workflow_runner |
workflow_runner | Every /v1/workflows/runner route, the background workflow runner and the workflow runs storage routes under /v1/workflows/runs |
workflow_subworkflows | Workflow runner steps that call a saved workflow definition, and saving a definition version with such a step. The runner checks it again before each spawn, so a run tree stops spawning children with feature_unlicensed once the licence loses it. It also needs workflow_runner |
workflow_templates | Every /v1/workflow_templates route, to install workflow templates. Templates also need custom_agents and workflow_definitions, and running one needs workflow_runner |
workflow_triggers | Every /v1/triggers route and the background workflow trigger jobs. Triggers also need workflow_runner |
workload_identity | The /v1/workload-identity/token route that trades a trusted OIDC token for a short-lived virtual key, see workload identity federation |
These fields need the feature whether they are sent as top-level request fields or inside metadata. Saving a record again with a value it already stores, or with an empty value, needs no license, so an existing record stays editable after a license change.
An allowed_ips list already stored on a key, team or organization keeps being enforced when the license lapses or drops ip_allowlist, so a license change never opens access. A gateway with general_settings.allowed_ips set refuses to start without the feature. Stored guardrails and policies make requests fail with 403 until the license lists guardrails again, rather than running without them.
Background jobs follow the same rule. Saved eval schedules stop firing and scheduled evidence generation stops when the license no longer lists their feature, and they resume once it does.
Licenses that list features by name must use the names in this table. A license issued with other names, such as sso or audit_logs, still counts as a valid license but grants none of the features above, so reissue it with * or with the names from this table.
The agent registry itself stays free. Registering agents, their A2A agent cards, invoking registered agents over A2A through the gateway, enabling and disabling them, their overall rpm_limit and tpm_limit and their spend work without a license.
What the license enables
| Feature | Guide |
|---|---|
| Custom roles with a permission catalogue | Custom roles |
| Developer portal access requests | Access requests |
| Compliance controls, retention, residency and data subject requests | Compliance |
| Billing accounts, invoices and Stripe collection | Billing |
| Evals that compare models on your datasets | Evals |
| Red teaming a model for vulnerabilities | Red teaming |
| Hosted cloud edition with self-serve tenants and plans | Cloud |
| SCIM provisioning, IP allow-list, control plane and hosted admin MCP | SCIM, allow-lists, control plane, admin MCP server |
| Single sign-on for more than 5 users | Admin UI SSO |
| JWT auth and JWT key mappings | JWT auth |
| Regenerating virtual keys and scheduled key rotation | Scheduled key rotation |
| Organizations above teams | User hierarchy |
| Audit logs of management actions | On by default on a licensed gateway, set spanway_settings.store_audit_logs: true to keep it on if the license lapses, read with GET /audit |
| Your own logo, support contact and footer in notification emails (the emails themselves are free) | |
| Enforced request parameters | See below |
| Spend reports by team, tag and customer | See below |
| API explorer branding and filtering | See below |
Enforce required params for LLM requests
enforced_params makes the gateway reject inference requests that do not carry certain fields, which guarantees that every request can be attributed. Nested fields use dot notation.
general_settings:
enforced_params:
- user
- metadata.generation_name
The list can also be set per key in the key's metadata.enforced_params, and for service account keys through general_settings.service_account_settings.enforced_params. The lists add up. Dot notation supports one level of nesting, such as metadata.generation_name. A request missing a field is rejected with a message such as BadRequest please pass param=user in request body. This is a required param. Without a license, setting enforced params makes requests fail with an error that says the feature needs an enterprise license.
Spend tracking
Every request is costed and attributed to its key, user, team, organization, end user and tags. A license that includes spend_reports adds the spend report endpoints that aggregate this spend for chargeback.
curl "http://localhost:4000/global/spend/report?start_date=2026-09-01&end_date=2026-09-30&group_by=team" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
group_by accepts team, customer and api_key. GET /global/spend/tags reports spend per request tag, which lets you track cost per feature or project by sending x-spanway-tags or metadata.tags. The Usage page in the Admin UI charts the same data per team, organization, user, key, tag and customer. See cost tracking for how cost is calculated.
Swagger docs - custom routes and branding
Every gateway serves an interactive API explorer at / and the OpenAPI document at /openapi.json to signed-in users, and answers 404 to everyone else, see API docs and build details. With a license you can brand and trim them for your developers.
| Variable | Effect |
|---|---|
DOCS_TITLE | Title shown in the explorer. |
DOCS_DESCRIPTION | Description shown under the title. |
DOCS_FILTERED | Set to True to show only the OpenAI-compatible inference routes and hide management routes. |
DOCS_URL | Serve the explorer at another path. Works without a license. |
NO_DOCS | Turn the explorer off. Works without a license. |
License limits
If a license sets max_users or max_teams, the gateway refuses to create the user or team that would go past the limit, so a license for 50 users allows exactly 50 billable users. /health/license reports the limits under limits, and the seat usage card in the Admin UI shows how many are in use. Contact sales@spanway.ai to change your limits.
Errors
| Status | Message | Meaning and fix |
|---|---|---|
| 403 | Your Spanway license does not include the '<feature>' feature. Contact sales@spanway.ai to add it. | The license is valid but lacks that feature. With no license at all the message is The '<feature>' feature needs a Spanway enterprise license. You must be a Spanway Enterprise user to use this feature.... Reissue it with the name from the table above, or with *. |
| 403 | A message that names the feature and explains how to set SPANWAY_LICENSE | No valid license reached the gateway. Check the variable inside the container. |
| 403 | License is over limit. Please contact https://spanway.ai/support to upgrade your license. | Creating this user or team would go past max_users or max_teams. Bulk user creation answers the same text as a problem of type license-limit-exceeded. Remove unused users or teams, or ask for a higher limit. |
| 400 | Assigning team admins is a premium feature. You must be a Spanway Enterprise user to use this feature. ... | Giving a team member the admin role needs a license. Add the member with the user role, or add a license. |
| 403 | You must be a Spanway Enterprise user to use SSO for more than 5 users. ... | SSO is configured without a license and more than 5 billable users exist. Add a license or unset the SSO settings. |
| 400 | BadRequest please pass param=<field> in request body. This is a required param | enforced_params requires that field. Send it. |
| Startup fails | general_settings.allowed_ips is set and the license lacks ip_allowlist | Remove the setting or add the feature. |
Logs
| Level | Line | Meaning |
|---|---|---|
| INFO | License configured=<true or false> valid=<true or false> expires=<date> features=<n> fingerprint=<fingerprint> | Written at startup, on a config load and on the hourly re-check. Normal. configured=true valid=false means the key is invalid or expired, so check it. The key is never logged. |
| WARNING | License validity changed: valid=<true or false> | The hourly re-check found that the license became valid or stopped being valid, for example on its expiry day. Renew the key when it says false. |
| ERROR | Cannot load the license public key from <path>: <error> or License public key at <path> is not an RSA key | The image's bundled public key cannot be read, so no license can be verified. Use an unmodified image. |
| DEBUG | License rejected. error_type=<type> | Why the last key failed verification, such as ExpiredSignatureError. Turn on debug logging to see it. |
| ERROR | PREMIUM FEATURE: Reserving tpm/rpm by priority is a premium feature. ... | A request asked for priority reservation without a valid license, so the reservation is skipped. Add a license or drop the priority. |
Related
- Spanway Enterprise for what the license adds at a glance.
- Error reference for every license refusal.
- Health checks for
/health/licenseand the other health routes.