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.
| Method | Path | Summary |
|---|---|---|
| POST | /project/new | Create a project in a team |
| POST | /project/update | Update a project |
| DELETE | /project/delete | Delete projects |
| GET | /project/info | Get a project with its budget |
| GET | /project/list | List 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):
| Field | Type | Required | Description |
|---|---|---|---|
budget_id | string or null | No | Budget Id |
soft_budget | number or null | No | Soft Budget |
max_budget | number or null | No | Max Budget |
max_parallel_requests | integer or null | No | Max Parallel Requests |
tpm_limit | integer or null | No | Tpm Limit |
rpm_limit | integer or null | No | Rpm Limit |
tpd_limit | integer or null | No | Tpd Limit |
model_max_budget | object or null | No | Model Max Budget |
budget_duration | string or null | No | Budget Duration |
allowed_models | array of string or null | No | Allowed Models |
temp_budget_increase | number or null | No | Temp Budget Increase |
temp_budget_expiry | string or null | No | Temp Budget Expiry |
project_id | string or null | No | Project Id |
project_alias | string or null | No | Project Alias |
description | string or null | No | Description |
team_id | string | Yes | Team Id |
metadata | object or null | No | Metadata |
tags | array of string or null | No | Tags |
guardrails | array of string or null | No | Guardrails |
policies | array of string or null | No | Policies |
models | array of string | No | Models |
model_rpm_limit | object or null | No | Model Rpm Limit |
model_tpm_limit | object or null | No | Model Tpm Limit |
model_itpm_limit | object or null | No | Model Itpm Limit |
model_otpm_limit | object or null | No | Model Otpm Limit |
blocked | boolean | No | Blocked |
object_permission | Spanway_ObjectPermissionBase or null | No |
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:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json NewProjectResponse |
| 400 | A model, budget or limit breaks the team's caps, or the request carries a field projects cannot hold | application/json ProxyError |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The caller may not change projects on this team, or the gateway has no Enterprise license | application/json ProxyError |
| 404 | No team has that team_id | application/json ProxyError |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The database is not connected | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project Id |
project_alias | string or null | No | A readable name for the project |
description | string or null | No | What the project is for |
team_id | string or null | No | The team the project belongs to |
budget_id | string or null | No | The id of the project's budget |
metadata | object or null | No | Free-form labels for the project |
models | array of string | No | Models the project's keys may call, within the team's models |
spend | number | No | What the project has spent, in USD |
model_spend | object or null | No | Spend per model, in USD |
model_rpm_limit | object or null | No | Most requests per minute per model |
model_tpm_limit | object or null | No | Most tokens per minute per model |
blocked | boolean | No | True when every request made with the project's keys is refused |
object_permission_id | string or null | No | Object Permission Id |
created_by | string or null | No | Created By |
updated_by | string or null | No | Updated By |
created_at | string | Yes | Created At |
updated_at | string | Yes | Updated At |
spanway_budget_table | Spanway_BudgetTable or null | No | The project's budget, when it has one |
object_permission | Spanway_ObjectPermissionTable or null | No |
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):
| Field | Type | Required | Description |
|---|---|---|---|
budget_id | string or null | No | Budget Id |
soft_budget | number or null | No | Soft Budget |
max_budget | number or null | No | Max Budget |
max_parallel_requests | integer or null | No | Max Parallel Requests |
tpm_limit | integer or null | No | Tpm Limit |
rpm_limit | integer or null | No | Rpm Limit |
tpd_limit | integer or null | No | Tpd Limit |
model_max_budget | object or null | No | Model Max Budget |
budget_duration | string or null | No | Budget Duration |
allowed_models | array of string or null | No | Allowed Models |
temp_budget_increase | number or null | No | Temp Budget Increase |
temp_budget_expiry | string or null | No | Temp Budget Expiry |
project_id | string | Yes | Project Id |
project_alias | string or null | No | Project Alias |
description | string or null | No | Description |
team_id | string or null | No | Team Id |
metadata | object or null | No | Metadata |
tags | array of string or null | No | Tags |
guardrails | array of string or null | No | Guardrails |
policies | array of string or null | No | Policies |
models | array of string or null | No | Models |
model_rpm_limit | object or null | No | Model Rpm Limit |
model_tpm_limit | object or null | No | Model Tpm Limit |
model_itpm_limit | object or null | No | Model Itpm Limit |
model_otpm_limit | object or null | No | Model Otpm Limit |
blocked | boolean or null | No | Blocked |
object_permission | Spanway_ObjectPermissionBase or null | No |
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:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json Spanway_ProjectTable |
| 400 | A limit breaks the team's caps, or the project still has keys on another team | application/json ProxyError |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The caller may not change projects on this team, or the gateway has no Enterprise license | application/json ProxyError |
| 404 | No project has that project_id | application/json ProxyError |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The database is not connected | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | The project's unique id |
project_alias | string or null | No | A readable name for the project |
description | string or null | No | What the project is for |
team_id | string or null | No | The team the project belongs to |
budget_id | string or null | No | The id of the project's budget |
metadata | object or null | No | Free-form labels for the project |
models | array of string | No | Models the project's keys may call, within the team's models |
spend | number | No | What the project has spent, in USD |
model_spend | object or null | No | Spend per model, in USD |
model_rpm_limit | object or null | No | Most requests per minute per model |
model_tpm_limit | object or null | No | Most tokens per minute per model |
blocked | boolean | No | True when every request made with the project's keys is refused |
object_permission_id | string or null | No | Object Permission Id |
created_by | string or null | No | Created By |
updated_by | string or null | No | Updated By |
created_at | string or null | No | Created At |
updated_at | string or null | No | Updated At |
spanway_budget_table | Spanway_BudgetTable or null | No | The project's budget, when it has one |
object_permission | Spanway_ObjectPermissionTable or null | No |
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):
| Field | Type | Required | Description |
|---|---|---|---|
project_ids | array of string | Yes | Project 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:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json array of Spanway_ProjectTable |
| 400 | The project still has keys attached, so nothing was deleted | application/json ProxyError |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | Only proxy admins delete projects, on a licensed gateway | application/json ProxyError |
| 404 | No project has that project_id | application/json ProxyError |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The database is not connected | application/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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
project_id | query | string | Yes |
Example request:
curl -X GET "http://localhost:4000/project/info?project_id=project_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json Spanway_ProjectTable |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The caller cannot see this project's team | application/json ProxyError |
| 404 | No project has that project_id | application/json ProxyError |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The database is not connected | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | The project's unique id |
project_alias | string or null | No | A readable name for the project |
description | string or null | No | What the project is for |
team_id | string or null | No | The team the project belongs to |
budget_id | string or null | No | The id of the project's budget |
metadata | object or null | No | Free-form labels for the project |
models | array of string | No | Models the project's keys may call, within the team's models |
spend | number | No | What the project has spent, in USD |
model_spend | object or null | No | Spend per model, in USD |
model_rpm_limit | object or null | No | Most requests per minute per model |
model_tpm_limit | object or null | No | Most tokens per minute per model |
blocked | boolean | No | True when every request made with the project's keys is refused |
object_permission_id | string or null | No | Object Permission Id |
created_by | string or null | No | Created By |
updated_by | string or null | No | Updated By |
created_at | string or null | No | Created At |
updated_at | string or null | No | Updated At |
spanway_budget_table | Spanway_BudgetTable or null | No | The project's budget, when it has one |
object_permission | Spanway_ObjectPermissionTable or null | No |
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:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json array of Spanway_ProjectTable |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The caller cannot see this project's team | application/json ProxyError |
| 500 | The database is not connected | application/json ProxyError |