Skip to main content

Project management API

This page documents the 5 gateway endpoints tagged project management in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
POST/project/newCreate a project in a team
POST/project/updateUpdate a project
DELETE/project/deleteDelete projects
GET/project/infoGet a project with its budget
GET/project/listList projects

Endpoints​

POST /project/new​

Create a project in a team

Create a project under a team. Enterprise feature.

What to send:

  • team_id: The team that owns the project. Its models and budget caps bound the project's.
  • project_id: Supply your own id, otherwise one is generated.
  • project_alias: Human readable name.
  • description: What the project is for.
  • models: Models keys on this project may call. Must be a subset of the team's models.
  • max_budget / soft_budget / tpm_limit / rpm_limit / budget_duration - Project budget, stored on a budget row.
  • budget_id: Link an existing budget instead of creating one.
  • model_rpm_limit, model_tpm_limit, model_itpm_limit, model_otpm_limit: Per-model quotas, kept in metadata.
  • metadata: Free-form metadata such as a cost center or use-case id.
  • guardrails, tags, policies: Folded into metadata like teams and keys.
  • blocked: Block every key on the project.
  • object_permission: Vector stores, MCP servers and agents the project may use.

Example:

curl --location 'http://localhost:4000/project/new' \
--header "Authorization: Bearer $SPANWAY_MASTER_KEY" \
--header 'Content-Type: application/json' \
--data '{"team_id": "team-1", "project_alias": "support-bot", "models": ["gpt-5.5"], "max_budget": 100}'

Request body (application/json, schema NewProjectRequest):

FieldTypeRequiredDescription
budget_idstring or nullNoBudget Id
soft_budgetnumber or nullNoSoft Budget
max_budgetnumber or nullNoMax Budget
max_parallel_requestsinteger or nullNoMax Parallel Requests
tpm_limitinteger or nullNoTpm Limit
rpm_limitinteger or nullNoRpm Limit
tpd_limitinteger or nullNoTpd Limit
model_max_budgetobject or nullNoModel Max Budget
budget_durationstring or nullNoBudget Duration
allowed_modelsarray of string or nullNoAllowed Models
temp_budget_increasenumber or nullNoTemp Budget Increase
temp_budget_expirystring or nullNoTemp Budget Expiry
project_idstring or nullNoProject Id
project_aliasstring or nullNoProject Alias
descriptionstring or nullNoDescription
team_idstringYesTeam Id
metadataobject or nullNoMetadata
tagsarray of string or nullNoTags
guardrailsarray of string or nullNoGuardrails
policiesarray of string or nullNoPolicies
modelsarray of stringNoModels
model_rpm_limitobject or nullNoModel Rpm Limit
model_tpm_limitobject or nullNoModel Tpm Limit
model_itpm_limitobject or nullNoModel Itpm Limit
model_otpm_limitobject or nullNoModel Otpm Limit
blockedbooleanNoBlocked
object_permissionSpanway_ObjectPermissionBase or nullNo

Example request:

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"
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json NewProjectResponse
400A model, budget or limit breaks the team's caps, or the request carries a field projects cannot holdapplication/json ProxyError
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller may not change projects on this team, or the gateway has no Enterprise licenseapplication/json ProxyError
404No team has that team_idapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
project_idstringYesProject Id
project_aliasstring or nullNoA readable name for the project
descriptionstring or nullNoWhat the project is for
team_idstring or nullNoThe team the project belongs to
budget_idstring or nullNoThe id of the project's budget
metadataobject or nullNoFree-form labels for the project
modelsarray of stringNoModels the project's keys may call, within the team's models
spendnumberNoWhat the project has spent, in USD
model_spendobject or nullNoSpend per model, in USD
model_rpm_limitobject or nullNoMost requests per minute per model
model_tpm_limitobject or nullNoMost tokens per minute per model
blockedbooleanNoTrue when every request made with the project's keys is refused
object_permission_idstring or nullNoObject Permission Id
created_bystring or nullNoCreated By
updated_bystring or nullNoUpdated By
created_atstringYesCreated At
updated_atstringYesUpdated At
spanway_budget_tableSpanway_BudgetTable or nullNoThe project's budget, when it has one
object_permissionSpanway_ObjectPermissionTable or nullNo

POST /project/update​

Update a project

Update a project's settings, budget or limits, or move it to another team. Omitted fields keep their stored value, so clear a per-model quota by sending an empty map. Proxy admins may call it, and admins of the project's team once 'projects' is enabled under team_admin_editable_team_fields.

What to send:

  • project_id: The project to update.
  • team_id: Move the project to another team. Refused while keys on the project belong to a different team.
  • project_alias / description / models / blocked - As on /project/new.
  • max_budget / soft_budget / tpm_limit / rpm_limit / budget_duration - Send null for max_budget to remove the cap.
  • model_rpm_limit, model_tpm_limit, model_itpm_limit, model_otpm_limit: Replace a per-model quota map, {} removes it.
  • metadata: Merged over the stored metadata.
  • guardrails, tags, policies: Folded into metadata like teams and keys, [] clears one.
  • object_permission: Merged over the stored object permission.

Example:

curl --location 'http://localhost:4000/project/update' \
--header "Authorization: Bearer $SPANWAY_MASTER_KEY" \
--header 'Content-Type: application/json' \
--data '{"project_id": "project-123", "max_budget": 250, "model_rpm_limit": {"gpt-5.5": 60}}'

Request body (application/json, schema UpdateProjectRequest):

FieldTypeRequiredDescription
budget_idstring or nullNoBudget Id
soft_budgetnumber or nullNoSoft Budget
max_budgetnumber or nullNoMax Budget
max_parallel_requestsinteger or nullNoMax Parallel Requests
tpm_limitinteger or nullNoTpm Limit
rpm_limitinteger or nullNoRpm Limit
tpd_limitinteger or nullNoTpd Limit
model_max_budgetobject or nullNoModel Max Budget
budget_durationstring or nullNoBudget Duration
allowed_modelsarray of string or nullNoAllowed Models
temp_budget_increasenumber or nullNoTemp Budget Increase
temp_budget_expirystring or nullNoTemp Budget Expiry
project_idstringYesProject Id
project_aliasstring or nullNoProject Alias
descriptionstring or nullNoDescription
team_idstring or nullNoTeam Id
metadataobject or nullNoMetadata
tagsarray of string or nullNoTags
guardrailsarray of string or nullNoGuardrails
policiesarray of string or nullNoPolicies
modelsarray of string or nullNoModels
model_rpm_limitobject or nullNoModel Rpm Limit
model_tpm_limitobject or nullNoModel Tpm Limit
model_itpm_limitobject or nullNoModel Itpm Limit
model_otpm_limitobject or nullNoModel Otpm Limit
blockedboolean or nullNoBlocked
object_permissionSpanway_ObjectPermissionBase or nullNo

Example request:

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
}
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_ProjectTable
400A limit breaks the team's caps, or the project still has keys on another teamapplication/json ProxyError
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller may not change projects on this team, or the gateway has no Enterprise licenseapplication/json ProxyError
404No project has that project_idapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
project_idstringYesThe project's unique id
project_aliasstring or nullNoA readable name for the project
descriptionstring or nullNoWhat the project is for
team_idstring or nullNoThe team the project belongs to
budget_idstring or nullNoThe id of the project's budget
metadataobject or nullNoFree-form labels for the project
modelsarray of stringNoModels the project's keys may call, within the team's models
spendnumberNoWhat the project has spent, in USD
model_spendobject or nullNoSpend per model, in USD
model_rpm_limitobject or nullNoMost requests per minute per model
model_tpm_limitobject or nullNoMost tokens per minute per model
blockedbooleanNoTrue when every request made with the project's keys is refused
object_permission_idstring or nullNoObject Permission Id
created_bystring or nullNoCreated By
updated_bystring or nullNoUpdated By
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At
spanway_budget_tableSpanway_BudgetTable or nullNoThe project's budget, when it has one
object_permissionSpanway_ObjectPermissionTable or nullNo

DELETE /project/delete​

Delete projects

Delete projects. Proxy admin only, and it needs an Enterprise license. A project that still has keys attached is refused and nothing is deleted. The answer lists the deleted projects.

What to send:

  • project_ids: The projects to delete.

Example:

curl --location --request DELETE 'http://localhost:4000/project/delete' \
--header "Authorization: Bearer $SPANWAY_MASTER_KEY" \
--header 'Content-Type: application/json' \
--data '{"project_ids": ["project-123"]}'

Request body (application/json, schema DeleteProjectRequest):

FieldTypeRequiredDescription
project_idsarray of stringYesProject Ids

Example request:

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"
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json array of Spanway_ProjectTable
400The project still has keys attached, so nothing was deletedapplication/json ProxyError
401No valid key or Admin UI session was presentedapplication/json ProxyError
403Only proxy admins delete projects, on a licensed gatewayapplication/json ProxyError
404No project has that project_idapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ProxyError

GET /project/info​

Get a project with its budget

Get a project with its budget. Visible to proxy admins, members and admins of its team, and admins of the team's organization.

Example:

curl --location 'http://localhost:4000/project/info?project_id=project-123' \
--header "Authorization: Bearer $SPANWAY_MASTER_KEY"

Parameters:

NameInTypeRequiredDescription
project_idquerystringYes

Example request:

curl -X GET "http://localhost:4000/project/info?project_id=project_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_ProjectTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller cannot see this project's teamapplication/json ProxyError
404No project has that project_idapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
project_idstringYesThe project's unique id
project_aliasstring or nullNoA readable name for the project
descriptionstring or nullNoWhat the project is for
team_idstring or nullNoThe team the project belongs to
budget_idstring or nullNoThe id of the project's budget
metadataobject or nullNoFree-form labels for the project
modelsarray of stringNoModels the project's keys may call, within the team's models
spendnumberNoWhat the project has spent, in USD
model_spendobject or nullNoSpend per model, in USD
model_rpm_limitobject or nullNoMost requests per minute per model
model_tpm_limitobject or nullNoMost tokens per minute per model
blockedbooleanNoTrue when every request made with the project's keys is refused
object_permission_idstring or nullNoObject Permission Id
created_bystring or nullNoCreated By
updated_bystring or nullNoUpdated By
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At
spanway_budget_tableSpanway_BudgetTable or nullNoThe project's budget, when it has one
object_permissionSpanway_ObjectPermissionTable or nullNo

GET /project/list​

List projects

List projects. Proxy admins see every project, everyone else sees the projects of their own teams and of every team in an organization they administer.

Example:

curl --location 'http://localhost:4000/project/list' \
--header "Authorization: Bearer $SPANWAY_MASTER_KEY"

Example request:

curl -X GET "http://localhost:4000/project/list" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json array of Spanway_ProjectTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller cannot see this project's teamapplication/json ProxyError
500The database is not connectedapplication/json ProxyError