Quickstart
Make your first model call with your own provider key. Then, if you need a sandbox, create one, run a command, and delete it.
For the model call, you need:
- The base URL and admin key you received when you joined the beta.
- A Google Gemini API key.
- curl.
The optional sandbox example uses a Daytona API key. The Python example runs both workflows and needs Python 3.9 or newer and the requests package.
Samples shorten IDs to eight characters after the prefix. Real IDs are longer.
1. Set your Meadow API key
Your account starts with one project, and your admin key belongs to it.
2. Store a model provider key
Store the Gemini API key Meadow will use for the model call.
Meadow checks the key with the provider before saving it, encrypts it, and never returns it. last4 identifies the stored key.
Other providers require different credential fields. See Provider keys.
3. Make a model call
Send the request in the OpenAI Chat Completions format, with your Meadow API key:
The response body is the provider’s, unchanged. Three response headers say who served it. Add -i to see them:
Meadow also takes the OpenAI Responses and Anthropic Messages formats. See Models. To point an OpenAI or Anthropic SDK at Meadow, see Use your existing tools.
4. Run a command in a sandbox (optional)
You need a stored sandbox provider key for this example. Store your Daytona API key:
This response was captured before 2026-11-28. Since then, the daytona response also carries sandbox_health, which reports whether recent sandbox creates failed. See Provider keys.
Create a sandbox and wait for it to run:
This response was captured on 2026-11-24, before each attempt carried reason, started_at and finished_at, which it does now. GET /v1/sandboxes/{sandbox_id} also returns a cost object: see Usage and cost.
The same create, the command and the delete were run again on the hosted beta on 2026-11-28, served by Modal: 202 with running, exit code 0 with Python 3.12.15, then 202 on the delete and 409 sandbox is not running for a command sent after it.
Read status. The call answers 202 whether the sandbox is running or failed. A failed sandbox says why in failure_reason and attempts. The usual cause is a misspelled image name.
Run a command, using the id from the response:
Delete the sandbox when you are done. It runs in your provider account and the provider bills you for it. timeout_seconds ends it after ten minutes if you forget.
A command sent to a sandbox that is not running returns a 409:
Every error body carries a request_id. Send it to support when you report a failed call.
If you stored no key for a sandbox provider, the create returns a 422 with the type no_provider_key and the message no usable sandbox provider key stored for allowed providers. Fix: store a daytona or modal key as shown at the start of this step.
5. Create a key for your code
The admin key manages your whole account. Keep it out of your application. Create a key that holds only the scopes the application needs. List your projects and copy the project ID for the application key:
secret is shown once. Store it now.
A key works only on the routes its scopes cover. This key has models, so a sandbox call with it returns a 403:
Fix: create a key with "scopes": ["models", "sandboxes"], or use a key that has the scope. A key’s scopes cannot be changed after it is created. Authentication lists the routes each scope covers.
The same steps in Python
This script stores both provider keys, makes the model call, and runs the sandbox example. Set all four environment variables shown above before running it.
On any error the script stops and prints the status and the error body. A delete can also return 202 when the provider is slow. Both mean the sandbox is ending.
If a step fails
Authentication
If the key is missing you get a 401:
Fix: check that MEADOW_API_KEY is set in this shell. A mistyped key returns invalid api key. Authentication lists every case.
Missing model provider key
If no stored key can serve the model, for example because you skipped step 2, you get a 422:
Fix: store a key for a provider that serves the model, then send the call again. GET /v1/models lists the model IDs your stored keys can reach. With no stored keys the list is empty.
Other errors
Errors explains every error type and when a retry is safe.
Next
- Concepts: accounts, projects, keys, and how a request is routed.
- Routing and fallbacks: store a second provider key and let Meadow fall back.
- Running commands: streamed output and long background commands.
- Known limits: read this before you build on the beta.
- API reference: every operation.
Operations used on this page: listProjects, putProviderKey, createChatCompletion, createSandbox, execInSandbox, deleteSandbox, createKey, listSandboxes.