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

# API reference

Meadow has 49 operations. The full contract is the OpenAPI 3.1 file that ships with these docs: every field, every status, and an example for each response. This page is the index. Each operation is listed under its `operationId`, the name the guides link to and the name client generators use.

Next step: find the operation, then read its guide for a worked example or the OpenAPI file for every field.

Every path is under your base URL. Every operation needs a Meadow key with the scope shown, except `getPricing`, which needs none. [Authentication](/set-up-your-account/authentication) covers keys and scopes, and [Errors](/reference/errors) covers the error body every operation shares.

## Models

These operations need the `models` scope.

### createChatCompletion

`POST /v1/chat/completions`

Create a chat completion (OpenAI Chat Completions format). Guide: [Models](/call-models/models).

### createResponse

`POST /v1/responses`

Create a response (OpenAI Responses format). Guide: [Models](/call-models/models).

### createMessage

`POST /v1/messages`

Create a message (Anthropic Messages format). Guide: [Models](/call-models/models).

### listModels

`GET /v1/models`

List the models this key can reach. Guide: [Models](/call-models/models#list-the-models-your-key-can-reach).

### generateContent

`POST /v1beta/models/{model}:generateContent`

Generate content (Gemini generateContent format). Also served at `/v1/models/{model}:generateContent`. Guide: [Gemini clients](/call-models/gemini-clients).

### streamGenerateContent

`POST /v1beta/models/{model}:streamGenerateContent`

Stream generated content (Gemini streamGenerateContent format), with `?alt=sse`. Also served under `/v1`. Guide: [Gemini clients](/call-models/gemini-clients).

## Sandboxes

These operations need the `sandboxes` scope.

### createSandbox

`POST /v1/sandboxes`

Create a sandbox. Guide: [Sandboxes](/run-sandboxes/sandboxes#create-a-sandbox).

### listSandboxes

`GET /v1/sandboxes`

List sandboxes. Guide: [Sandboxes](/run-sandboxes/sandboxes#list-sandboxes).

### routeSandbox

`POST /v1/sandboxes/route`

Show where a create would go. Guide: [Sandboxes](/run-sandboxes/sandboxes#see-where-a-create-would-go).

### getSandbox

`GET /v1/sandboxes/{sandbox_id}`

Get a sandbox. Guide: [Sandboxes](/run-sandboxes/sandboxes#statuses-and-the-lifecycle).

### updateSandbox

`PATCH /v1/sandboxes/{sandbox_id}`

Change a running sandbox's network rules. Guide: [Network rules](/run-sandboxes/network-rules#change-the-rules-on-a-running-sandbox).

### deleteSandbox

`DELETE /v1/sandboxes/{sandbox_id}`

Terminate a sandbox. Guide: [Sandboxes](/run-sandboxes/sandboxes#delete-a-sandbox).

## Commands

These operations need the `sandboxes` scope.

### execInSandbox

`POST /v1/sandboxes/{sandbox_id}/exec`

Run a command. Guide: [Running commands](/run-sandboxes/running-commands).

### getExec

`GET /v1/sandboxes/{sandbox_id}/execs/{exec_id}`

Read a background command. Guide: [Running commands](/run-sandboxes/running-commands#read-output).

### killExec

`DELETE /v1/sandboxes/{sandbox_id}/execs/{exec_id}`

Kill a background command. Guide: [Running commands](/run-sandboxes/running-commands#kill).

### writeExecStdin

`POST /v1/sandboxes/{sandbox_id}/execs/{exec_id}/stdin`

Send input to a background command. Guide: [Running commands](/run-sandboxes/running-commands#send-input).

## Files, ports, and SSH

These operations need the `sandboxes` scope.

### uploadFile

`PUT /v1/sandboxes/{sandbox_id}/files`

Write a file, or unpack a tar into a directory. Guide: [Files, ports, and SSH](/run-sandboxes/files-ports-and-ssh#files).

### downloadFile

`GET /v1/sandboxes/{sandbox_id}/files`

Read a file, or a directory as tar. Guide: [Files, ports, and SSH](/run-sandboxes/files-ports-and-ssh#files).

### getPort

`GET /v1/sandboxes/{sandbox_id}/ports/{port}`

Get the address of an exposed port. Guide: [Files, ports, and SSH](/run-sandboxes/files-ports-and-ssh#ports).

### createSshAccess

`POST /v1/sandboxes/{sandbox_id}/ssh`

Get SSH access to a sandbox. Guide: [Files, ports, and SSH](/run-sandboxes/files-ports-and-ssh#ssh).

## Images and build contexts

These operations need the `sandboxes` scope.

### createImage

`POST /v1/images`

Build an image from a Dockerfile. Guide: [Images and build contexts](/run-sandboxes/images-and-build-contexts#build-an-image-from-a-dockerfile).

### listImages

`GET /v1/images`

List images. Guide: [Images and build contexts](/run-sandboxes/images-and-build-contexts#list-get-and-delete).

### getImage

`GET /v1/images/{image_id}`

Get an image and its builds. Guide: [Images and build contexts](/run-sandboxes/images-and-build-contexts#list-get-and-delete).

### deleteImage

`DELETE /v1/images/{image_id}`

Delete an image. Guide: [Images and build contexts](/run-sandboxes/images-and-build-contexts#list-get-and-delete).

### createBuildContext

`POST /v1/build-contexts`

Upload local files for a Dockerfile build. Guide: [Images and build contexts](/run-sandboxes/images-and-build-contexts#build-with-local-files).

## Projects

These operations need the `admin` scope.

### createProject

`POST /v1/projects`

Create a project. Guide: [Projects](/set-up-your-account/projects#create-a-project).

### listProjects

`GET /v1/projects`

List projects. Guide: [Projects](/set-up-your-account/projects#read-projects).

### getProject

`GET /v1/projects/{project_id}`

Get a project. Guide: [Projects](/set-up-your-account/projects#read-projects).

### updateProject

`PATCH /v1/projects/{project_id}`

Update a project. Guide: [Projects](/set-up-your-account/projects#update-a-project).

### deleteProject

`DELETE /v1/projects/{project_id}`

Delete a project. Guide: [Projects](/set-up-your-account/projects#delete-a-project).

### listProjectMembers

`GET /v1/projects/{project_id}/members`

List the people added to a project. Guide: [Projects](/set-up-your-account/projects#restricted-projects).

### addProjectMember

`PUT /v1/projects/{project_id}/members/{user_id}`

Add a person of the account to a project. Adding them again changes nothing. Guide: [Projects](/set-up-your-account/projects#restricted-projects).

### removeProjectMember

`DELETE /v1/projects/{project_id}/members/{user_id}`

Remove a person from a project. Guide: [Projects](/set-up-your-account/projects#restricted-projects).

## Keys

These operations need the `admin` scope, except `getCurrentKey`, which any key can call.

### createKey

`POST /v1/keys`

Mint an API key. Guide: [Authentication](/set-up-your-account/authentication#create-a-key).

### listKeys

`GET /v1/keys`

List API keys. Guide: [Authentication](/set-up-your-account/authentication#list-keys).

### getCurrentKey

`GET /v1/key`

Get the key that made this call, with its usage. Works with any scope. Guide: [Authentication](/set-up-your-account/authentication#read-a-key-and-its-usage).

### getKey

`GET /v1/keys/{key_id}`

Get one API key, with its usage. Guide: [Authentication](/set-up-your-account/authentication#read-a-key-and-its-usage).

### updateKey

`PATCH /v1/keys/{key_id}`

Update an API key's name, limits or reset period, or switch it off. Guide: [Authentication](/set-up-your-account/authentication#update-or-switch-off-a-key).

### revokeKey

`DELETE /v1/keys/{key_id}`

Revoke an API key and every key minted from it. Guide: [Authentication](/set-up-your-account/authentication#revoke-a-key).

### rotateKey

`POST /v1/keys/{key_id}/rotate`

Give a key a new secret, with an optional grace period for the old one. Guide: [Authentication](/set-up-your-account/authentication#rotate-a-key).

## Provider keys

These operations need the `admin` scope.

### listProviderKeys

`GET /v1/provider-keys`

List stored vendor credentials. Guide: [Provider keys](/set-up-your-account/provider-keys#list-stored-keys).

### putProviderKey

`PUT /v1/provider-keys/{provider}`

Store or replace a vendor credential. Guide: [Provider keys](/set-up-your-account/provider-keys#store-a-key).

### verifyProviderKey

`POST /v1/provider-keys/{provider}/verify`

Check a stored vendor credential again. Guide: [Provider keys](/set-up-your-account/provider-keys#check-a-stored-key-again).

### deleteProviderKey

`DELETE /v1/provider-keys/{provider}`

Delete a vendor credential. Guide: [Provider keys](/set-up-your-account/provider-keys#delete-a-key).

## Budgets

### getAccountBudget

`GET /v1/budget`

Read the account's budget and its spend. Guide: [Budgets and alerts](/call-models/budgets-and-alerts#set-a-budget).

### putAccountBudget

`PUT /v1/budget`

Set or replace the account's budget. Guide: [Budgets and alerts](/call-models/budgets-and-alerts#set-a-budget).

### deleteAccountBudget

`DELETE /v1/budget`

Remove the account's budget. Guide: [Budgets and alerts](/call-models/budgets-and-alerts#set-a-budget).

### getProjectBudget

`GET /v1/projects/{project_id}/budget`

Read a project's budget and its spend. Guide: [Budgets and alerts](/call-models/budgets-and-alerts#set-a-budget).

### putProjectBudget

`PUT /v1/projects/{project_id}/budget`

Set or replace a project's budget. Guide: [Budgets and alerts](/call-models/budgets-and-alerts#set-a-budget).

### deleteProjectBudget

`DELETE /v1/projects/{project_id}/budget`

Remove a project's budget. Guide: [Budgets and alerts](/call-models/budgets-and-alerts#set-a-budget).

## Audit log

### listAuditLogs

`GET /v1/audit-logs`

List changes made to the account. Guide: [Audit log](/set-up-your-account/audit-log#read-it).

## Webhook

Meadow sends two webhooks: `sandboxEvent`, when a sandbox changes status, and `budgetEvent`, when spend reaches a budget threshold. The OpenAPI file describes their payloads. Guides: [Webhooks](/run-sandboxes/webhooks), [Budgets and alerts](/call-models/budgets-and-alerts#what-an-alert-is).

## Usage

Any key can call these. A key with the `admin` scope reads the whole account, any other key its own usage. `getPricing` needs no key.

### getPricing

`GET /v1/pricing`

Read the price table Meadow costs usage with, with `prices_as_of` per vendor and the vendors whose prices are stale. Guide: [Usage and cost](/call-models/usage-and-cost#the-prices-meadow-uses).

### getUsage

`GET /v1/usage`

Get usage and cost over a date range: totals, a time series, per-model and per-key figures, and sandbox figures. Guide: [Usage and cost](/call-models/usage-and-cost#read-usage-over-a-date-range).

### listUsageRequests

`GET /v1/usage/requests`

List recent model calls with tokens, cost, latency and request ids. Guide: [Usage and cost](/call-models/usage-and-cost#list-single-calls).

## People

These operations are for the Meadow dashboard. They take a signed-in person's session token, not a key: a key gets 403 `scope_missing`. With a session token, the other operations follow the person's role; the People tag of the OpenAPI file has the table.

### createAccessRequest

`POST /v1/access-requests`

Ask for access to the private beta. It needs no credential, and the Meadow website calls it from its server. Every valid request gets 202 `{"status":"received"}`. Guide: [Authentication](/set-up-your-account/authentication#people-in-the-dashboard).

### getInviteLink

`GET /v1/invite-links/{token}`

Read an open invite from its link, with no credential: the account name, the role, a masked address and the expiry. Any other token gets the same 404. Guide: [Authentication](/set-up-your-account/authentication#people-in-the-dashboard).

### getRetention

`GET /v1/retention`

Read how many days usage records and audit log entries are kept. Guide: [Usage and cost](/call-models/usage-and-cost).

### getMe

`GET /v1/me`

Get the signed-in person, their account with their role, and the invites they can accept. A person in no account gets 200 with no memberships.

### getMyPreferences

`GET /v1/me/preferences`

Get the signed-in person's saved dashboard layout.

### putMyPreferences

`PUT /v1/me/preferences`

Replace the signed-in person's saved dashboard layout, at most 16 KiB.

### listMembers

`GET /v1/members`

List the people in the account with their roles.

### updateMember

`PATCH /v1/members/{user_id}`

Change a person's role. Owners only. The last owner cannot take a lower role.

### removeMember

`DELETE /v1/members/{user_id}`

Remove a person, or leave the account yourself. The last owner cannot leave.

### listInvites

`GET /v1/invites`

List the open invites.

### createInvite

`POST /v1/invites`

Invite an address with a role. Owners only. An invite lasts 7 days and is used once.

### revokeInvite

`DELETE /v1/invites/{invite_id}`

Revoke an open invite. Owners only.

### acceptInvite

`POST /v1/invites/{invite_id}/accept`

Accept an invite sent to your verified email and join its account. Any signed-in person, before they belong to an account. The only way to join one.