# API reference

The Volcano REST API lets you manage projects, deploy functions and frontends, provision databases, and handle user authentication.

The Volcano REST API lets you manage projects, deploy functions and frontends, provision databases, and handle user authentication.

## Base URL

```text
https://api.volcano.dev
```

For local development:

```text
http://localhost:8000
```

## Authentication

All API requests require authentication. Include your token in the `Authorization` header:

```bash
curl "https://api.volcano.dev/projects" \
  -H "Authorization: Bearer $PLATFORM_TOKEN"
```

Different endpoints require different token types:

| Token type                   | Use for                                                                      | Where it comes from                 |
| ---------------------------- | ---------------------------------------------------------------------------- | ----------------------------------- |
| Platform token (`pk-`)       | Managing every project in your account                                       | `volcano login`, or the dashboard   |
| Project access token (`pt-`) | Managing a single project from CI, a script, or an agent                     | `POST /projects/{id}/access-tokens` |
| Anon key                     | User authentication (signup, signin, refresh)                                | Created with the project            |
| Auth user access token       | Acting as one of _your_ end users: their profile, invoking functions as them | Signup/signin response              |
| Service key                  | Admin operations, invoking functions, bypassing RLS                          | `POST /projects/{id}/service-keys`  |

See [Authentication](https://docs.volcano.dev/platform/api-reference/authentication.md) for details on each token type, and [Using the API](https://docs.volcano.dev/platform/api-reference/using-the-api.md) for a worked example from first token to first deploy.

A machine-readable description of everything below is available at
`https://api.volcano.dev/openapi.yaml` — see [OpenAPI specification](https://docs.volcano.dev/platform/api-reference/openapi.md)
for generating a client or importing the API into a REST client.

## Request format

Send JSON data in request bodies:

```bash
curl -X POST "https://api.volcano.dev/projects" \
  -H "Authorization: Bearer $PLATFORM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "my-project"}'
```

For file uploads (function deployment), use `multipart/form-data`:

```bash
curl -X POST "https://api.volcano.dev/projects/$PROJECT_ID/functions" \
  -H "Authorization: Bearer $PLATFORM_TOKEN" \
  -F "name=hello" \
  -F "runtime=nodejs24.x" \
  -F "handler=handler" \
  -F "code=@function.zip"
```

## Response format

### Success responses

Single resource:

```json
{
  "id": "proj_abc123",
  "name": "my-project",
  "status": "active",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}
```

Paginated list:

```json
{
  "data": [
    { "id": "proj_abc123", "name": "project-1" },
    { "id": "proj_def456", "name": "project-2" }
  ],
  "page": 1,
  "limit": 10,
  "total": 25,
  "has_more": true,
  "next": "/projects?page=2&limit=10"
}
```

### Error responses

```json
{
  "error": "project not found"
}
```

## HTTP status codes

| Code  | Description                                                  |
| ----- | ------------------------------------------------------------ |
| `200` | Success                                                      |
| `201` | Resource created                                             |
| `204` | Success with no response body                                |
| `400` | Bad request — invalid parameters                             |
| `401` | Unauthorized — missing or invalid token                      |
| `403` | Forbidden — valid token but insufficient permissions         |
| `404` | Not found — resource doesn't exist                           |
| `409` | Conflict — duplicate resource or incompatible resource state |
| `429` | Too many requests — rate limited                             |
| `500` | Internal server error                                        |
| `503` | Service unavailable — a required backend is unavailable      |

## Pagination

List endpoints support pagination with `page` and `limit` parameters:

```bash
curl "https://api.volcano.dev/projects?page=2&limit=20" \
  -H "Authorization: Bearer $PLATFORM_TOKEN"
```

| Parameter | Default | Maximum | Description             |
| --------- | ------- | ------- | ----------------------- |
| `page`    | 1       | —       | Page number (1-indexed) |
| `limit`   | 10      | 100     | Items per page          |

The response includes pagination metadata:

```json
{
  "data": [...],
  "page": 2,
  "limit": 20,
  "total": 45,
  "has_more": true,
  "next": "/projects?page=3&limit=20"
}
```

## Rate limiting

The user authentication endpoints are rate limited per project and client IP, in hourly windows you [configure per project](https://docs.volcano.dev/platform/authentication/configuration/rate-limiting.md). They report the quota on every response:

```text
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 73
```

Over the limit they return `429`:

```text
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1704128400
```

`X-RateLimit-Reset` is a Unix timestamp for the end of the window. `/auth/signup`, `/auth/forgot-password`, `/auth/reset-password`, and `/auth/user/change-email` send it on a `429`; `/auth/signin` and `/auth/refresh` do not.

No other endpoint sends these headers. Project management endpoints are not rate limited, so a request with a valid token is never refused for its rate. [Project locks](https://docs.volcano.dev/platform/api-reference/locks.md) and function invocation have their own limits and return `429` without these headers.

One case does return `429` without a quota header: repeatedly presenting credentials that are not recognized. Each unrecognized value has to be checked, so a client working through many of them is rationed per source. Retry with a credential that works, or check the token still exists — a valid token is answered from cache and never counts against this.

Every response says which build and region answered:

```text
X-Volcano-Version: <version>                  # production
X-Volcano-Version: <env>-<version>            # non-production (e.g. staging-xyz)
X-Volcano-Region: us-east-1                   # the region that served the request
```

Volcano's internal headers are never returned.

## Capabilities

Some capabilities are not available in every environment. Check which ones
accept new work before offering them:

```bash
curl "https://api.volcano.dev/capabilities"
```

```json
{
  "data": [
    { "id": "sandboxes", "status": "available" },
    { "id": "sandboxes.sessions", "status": "available" },
    { "id": "sandboxes.custom_templates", "status": "unavailable" },
    { "id": "issues", "status": "available" },
    { "id": "lavaflow", "status": "unavailable" },
    { "id": "lavaflow.merge", "status": "unavailable" },
    { "id": "functions.response_streaming", "status": "available" },
    { "id": "frontend_routes", "status": "available" },
    { "id": "frontends.candidates", "status": "unavailable" },
    { "id": "databases.migrations", "status": "available" }
  ]
}
```

| ID                             | Covers                                                                                                                                                                                                                      |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sandboxes`                    | The Sandbox API: presets, templates, sessions, and executions                                                                                                                                                               |
| `sandboxes.sessions`           | Starting and resuming sessions, and one-shot executions                                                                                                                                                                     |
| `sandboxes.custom_templates`   | Deploying a custom template; its validation waits while `sandboxes.sessions` is unavailable                                                                                                                                 |
| `issues`                       | The Issues API: listing, reading, and updating grouped runtime errors                                                                                                                                                       |
| `lavaflow`                     | LavaFlow, which diagnoses a project's issues, opens pull requests that fix them, and can merge them. This list says only whether it's released in the environment; a project's list says whether that project has it        |
| `lavaflow.merge`               | Letting LavaFlow [merge its fixes](https://docs.volcano.dev/platform/guides/lavaflow.md#merge-fixes): `autonomy: merge` and changing `merge_policy`; reading merges works either way                                                                       |
| `functions.response_streaming` | [Streaming a response](https://docs.volcano.dev/platform/functions/invoking-functions.md#stream-a-response) on a function's own URL                                                                                                                        |
| `frontend_routes`              | Creating and changing [Frontend routes](https://docs.volcano.dev/platform/frontends/frontend-routes.md); listing, deleting, and serving existing ones work either way                                                                                      |
| `frontends.candidates`         | Creating, deploying to, promoting and rolling back to [frontend previews](https://docs.volcano.dev/platform/frontends/previews.md); listing, reading and deleting them, and rolling back to the frontend's own build, work either way                      |
| `databases.migrations`         | Starting [migration runs](https://docs.volcano.dev/platform/guides/migrations.md), recording a baseline, and turning on `apply_migrations` for [Git deploy](https://docs.volcano.dev/platform/projects/git-deploy.md#apply-migrations-on-push); reading history and runs works either way |

The endpoint needs no token, and every caller in an environment gets the same
answer. While a capability is `unavailable`, requests that start new work
answer `404`, or `400` for a single field or option, with code
`feature_unavailable`:

```json
{ "error": "sandboxes are not available", "code": "feature_unavailable" }
```

Reading, deleting, and terminating what already exists keep working unless the
whole feature is absent from the environment. Treat a missing capability or an
unknown status as unavailable, and refresh the list when a route answers
`feature_unavailable`. A capability under another,
such as `sandboxes.sessions`, is unavailable whenever its parent is. A `503` is
a temporary outage, not an unavailable capability; retry it.

### Capabilities for one project

Some capabilities are offered to some projects and not others. A project's list
has the same entries, and answers those per project:

```bash
curl "https://api.volcano.dev/projects/$PROJECT_ID/capabilities" \
  -H "Authorization: Bearer $PLATFORM_TOKEN"
```

```json
{
  "data": [
    { "id": "sandboxes", "status": "available" },
    { "id": "issues", "status": "available" },
    { "id": "lavaflow", "status": "available" }
  ]
}
```

The response is shortened here; it lists every capability.

`lavaflow` is `available` there when LavaFlow is released, offered to the
project's owner, and included in the owner's plan. Where it isn't, the entry
says what the project can still do:

| Entry                                                                    | Meaning                                                                                                                                                                        |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `{ "id": "lavaflow", "status": "read_only" }`                            | The project has LavaFlow settings or runs. Its LavaFlow reads answer and LavaFlow can be turned off; anything else is refused                                                  |
| `{ "id": "lavaflow", "status": "unavailable", "code": "plan_required" }` | The owner's plan doesn't include LavaFlow. LavaFlow routes answer `403` with code `plan_required`                                                                              |
| `{ "id": "lavaflow", "status": "unavailable" }`                          | LavaFlow isn't offered to the project. LavaFlow routes answer `404` with code `feature_unavailable`, or `403` without a code while the owner's plan can't be read; retry those |

`lavaflow.merge` is `available` when `lavaflow` is and LavaFlow may merge
fixes in the environment. `read_only` appears only in a project's list, and
has no `code`. On an
`unavailable` entry, a `code` names the error code its refused requests answer
with; treat an unknown code as absent. Every other entry matches
`GET /capabilities`. Any project credential can read it, including a read-only
project access token.

`functions.response_streaming` refuses nothing. While it is `unavailable`, a
function's own URL sends a streamed response whole, once the function finishes.
A response sent whole is limited to 6 MiB, headers included; a larger one fails
the invocation.

## CLI version gating

A CLI reports its version via the `X-Volcano-CLI-Version` request header. The API
can reply with these instructions:

- `X-Volcano-CLI-Instruction`: `suggestion_version_upgrade`,
  `require_version_upgrade`, `low_credit_warning`, or `not_enough_credit`.
- `X-Volcano-Credit-URL`: the billing page address sent with a credit instruction.
- `X-Volcano-Device-Instruction`: `reauth`.

Deprecated CLI versions are blocked with `426 Upgrade Required`. Credit
instructions explain the account state but do not block a request. Requests
without the version header are unaffected. See CLI Version Gating.

## API endpoints

### Projects

| Method   | Endpoint                                     | Description                                                                                         |
| -------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `POST`   | `/projects`                                  | Create a project                                                                                    |
| `GET`    | `/projects`                                  | List projects                                                                                       |
| `GET`    | `/projects/{id}`                             | Get a project                                                                                       |
| `GET`    | `/deployments`                               | List deployments across every project you own                                                       |
| `GET`    | `/projects/{id}/deployments`                 | List a project's function and frontend deployments; filter with `resource_type` and `function_kind` |
| `GET`    | `/projects/{id}/deployments/summary`         | Summarize one deployment pipeline (`resource_type`, optionally `function_kind`)                     |
| `GET`    | `/projects/{id}/git-deployment-runs`         | List the runs Git pushes started; filter with `status` and `branch`                                 |
| `GET`    | `/projects/{id}/git-deployment-runs/{runId}` | Get one Git deployment run                                                                          |
| `PATCH`  | `/projects/{id}`                             | Update project name/region policy                                                                   |
| `DELETE` | `/projects/{id}`                             | Delete a project                                                                                    |

See [Projects](https://docs.volcano.dev/platform/api-reference/projects.md) for details, and [Git deploy](https://docs.volcano.dev/platform/projects/git-deploy.md#check-deployment-runs) for deployment runs.

### Functions

| Method   | Endpoint                                            | Description                                      |
| -------- | --------------------------------------------------- | ------------------------------------------------ |
| `POST`   | `/projects/{id}/functions`                          | Deploy a function                                |
| `GET`    | `/projects/{id}/functions`                          | List functions                                   |
| `GET`    | `/projects/{id}/functions/{functionId}`             | Get a function                                   |
| `PATCH`  | `/projects/{id}/functions/{functionId}`             | Update function settings (visibility)            |
| `DELETE` | `/projects/{id}/functions/{functionId}`             | Delete a function                                |
| `POST`   | `/functions/{functionId}/invoke`                    | Invoke a function                                |
| `GET`    | `/functions/resolve`                                | Resolve function name to function ID             |
| `GET`    | `/functions/runtimes`                               | List supported runtimes and their display labels |
| `POST`   | `/projects/{id}/logs/search`                        | Search and filter function runtime logs          |
| `GET`    | `/projects/{id}/functions/{functionId}/deployments` | List function deployments                        |

See [Functions](https://docs.volcano.dev/platform/api-reference/functions.md) for details.

### Durable functions

| Method   | Endpoint                                                                            | Description                                                                                 |
| -------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `POST`   | `/projects/{id}/durable-functions`                                                  | Deploy a durable function                                                                   |
| `GET`    | `/projects/{id}/durable-functions`                                                  | List durable functions                                                                      |
| `GET`    | `/projects/{id}/durable-functions/{functionId}`                                     | Get a durable function                                                                      |
| `DELETE` | `/projects/{id}/durable-functions/{functionId}`                                     | Delete a durable function                                                                   |
| `GET`    | `/projects/{id}/durable-functions/{functionId}/deployments`                         | List durable function deployments                                                           |
| `POST`   | `/durable-functions/{functionId}/executions`                                        | Start an execution with an application credential                                           |
| `GET`    | `/durable-functions/{functionId}/executions/{executionId}`                          | Get an execution with an application credential                                             |
| `POST`   | `/durable-functions/{functionId}/executions/{executionId}/stop`                     | Stop an execution with an application credential                                            |
| `POST`   | `/projects/{id}/durable-functions/{functionId}/executions`                          | Start an execution as the project owner                                                     |
| `GET`    | `/projects/{id}/durable-functions/{functionId}/executions`                          | List executions                                                                             |
| `GET`    | `/projects/{id}/durable-functions/{functionId}/executions/{executionId}`            | Get an execution                                                                            |
| `GET`    | `/projects/{id}/durable-functions/{functionId}/executions/{executionId}/operations` | List an execution's operations                                                              |
| `POST`   | `/projects/{id}/durable-functions/{functionId}/executions/{executionId}/stop`       | Stop an execution                                                                           |
| `GET`    | `/projects/{id}/durable-functions/{functionId}/schedulers`                          | List schedules                                                                              |
| `POST`   | `/projects/{id}/durable-functions/{functionId}/schedulers`                          | Create a schedule                                                                           |
| `GET`    | `/projects/{id}/durable-functions/{functionId}/schedulers/{schedulerId}`            | Get a schedule                                                                              |
| `PATCH`  | `/projects/{id}/durable-functions/{functionId}/schedulers/{schedulerId}`            | Update a schedule                                                                           |
| `DELETE` | `/projects/{id}/durable-functions/{functionId}/schedulers/{schedulerId}`            | Delete a schedule                                                                           |
| `GET`    | `/projects/{id}/schedulers?function_kind=durable`                                   | List every durable function's schedules in the project                                      |
| `GET`    | `/projects/{id}/deployments?function_kind=durable`                                  | List every durable function's deployments in the project                                    |
| `GET`    | `/projects/{id}/durable-approvals`                                                  | List approvals workflows requested                                                          |
| `GET`    | `/projects/{id}/durable-approvals/stats`                                            | Count approvals by outcome, workflow, and day                                               |
| `GET`    | `/projects/{id}/durable-approvals/{approvalId}`                                     | Get an approval                                                                             |
| `POST`   | `/projects/{id}/durable-approvals/{approvalId}/approve`                             | Approve a pending approval; a person only                                                   |
| `POST`   | `/projects/{id}/durable-approvals/{approvalId}/deny`                                | Deny a pending approval; a person only                                                      |
| `POST`   | `/durable-approvals`                                                                | Register an approval request; called by the SDK from inside a workflow, not by applications |
| `POST`   | `/durable-callbacks`                                                                | Get a callback token; called by the SDK from inside a workflow, not by applications         |
| `POST`   | `/durable-callbacks/succeed`                                                        | Complete a waiting step with a result; the callback token is the only credential            |
| `POST`   | `/durable-callbacks/fail`                                                           | Fail a waiting step with an error; the callback token is the only credential                |
| `POST`   | `/durable-callbacks/heartbeat`                                                      | Report that the work behind a callback token is still going on                              |

Durable functions are a separate collection: a standard function's id is `404`
here, and a durable function's id is `404` under `/projects/{id}/functions`. See
[Durable functions](https://docs.volcano.dev/platform/functions/durable-functions.md) for details,
[Durable approvals](https://docs.volcano.dev/platform/functions/durable-approvals.md) for the approval endpoints,
and [Durable callbacks](https://docs.volcano.dev/platform/functions/durable-callbacks.md) for the callback
endpoints.

### Issues

| Method  | Endpoint                          | Description                                                                     |
| ------- | --------------------------------- | ------------------------------------------------------------------------------- |
| `GET`   | `/projects/{id}/issues`           | List runtime errors grouped into issues; filter with `status` and `resource_id` |
| `GET`   | `/projects/{id}/issues/{issueId}` | Get an issue                                                                    |
| `PATCH` | `/projects/{id}/issues/{issueId}` | Resolve, ignore, or reopen an issue                                             |

Issues are in preview. See [Issues](https://docs.volcano.dev/platform/guides/issues.md).

### LavaFlow

| Method | Endpoint                  | Description                                                  |
| ------ | ------------------------- | ------------------------------------------------------------ |
| `GET`  | `/lavaflow/settings`      | Get a project's LavaFlow settings                            |
| `PUT`  | `/lavaflow/settings`      | Change a project's LavaFlow settings; the owner only         |
| `GET`  | `/lavaflow/stats`         | Count issues LavaFlow took on and pull requests it opened    |
| `GET`  | `/lavaflow/resources`     | List each resource's LavaFlow activity and anomalies         |
| `GET`  | `/lavaflow/runs`          | List LavaFlow runs; filter with `status` and `resource_id`   |
| `GET`  | `/lavaflow/runs/{run_id}` | Get a run with its diagnosis, diff, review, and pull request |

Each endpoint names one project with `project_id`: a query parameter on reads,
a body field on `PUT`. LavaFlow is in preview and needs the SUPERAGENT plan.
See [LavaFlow](https://docs.volcano.dev/platform/guides/lavaflow.md).

### Notifications

| Method | Endpoint                                      | Description                                                                          |
| ------ | --------------------------------------------- | ------------------------------------------------------------------------------------ |
| `GET`  | `/projects/{id}/notifications`                | Get where a project's alerts go                                                      |
| `PUT`  | `/projects/{id}/notifications`                | Turn email on or off, change the webhook, and choose when a failing scheduler alerts |
| `POST` | `/projects/{id}/notifications/webhook-secret` | Rotate the webhook signing secret                                                    |
| `POST` | `/projects/{id}/notifications/test`           | Send a test notification on every configured channel                                 |

See [Notifications API](https://docs.volcano.dev/platform/api-reference/notifications.md) and [Notifications](https://docs.volcano.dev/platform/projects/notifications.md).

### Frontends

| Method   | Endpoint                                                          | Description                                                   |
| -------- | ----------------------------------------------------------------- | ------------------------------------------------------------- |
| `POST`   | `/projects/{id}/frontends`                                        | Deploy a frontend archive (subject to plan deployment limits) |
| `GET`    | `/projects/{id}/frontends`                                        | List frontends                                                |
| `GET`    | `/projects/{id}/frontends/{frontendId}`                           | Get a frontend                                                |
| `POST`   | `/projects/{id}/frontends/{frontendId}/redeploy`                  | Redeploy latest frontend artifact                             |
| `DELETE` | `/projects/{id}/frontends/{frontendId}`                           | Delete/deprovision a frontend                                 |
| `GET`    | `/projects/{id}/frontends/{frontendId}/deployments`               | List frontend deployments                                     |
| `GET`    | `/projects/{id}/frontends/{frontendId}/function-routes`           | List a frontend's Function routes                             |
| `POST`   | `/projects/{id}/frontends/{frontendId}/function-routes`           | Route a frontend path to a public HTTP function               |
| `PUT`    | `/projects/{id}/frontends/{frontendId}/function-routes/{routeId}` | Replace a Function route                                      |
| `DELETE` | `/projects/{id}/frontends/{frontendId}/function-routes/{routeId}` | Delete a Function route                                       |
| `GET`    | `/projects/{id}/frontends/{frontendId}/frontend-routes`           | List a frontend's Frontend routes                             |
| `POST`   | `/projects/{id}/frontends/{frontendId}/frontend-routes`           | Serve another frontend under a path                           |
| `PUT`    | `/projects/{id}/frontends/{frontendId}/frontend-routes/{routeId}` | Replace a Frontend route                                      |
| `DELETE` | `/projects/{id}/frontends/{frontendId}/frontend-routes/{routeId}` | Delete a Frontend route                                       |
| `POST`   | `/projects/{id}/logs/search`                                      | Search and filter frontend runtime and deployment logs        |

See [Frontend Endpoints](https://docs.volcano.dev/platform/api-reference/frontend-endpoints.md) for details.

### Databases

| Method   | Endpoint                                          | Description                                         |
| -------- | ------------------------------------------------- | --------------------------------------------------- |
| `POST`   | `/projects/{id}/databases`                        | Create a database                                   |
| `GET`    | `/projects/{id}/databases`                        | List databases                                      |
| `GET`    | `/projects/{id}/databases/{databaseName}`         | Get a database                                      |
| `DELETE` | `/projects/{id}/databases/{databaseName}`         | Delete a database                                   |
| `GET`    | `/projects/{id}/databases/{databaseName}/queries` | Get top query performance from `pg_stat_statements` |
| `GET`    | `/databases/regions`                              | List available regions                              |
| `GET`    | `/databases/versions`                             | List PostgreSQL versions                            |

See [Databases](https://docs.volcano.dev/platform/api-reference/databases.md) for details.

### Project locks

| Method   | Endpoint             | Description             |
| -------- | -------------------- | ----------------------- |
| `POST`   | `/locks/{key}/lease` | Acquire a project lease |
| `PATCH`  | `/locks/{key}/lease` | Renew the owned lease   |
| `DELETE` | `/locks/{key}/lease` | Release the owned lease |

These endpoints accept service-role keys only. See [Project locks](https://docs.volcano.dev/platform/api-reference/locks.md).

### Authentication

| Method | Endpoint                | Description               |
| ------ | ----------------------- | ------------------------- |
| `POST` | `/auth/signup`          | Create a new user         |
| `POST` | `/auth/signin`          | Sign in a user            |
| `POST` | `/auth/refresh`         | Refresh access token      |
| `POST` | `/auth/logout`          | Sign out a user           |
| `GET`  | `/auth/user`            | Get current user          |
| `PUT`  | `/auth/user`            | Update current user       |
| `POST` | `/auth/forgot-password` | Request password reset    |
| `POST` | `/auth/reset-password`  | Reset password with token |

See [Auth endpoints](https://docs.volcano.dev/platform/api-reference/auth-endpoints.md) for details.

### Service keys

| Method   | Endpoint                              | Description          |
| -------- | ------------------------------------- | -------------------- |
| `POST`   | `/projects/{id}/service-keys`         | Create a service key |
| `GET`    | `/projects/{id}/service-keys`         | List service keys    |
| `DELETE` | `/projects/{id}/service-keys/{keyId}` | Delete a service key |

### Anon keys

| Method   | Endpoint                           | Description        |
| -------- | ---------------------------------- | ------------------ |
| `POST`   | `/projects/{id}/anon-keys`         | Create an anon key |
| `GET`    | `/projects/{id}/anon-keys`         | List anon keys     |
| `DELETE` | `/projects/{id}/anon-keys/{keyId}` | Delete an anon key |

### Project access tokens

| Method   | Endpoint                                       | Description                                                |
| -------- | ---------------------------------------------- | ---------------------------------------------------------- |
| `POST`   | `/projects/{id}/access-tokens`                 | Create a token and return its secret, once                 |
| `GET`    | `/projects/{id}/access-tokens`                 | List tokens (`page`, `limit`, `search`, `include_revoked`) |
| `GET`    | `/projects/{id}/access-tokens/{tokenId}`       | Get one token's metadata                                   |
| `DELETE` | `/projects/{id}/access-tokens/{tokenId}`       | Revoke a token                                             |
| `GET`    | `/projects/{id}/access-tokens/usage`           | Daily request counts for every token in the project        |
| `GET`    | `/projects/{id}/access-tokens/{tokenId}/usage` | Daily request counts for one token                         |

Creating, listing, reading, and revoking require a platform token: a project access token cannot manage project access tokens. The usage endpoints are ordinary project reads. See [Project access tokens](https://docs.volcano.dev/platform/authentication/security/project-access-tokens.md).

### MCP

| Method | Endpoint | Description                                   |
| ------ | -------- | --------------------------------------------- |
| `POST` | `/mcp`   | Model Context Protocol endpoint for AI agents |

This endpoint takes its project from the credential, so it accepts a project access token only. See [MCP server](https://docs.volcano.dev/platform/interfaces/mcp.md).

## What's next

| Reference                           | Description                                             |
| ----------------------------------- | ------------------------------------------------------- |
| [Using the API](https://docs.volcano.dev/platform/api-reference/using-the-api.md)   | Create a token, deploy, and read logs over HTTP         |
| [Authentication](https://docs.volcano.dev/platform/api-reference/authentication.md) | Token types and auth headers                            |
| [Projects](https://docs.volcano.dev/platform/api-reference/projects.md)             | Project management API                                  |
| [Functions](https://docs.volcano.dev/platform/api-reference/functions.md)           | Function deployment and invocation                      |
| [Databases](https://docs.volcano.dev/platform/api-reference/databases.md)           | Database provisioning                                   |
| [Auth endpoints](https://docs.volcano.dev/platform/api-reference/auth-endpoints.md) | User authentication API                                 |
| [MCP server](https://docs.volcano.dev/platform/interfaces/mcp.md)  | Give an AI agent a scoped tool surface over one project |
| [Errors](https://docs.volcano.dev/platform/api-reference/errors.md)                 | Error codes and handling                                |
| [OpenAPI specification](https://docs.volcano.dev/platform/api-reference/openapi.md) | Generate a client from the machine-readable contract    |
