Skip to navigation

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 covers keys and scopes, and 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.

createResponse

POST /v1/responses

Create a response (OpenAI Responses format). Guide: Models.

createMessage

POST /v1/messages

Create a message (Anthropic Messages format). Guide: Models.

listModels

GET /v1/models

List the models this key can reach. Guide: Models.

generateContent

POST /v1beta/models/{model}:generateContent

Generate content (Gemini generateContent format). Also served at /v1/models/{model}:generateContent. Guide: Gemini clients.

streamGenerateContent

POST /v1beta/models/{model}:streamGenerateContent

Stream generated content (Gemini streamGenerateContent format), with ?alt=sse. Also served under /v1. Guide: Gemini clients.

Sandboxes

These operations need the sandboxes scope.

createSandbox

POST /v1/sandboxes

Create a sandbox. Guide: Sandboxes.

listSandboxes

GET /v1/sandboxes

List sandboxes. Guide: Sandboxes.

routeSandbox

POST /v1/sandboxes/route

Show where a create would go. Guide: Sandboxes.

getSandbox

GET /v1/sandboxes/{sandbox_id}

Get a sandbox. Guide: Sandboxes.

updateSandbox

PATCH /v1/sandboxes/{sandbox_id}

Change a running sandbox’s network rules. Guide: Network rules.

deleteSandbox

DELETE /v1/sandboxes/{sandbox_id}

Terminate a sandbox. Guide: Sandboxes.

Commands

These operations need the sandboxes scope.

execInSandbox

POST /v1/sandboxes/{sandbox_id}/exec

Run a command. Guide: Running commands.

getExec

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

Read a background command. Guide: Running commands.

killExec

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

Kill a background command. Guide: Running commands.

writeExecStdin

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

Send input to a background command. Guide: Running commands.

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.

downloadFile

GET /v1/sandboxes/{sandbox_id}/files

Read a file, or a directory as tar. Guide: Files, ports, and SSH.

getPort

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

Get the address of an exposed port. Guide: Files, ports, and SSH.

createSshAccess

POST /v1/sandboxes/{sandbox_id}/ssh

Get SSH access to a sandbox. Guide: Files, ports, and 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.

listImages

GET /v1/images

List images. Guide: Images and build contexts.

getImage

GET /v1/images/{image_id}

Get an image and its builds. Guide: Images and build contexts.

deleteImage

DELETE /v1/images/{image_id}

Delete an image. Guide: Images and build contexts.

createBuildContext

POST /v1/build-contexts

Upload local files for a Dockerfile build. Guide: Images and build contexts.

Projects

These operations need the admin scope.

createProject

POST /v1/projects

Create a project. Guide: Projects.

listProjects

GET /v1/projects

List projects. Guide: Projects.

getProject

GET /v1/projects/{project_id}

Get a project. Guide: Projects.

updateProject

PATCH /v1/projects/{project_id}

Update a project. Guide: Projects.

deleteProject

DELETE /v1/projects/{project_id}

Delete a project. Guide: Projects.

listProjectMembers

GET /v1/projects/{project_id}/members

List the people added to a project. Guide: 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.

removeProjectMember

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

Remove a person from a project. Guide: 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.

listKeys

GET /v1/keys

List API keys. Guide: Authentication.

getCurrentKey

GET /v1/key

Get the key that made this call, with its usage. Works with any scope. Guide: Authentication.

getKey

GET /v1/keys/{key_id}

Get one API key, with its usage. Guide: Authentication.

updateKey

PATCH /v1/keys/{key_id}

Update an API key’s name, limits or reset period, or switch it off. Guide: Authentication.

revokeKey

DELETE /v1/keys/{key_id}

Revoke an API key and every key minted from it. Guide: Authentication.

rotateKey

POST /v1/keys/{key_id}/rotate

Give a key a new secret, with an optional grace period for the old one. Guide: Authentication.

Provider keys

These operations need the admin scope.

listProviderKeys

GET /v1/provider-keys

List stored vendor credentials. Guide: Provider keys.

putProviderKey

PUT /v1/provider-keys/{provider}

Store or replace a vendor credential. Guide: Provider keys.

verifyProviderKey

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

Check a stored vendor credential again. Guide: Provider keys.

deleteProviderKey

DELETE /v1/provider-keys/{provider}

Delete a vendor credential. Guide: Provider keys.

Budgets

getAccountBudget

GET /v1/budget

Read the account’s budget and its spend. Guide: Budgets and alerts.

putAccountBudget

PUT /v1/budget

Set or replace the account’s budget. Guide: Budgets and alerts.

deleteAccountBudget

DELETE /v1/budget

Remove the account’s budget. Guide: Budgets and alerts.

getProjectBudget

GET /v1/projects/{project_id}/budget

Read a project’s budget and its spend. Guide: Budgets and alerts.

putProjectBudget

PUT /v1/projects/{project_id}/budget

Set or replace a project’s budget. Guide: Budgets and alerts.

deleteProjectBudget

DELETE /v1/projects/{project_id}/budget

Remove a project’s budget. Guide: Budgets and alerts.

Audit log

listAuditLogs

GET /v1/audit-logs

List changes made to the account. Guide: Audit log.

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, Budgets and alerts.

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.

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.

listUsageRequests

GET /v1/usage/requests

List recent model calls with tokens, cost, latency and request ids. Guide: Usage and cost.

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.

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.

getRetention

GET /v1/retention

Read how many days usage records and audit log entries are kept. Guide: 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.