Skip to main content

Projects

A project is a smaller box inside a team. A team usually owns several applications, and the team budget only tells you what the team as a whole spent. A project gives one application, or one use case, its own budget, its own list of models and its own per-model rate limits, while it still lives inside the team and never gets more than the team allows. Keys are put into a project, and every request made with those keys counts against the project. Projects are an enterprise feature. Reading projects works on every gateway, and creating, changing or deleting one needs a Spanway license.

When you would use this​

The support team runs two things through the gateway, a customer facing chat assistant and an internal ticket summarizer. Both use the team's keys, so when the team budget runs out nobody knows which of the two spent it. You create a project called support-bot with a 100 dollar monthly budget and only the cheap model, move the assistant's keys into it, and give the summarizer its own project. From then on each application has its own spend, its own cap and its own model list, and the team budget still caps both together.

Before you start​

You need a team to put the project in, and a Spanway license to create or edit projects. The Projects page shows in the Admin UI only after a proxy admin turns it on. Open Settings, then Admin Settings, open the UI Settings tab, switch on [BETA] Enable Projects (page will refresh) and save. The page then appears under ACCESS CONTROL in the left nav for admins, organization admins and team admins, and the key form gains a Project field.

Step by step​

  1. Create the project. In the Admin UI open Projects and click Create Project. Fill in Project Name (support-bot), pick the Team, add a Description, choose the Allowed Models (scoped to selected team's models) and set Max Budget (USD). Under Advanced Settings you can add Model-Specific Limits, Guardrails and Metadata. Click Create Project. The same call over the API is POST /project/new.

    curl -X POST http://localhost:4000/project/new \
    -H "Authorization: Bearer $SPANWAY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "team_id": "team-support",
    "project_alias": "support-bot",
    "description": "Chat assistant for the support desk",
    "models": ["claude-haiku-5-5"],
    "max_budget": 100,
    "budget_duration": "30d"
    }'
    {
    "project_id": "proj-support-bot",
    "project_alias": "support-bot",
    "description": "Chat assistant for the support desk",
    "team_id": "team-support",
    "budget_id": "budget-4b7e",
    "models": ["claude-haiku-5-5"],
    "spend": 0.0,
    "blocked": false,
    "created_by": "admin",
    "created_at": "2026-11-01T09:00:00Z",
    "updated_at": "2026-11-01T09:00:00Z",
    "spanway_budget_table": {"budget_id": "budget-4b7e", "max_budget": 100.0, "budget_duration": "30d"}
    }
  2. Put keys into the project. In the Admin UI open Virtual Keys, click Create New Key, pick the Project in the ownership section, and the team and model list follow the project. Over the API pass project_id on /key/generate. An existing key moves with /key/update and the same field.

    curl -X POST http://localhost:4000/key/generate \
    -H "Authorization: Bearer $SPANWAY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"team_id": "team-support", "project_id": "proj-support-bot", "key_alias": "support-bot-prod"}'
  3. Watch the spend. Open Projects and click the project ID. The Budget card shows the spend against the budget with a meter, and the Keys card lists the keys in the project. The gateway does not break project spend down by model yet, so the Spend by Model card says so, and the Usage page shows spend per model for the project's keys. Over the API read GET /project/info.

    curl "http://localhost:4000/project/info?project_id=proj-support-bot" \
    -H "Authorization: Bearer $SPANWAY_API_KEY"
  4. Change the limits. Click Edit Project on the detail view, change Max Budget (USD) or add a row under Model-Specific Limits, and click Save Changes. Over the API send only the fields you want to change to POST /project/update. An omitted field keeps its value, null for max_budget removes the cap, and {} for a per-model quota map removes it.

    curl -X POST http://localhost:4000/project/update \
    -H "Authorization: Bearer $SPANWAY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"project_id": "proj-support-bot", "max_budget": 250, "model_rpm_limit": {"claude-haiku-5-5": 60}}'
  5. Remove a project you no longer need. Detach or delete the project's keys first, because a project with keys is not deleted. Then, as a proxy admin, click the trash icon on the project's row in Projects, or Delete Project on its detail view, and confirm with Delete. Over the API call DELETE /project/delete.

    curl -X DELETE http://localhost:4000/project/delete \
    -H "Authorization: Bearer $SPANWAY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"project_ids": ["proj-support-bot"]}'

What you should see​

The project appears in the Projects list with its team, a badge with the number of allowed models and an Active badge. Requests made with a key in the project succeed for models on the project's list and are refused for others. When the project's spend reaches max_budget, requests from its keys fail with a budget exceeded error until the budget resets, while the rest of the team keeps working. GET /project/list returns every project a proxy admin can see, and for everyone else the projects of their own teams and of every team in an organization they administer.

Fields​

FieldMeaning
team_idThe team that owns the project. Its models and budget bound the project's. Required on create.
project_alias, descriptionA readable name and what the project is for.
modelsModels keys in the project may call. Must be a subset of the team's models.
max_budget, soft_budget, budget_durationThe project budget in US dollars, an alert level and how often spend resets. The budget cannot exceed the team's.
tpm_limit, rpm_limit, tpd_limitStored on the project's budget row and refused when they are above the team's value. The gateway does not enforce them per project yet, so use the per-model limits below to cap a project's traffic.
max_parallel_requests, model_max_budget, allowed_models, temp_budget_increase, temp_budget_expiryAccepted because the request reuses the budget model, and stored on the project's budget row, but not enforced for projects. Set them on the team or the keys instead.
model_rpm_limit, model_tpm_limit, model_itpm_limit, model_otpm_limitPer-model request, token, input token and output token limits per minute. A request over one is refused with 429. When general_settings.enforce_project_model_quota is true (default false), every model on the project must have a positive model_rpm_limit and model_tpm_limit.
guardrails, tags, policiesApplied to every request from the project's keys. Guardrails need the guardrails license feature.
blockedRefuse every request from keys in the project.
metadataFree form, for example a cost center. Merged over the stored value on update, so a key you leave out keeps its stored value.
object_permissionVector stores, MCP servers and agents the project may use.

Who can do what​

RoleProjects
Proxy adminSees every project, creates projects in any team, edits and deletes any project.
Admin viewerSees every project and cannot change them.
Organization adminSees the projects of their own teams and of every team in their organizations.
Team adminSees the projects of their teams. Creates and edits projects in those teams only when general_settings.team_admin_editable_team_fields contains projects, which the Admin UI sets with Create and update projects on the UI Settings tab of Admin Settings.
Team memberSees the projects of their teams.

Errors​

Project routes answer errors in the OpenAI error shape, for example {"error": {"message": "Project not found, project_id=proj-x", "type": "not_found_error", "param": null, "code": "404"}}.

ErrorCauseFix
403 Projects are an enterprise feature.The gateway has no Spanway license and you tried to create, update or delete a project.Add a license. Reading projects works without one.
403 You don't have access to this projectYou are not a member or admin of the project's team or an admin of its organization.Ask the team admin, or use a proxy admin key.
403 Only proxy admins can delete projects.A team admin called /project/delete.Use a proxy admin key.
404 Team not found, team_id=... or Project not found, project_id=...The id does not exist.Check the id with /team/list or /project/list.
400 with a model nameA model in models is not on the team's list.Add the model to the team first with /team/model/add, or remove it from the project.
400 max_budget above the team budget, negative, or soft_budget not below max_budgetThe budget is outside what the team allows.Lower the project budget or raise the team budget.
400 Project ... has N key(s) that do not belong to team ...You moved the project to another team while its keys belong to the old team.Move or delete those keys first.
400 Project ... has N attached key(s).You deleted a project that still has keys.Delete the keys or move them to another project.
403 You do not have permission to create projects. Only proxy admins, or admins of the project's team once 'projects' is enabled under team_admin_editable_team_fields, can do this. (also update this project or move projects into this team)The caller is not a proxy admin, or is a team admin on a gateway that has not opened projects to team admins.Ask a proxy admin, or add projects to team_admin_editable_team_fields.
400 Project tpm_limit (...) exceeds team's tpm_limit (...). Team: ... (also rpm_limit, tpd_limit and max_budget)A project value is higher than its team's.Lower the project value or raise the team's.
400 allowed_passthrough_routes and denied_passthrough_routes only apply to keys and teams, so a project cannot carry them.The request carried pass-through route lists.Set them on the team or the keys instead.
500 DB not connected. ...The gateway runs without a database.Set DATABASE_URL.
401 containing Project=<id> is blocked. Update via /project/update if you're an admin.A model request used a key on a blocked project.Turn Block Project off, or send "blocked": false to /project/update.
422 Budget has been exceeded! Project=<id> Current cost: ..., Max budget: ...The project's spend reached max_budget. The status is 429 when spanway_settings.budget_exceeded_status_code is 429.Raise the budget or wait for the reset.
400 about a missing RPM or TPM limitgeneral_settings.enforce_project_model_quota is on and a model has no positive limits, or the list contains an entry that expands at request time such as a wildcard or an access group.Give every model a positive model_rpm_limit and model_tpm_limit, and list models by name.

Logs​

Every refused project call is logged at ERROR level as Exception: <message> with a stack trace, so an expected 400 or 403 also shows up as an error in the gateway log. Nothing needs doing when the caller got the answer you expected. Look into a 500, which usually means the database is unreachable. Blocked projects and project budget refusals are logged with the request, like every other refused model call. See the log reference.

Audit​

Creating, updating, blocking, unblocking, moving and deleting a project each write a row on Spanway_ProjectTable with the project before and after, see audit logs. Filter the Audit Logs tab on Table = Projects.