> For the list of every page, fetch /llms.txt. The API contract is the OpenAPI file linked from the API reference.

# Projects

A project is a named group inside your account. It does three things:

- It holds routing defaults for every request made with its keys.
- It owns sandboxes and images. A key sees only the sandboxes and images of its own project.
- It holds the webhook URL and webhook secret for sandbox events.

Your account starts with one project. Next step: create a project for each workload that needs its own routing or its own set of sandboxes.

All project routes need a key with the `admin` scope. An admin key can manage every project in the account, whichever project the key itself belongs to.

## Create a project

```bash
curl -sS -X POST "$MEADOW_BASE_URL/v1/projects" \
  -H "Authorization: Bearer $MEADOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "evals",
    "webhook_url": "https://example.com/hooks/meadow",
    "routing": {
      "models": {
        "order": ["google", "openrouter"],
        "per_model": {"grok-4.7": {"only": ["xai"]}}
      },
      "sandboxes": {"order": ["modal", "daytona"], "create_timeout_seconds": 120}
    }
  }'
```

```json
{
  "created_at": "2026-11-24T20:39:52.602Z",
  "id": "prj_0000c2ce",
  "name": "evals",
  "routing": {
    "models": {"order": ["google", "openrouter"], "per_model": {"grok-4.7": {"only": ["xai"]}}},
    "sandboxes": {"create_timeout_seconds": 120, "order": ["modal", "daytona"]}
  },
  "webhook_secret": "whsec_...",
  "webhook_url": "https://example.com/hooks/meadow"
}
```

Only `name` is required. `webhook_secret` is returned on create and after a rotation, and never on a read. Store it when you see it.

`max_sandboxes` caps how many sandboxes of the project may be alive at once, whichever key made them. Left out, there is no cap. See [Sandboxes](/run-sandboxes/sandboxes#limit-how-many-run-at-once).

The project samples on this page were captured before 2026-11-28. A project object now also carries `max_sandboxes`, `null` when not set. That is read from the server's code: no new sample was captured.

Send an `Idempotency-Key` header with `POST /v1/projects` so a retry cannot create a second project. A retry by the same API key with the same `Idempotency-Key` and body within 24 hours returns the first response with `Idempotent-Replayed: true` and without `webhook_secret`: Meadow never saves a one-time secret. If you lost the first response, rotate the secret (see [Webhooks](/run-sandboxes/webhooks)). Two projects may share a name.

A new project has no keys. Create one with `POST /v1/keys` and the new `project_id`. See [Authentication](/set-up-your-account/authentication#create-a-key).

## Routing defaults for models

`routing.models` says which providers may serve a model call and in what order.

| Field | Meaning |
| --- | --- |
| `order` | Providers to try first, in this order. Providers not listed are tried after them. |
| `only` | Use only these providers. |
| `ignore` | Never use these providers. |
| `allow_fallbacks` | `false` means try one provider and stop. Default `true`. |
| `per_model` | The same four fields for one model ID. |

In every case Meadow skips providers you have no provider key for and providers that do not accept the request's format. A request can override these fields for one call, and a `per_model` entry overrides them for one model. [Routing and fallbacks](/call-models/routing-and-fallbacks) gives the default route, the order in which the layers apply, and what triggers a fallback.

This project puts OpenRouter first:

```bash
curl -sS -X PATCH "$MEADOW_BASE_URL/v1/projects/$PROJECT_ID" \
  -H "Authorization: Bearer $MEADOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"routing": {"models": {"order": ["openrouter", "google"]}}}'
```

A call with one of the project's keys follows that order. Read the response headers to see who served it:

```bash
curl -sS -D - -o /dev/null "$MEADOW_BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gemini-3.1-flash-lite-preview", "messages": [{"role": "user", "content": "Say hi in one word."}], "max_tokens": 16}' \
  | grep -i x-meadow
```

```text
x-meadow-attempts: 2
x-meadow-model: gemini-3.1-flash-lite-preview
x-meadow-provider: google
```

Two attempts: in this run the OpenRouter account did not allow that model, so Meadow fell back to Google. A request can override the project for one call:

```bash
curl -sS -D - -o /dev/null "$MEADOW_BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gemini-3.1-flash-lite-preview", "provider": {"only": ["google"]}, "messages": [{"role": "user", "content": "Say hi in one word."}], "max_tokens": 16}' \
  | grep -i x-meadow
```

```text
x-meadow-attempts: 1
x-meadow-model: gemini-3.1-flash-lite-preview
x-meadow-provider: google
```

## Routing defaults for sandboxes

`routing.sandboxes` does the same for sandbox creates.

| Field | Meaning |
| --- | --- |
| `order` | `daytona` and `modal` in the order to try. Default: Daytona, then Modal. |
| `only` | Use only these providers. |
| `allow_fallbacks` | `false` means try one provider and stop. Default `true`. |
| `create_timeout_seconds` | How long to wait on one provider before trying the next, from 1 to 3600. When neither the project nor the request sets it: 300 on the last provider in the route and 120 on an earlier one. A GPU sandbox waits 300 on each: see [Sandboxes](/run-sandboxes/sandboxes#when-a-provider-is-failing). |
| `options` | Provider settings keyed by provider, such as `{"daytona": {"spot": true}}`. Only a fixed set of keys is accepted. |

A request's `provider` object overrides these field by field. A project cannot set a default sandbox lifetime: `timeout_seconds` is set on each create.

## Lock a project

`"lock": true` inside `routing` stops requests from overriding the project. Use it when a project must stay on approved providers.

```bash
curl -sS -X PATCH "$MEADOW_BASE_URL/v1/projects/$PROJECT_ID" \
  -H "Authorization: Bearer $MEADOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "routing": {
      "models": {
        "order": ["google", "openrouter"],
        "allow_fallbacks": false,
        "per_model": {"grok-4.7": {"only": ["xai"]}}
      },
      "lock": true
    }
  }'
```

On a locked project:

- A model request that sends a `provider` object gets a 403.
- A model ID pinned as `<provider>/<model>` gets a 403.
- A sandbox create that sends any routing field in `provider`, including `options`, gets a 403.
- `GET /v1/models` lists only the providers the project's routing allows.
- Requests with no routing fields work, and follow the project's defaults and `per_model` entries.

```bash
curl -sS "$MEADOW_BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gemini-3.1-flash-lite-preview", "provider": {"only": ["openrouter"]}, "messages": [{"role": "user", "content": "Say hi in one word."}], "max_tokens": 16}'
```

```json
{"error":{"message":"project routing is locked and cannot be overridden","type":"invalid_request_error","param":null,"code":"forbidden"},"request_id":"req_0000a49f"}
```

| Message | Cause |
| --- | --- |
| `project routing is locked and cannot be overridden` | A model request sent `provider`. |
| `project routing is locked and provider-pinned models are not allowed` | A model request used `<provider>/<model>`. |
| `project routing is locked` | A sandbox create sent routing fields. |
| `project routing allows no providers for this model` | The locked routing leaves no provider for the model. |

A lock is a rule on requests. An admin key can still change or remove it with `PATCH`.

## Update a project

`PATCH /v1/projects/{project_id}` changes `name`, `webhook_url`, `max_sandboxes`, and `routing`. Fields you leave out stay as they are.

`routing` is replaced as a whole. A patch that sends `routing` with one field drops every other routing field:

```bash
curl -sS -X PATCH "$MEADOW_BASE_URL/v1/projects/$PROJECT_ID" \
  -H "Authorization: Bearer $MEADOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"routing": {"lock": true}}'
```

```json
{"created_at":"2026-11-24T20:39:52.602Z","id":"prj_0000c2ce","name":"evals","routing":{"lock":true},"webhook_url":"https://example.com/hooks/meadow"}
```

The `models.order` this project had before the patch is gone. To change one routing field, read the project, edit the routing object, and send all of it.

Set `"webhook_url": null` to remove the webhook URL. A webhook URL must use `https` and resolve to a public address.

Bad input returns 400 with a message that names the field. `error.param` carries the field too. For an unsupported provider option it names the key, such as `routing.sandboxes.options.daytona.<key>` with `error.code` `parameter_unknown` (seen on the hosted beta on 2026-11-28):

| Message | Cause |
| --- | --- |
| `invalid model provider in routing.models.order` | A sandbox provider or an unknown name in a model list. |
| `routing.sandboxes.create_timeout_seconds must be at most 3600` | Value out of range. |
| `unknown field in routing` | A misspelled or unsupported field. Unknown fields are never ignored. |
| `unsupported key in routing.sandboxes.options.daytona` | An option Meadow does not accept for that provider. |
| `webhook_url must use https` | A plain `http` URL. |
| `name must not be empty` | Blank name. |

### Rotate the webhook secret

Send `{"rotate_webhook_secret": true}`. The response carries the new `webhook_secret` once, and the old secret stays valid for 24 hours. [Webhooks](/run-sandboxes/webhooks#rotate-the-secret) shows the call and how a receiver handles both secrets.

## Read projects

```bash
curl -sS "$MEADOW_BASE_URL/v1/projects/$PROJECT_ID" \
  -H "Authorization: Bearer $MEADOW_API_KEY"
```

```json
{
  "created_at": "2026-11-24T20:39:52.602Z",
  "id": "prj_0000c2ce",
  "name": "evals",
  "routing": {
    "models": {"order": ["google", "openrouter"], "per_model": {"grok-4.7": {"only": ["xai"]}}},
    "sandboxes": {"create_timeout_seconds": 120, "order": ["modal", "daytona"]}
  },
  "webhook_url": "https://example.com/hooks/meadow"
}
```

`GET /v1/projects` returns every project in the account under `data`, oldest first, with `"object": "list"` and `"has_more": false`. It is not paginated.

## Delete a project

```bash
curl -sS -o /dev/null -w '%{http_code}\n' -X DELETE "$MEADOW_BASE_URL/v1/projects/$PROJECT_ID" \
  -H "Authorization: Bearer $MEADOW_API_KEY"
```

```text
204
```

Deleting a project deletes every key in it. Those keys stop working at once. It cannot be undone.

Meadow rejects the delete with a 409 while any of these holds. A rejected delete removes nothing.

| Message | What to do |
| --- | --- |
| `project has sandboxes that are not terminated; delete them first` | Delete each sandbox and wait for `terminated`. |
| `project has sandboxes still being cleaned up at the provider; retry shortly` | Wait and retry. A create the provider did not clearly reject can hold this for as long as the sandbox's own lifetime. See [Known limits](/reference/known-limits#projects-and-keys). |
| `project has images; delete them first` | Delete each image. |
| `project has image builds still being cleaned up at the provider; retry shortly` | Wait and retry. |
| `project has build contexts that have not expired; they expire on their own, retry later` | A build context expires 24 hours after its last use. Retry after that. |
| `project has expired build contexts still being removed; retry shortly` | Wait and retry. |
| `deleting this project would delete the account's last admin key; mint an admin key in another project first` | Create an admin key in a project you are keeping. |
| `N live keys in other projects count against a key with a limit in this project; revoke them first` | A limited key here created keys in another project. Revoke those keys. |

The last case, from a real run:

```json
{"error":{"code":"project_has_dependent_keys","message":"1 live keys in other projects count against a key with a limit in this project; revoke them first","type":"conflict"},"request_id":"req_00005d96"}
```

A 409 uses the error type `conflict`. See [Errors](/reference/errors).

## Restricted projects

A restricted project is for some of the people in the account. Owners and admins see every project. A `member` or `viewer` sees an unrestricted project, and a restricted project only after an owner or admin adds them to it. Keys do not change: a key works in its own project whoever can see it.

Restrict a project, then add a person by their user id from `GET /v1/members`:

```bash
curl -sS -X PATCH "$MEADOW_BASE_URL/v1/projects/$PROJECT_ID" \
  -H "Authorization: Bearer $MEADOW_API_KEY" -H "Content-Type: application/json" \
  -d '{"restricted": true}'
curl -sS -X PUT "$MEADOW_BASE_URL/v1/projects/$PROJECT_ID/members/$USER_ID" \
  -H "Authorization: Bearer $MEADOW_API_KEY"
```

```json
{"added_at":"2026-11-28T10:00:00Z","email":"grace@example.com","user_id":"00000000-0000-0000-0000-00000000f32d"}
```

To a person who cannot see it, a restricted project answers like a project of another account: 404 `project_not_found` on its id and in `x-meadow-project`. Its keys, sandboxes, images, usage records and requests are left out of every list and total, and so are provider keys that serve only hidden projects. The change applies from their next request. Removing a person from the account removes them from every project.

These calls need the `admin` scope, or an owner or admin session. `GET /v1/projects/{project_id}/members` lists who was added. `DELETE /v1/projects/{project_id}/members/{user_id}` removes a person, and returns 404 `member_not_found` when they were not added. See [Known limits](/reference/known-limits#projects-and-keys) for what a restricted project does not hide yet.

## API reference

Operations on this page: [`createProject`](/reference/api-reference#createproject), [`listProjects`](/reference/api-reference#listprojects), [`getProject`](/reference/api-reference#getproject), [`updateProject`](/reference/api-reference#updateproject), [`deleteProject`](/reference/api-reference#deleteproject), [`listProjectMembers`](/reference/api-reference#listprojectmembers), [`addProjectMember`](/reference/api-reference#addprojectmember), [`removeProjectMember`](/reference/api-reference#removeprojectmember).