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

# Provider keys

A provider key is a provider credential you store with Meadow. Meadow uses it to call that provider for you. You store one credential per provider for the whole account.

Next step: store a key for one model provider, then call `GET /v1/models` to see which models you can call.

All provider key routes need a Meadow API key with the `admin` scope.

## Store a key

```bash
curl -sS -X PUT "$MEADOW_BASE_URL/v1/provider-keys/google" \
  -H "Authorization: Bearer $MEADOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"credentials": {"api_key": "'"$GOOGLE_API_KEY"'"}}'
```

```json
{"created_at":"2026-11-23T22:14:47.509Z","last4":"a1B2","project_ids":null,"provider":"google","verified_at":"2026-11-23T22:15:12.266Z"}
```

Before it saves anything, Meadow makes one read call to the provider with the credential. The call usually takes under a second. If the provider rejects the credential, nothing is saved and the key you had stored before keeps working.

The response never contains the credential. `last4` is the last four characters of the key or key ID, so you can tell which one is stored. The samples on this page show made-up `last4` values. `verified_at` is the time of the check.

To keep the credential out of your shell history, use the `mdw` CLI, which reads it from standard input or a file. `mdw` is sent to you during the beta. See [Clients](/run-sandboxes/clients#install).

```bash
echo '{"api_key": "sk-..."}' | mdw provider-keys set openai
```

```text
mdw: 400 invalid_request: provider credential verification failed
```

That run used a made-up key, so the provider rejected it.

<a id="credentials-for-each-vendor"></a>

## Credentials for each provider

Unknown fields inside `credentials` return 400. Field names are lower case.

The "Live call tested" column says whether a real call through the hosted beta has succeeded with that provider. "Test server only" means the integration passes tests against a test server and no real call has succeeded yet. Run one call with your own key before you rely on such a provider.

<a id="model-vendors"></a>

### Model providers

| Provider | `credentials` fields | Live call tested |
| --- | --- | --- |
| `anthropic` | `api_key` | Yes |
| `openai` | `api_key` | Test server only |
| `google` | `api_key` | Yes |
| `xai` | `api_key` | Yes |
| `openrouter` | `api_key` | Yes |
| `azure` | `api_key`, `endpoint`, `deployments`, and optionally `api_version` | Test server only |
| `bedrock` | `access_key_id`, `secret_access_key`, `region`, and optionally `session_token` and `inference_profile`; or `api_key`, `region`, and optionally `inference_profile` | Test server only |
| `vertex` | `service_account_json`, `project`, `region` | Gemini: yes. Claude: served on a test server with an operator's Google token, not with a stored service account key |
| `fireworks` | `api_key` | Test server only |
| `deepseek` | `api_key` | Test server only |

#### anthropic

`api_key` is an Anthropic API key (`sk-ant-...`). Create one in the Anthropic Console under API keys. Meadow checks it by listing models.

#### openai

`api_key` is an OpenAI API key. Create one on the OpenAI platform under API keys. Meadow checks it by listing models.

The check does not prove the account has credit. An organization with no credit answers every call with 429 `insufficient_quota`. Meadow then falls back to the next provider, and the attempt reads `provider account has no quota or credit`. If nothing else serves the call you get a 502 with no `retry-after`, not a 429, because waiting does not help. Add credit in the OpenAI billing page.

#### google

`api_key` is a Gemini API key from Google AI Studio (Get API key). Meadow checks it by listing models.

#### xai

`api_key` is an xAI API key from the xAI console under API keys. Meadow checks it by listing models.

#### openrouter

`api_key` is an OpenRouter inference key from the Keys page. Meadow checks it by reading the key's own details. A management (provisioning) key is rejected, because it cannot make model calls. If your OpenRouter account uses guardrails, they still apply: a model the guardrail blocks fails at call time.

#### azure

`api_key`, `endpoint` and `deployments` are required. `api_version` and `deployment_types` are optional.

- `api_key`: a key of your Azure OpenAI resource. In the Azure portal, open the resource, then Keys and Endpoint.
- `endpoint`: the resource endpoint from the same page, as a bare `https` origin such as `https://my-resource.openai.azure.com`. No path, query, or port other than 443. The host must end in `.openai.azure.com`, `.cognitiveservices.azure.com`, or `.services.ai.azure.com`.
- `deployments`: an object that maps a Meadow model ID to your deployment name, such as `{"gpt-5": "my-gpt5"}`. It must have at least one entry. A model routes to Azure only when it is named here. Deployment names are on the Deployments page of your resource.
- `api_version`: leave it out to use Azure's v1 API, which takes no version. Meadow then calls `<endpoint>/openai/v1/chat/completions` and `<endpoint>/openai/v1/responses` with the deployment name as `model`. Send a version such as `2024-10-21` to use the dated API instead: `<endpoint>/openai/deployments/<deployment>/chat/completions` and `<endpoint>/openai/responses`, both with `?api-version=`. A stored version always wins over an `api-version` a caller sends.
- `deployment_types`: an object that maps a deployment name to its deployment type, as Azure names it, such as `{"my-gpt5": "GlobalStandard"}`. The type is on the Deployments page of your resource. Accepted types: `GlobalStandard`, `DataZoneStandard`, `Standard`, `GlobalProvisionedManaged`, `DataZoneProvisionedManaged`, `ProvisionedManaged`, `GlobalBatch`, `DataZoneBatch`, `DeveloperTier`. Azure's answer does not say which type served a call, so Meadow prices a call by this field: a `GlobalStandard` deployment at Azure's global prices, and every other type, or a deployment not named here, with no cost and a `cost_reason`. A key with a dollar `limit` can call only `GlobalStandard` deployments. See [Usage and cost](/call-models/usage-and-cost).

One credential holds one resource and one deployment per model. To reach a second deployment of the same model, pin it: `azure/<deployment>`. Microsoft Entra ID tokens are not accepted.

Meadow checks the key by listing models on the endpoint. That does not prove a deployment can be called: a resource Azure has blocked still lists its models and answers 403 on every deployment. Meadow falls back on that 403, and the attempt reads `provider resource is blocked by the vendor`.

#### bedrock

Send either an IAM access key (`access_key_id` and `secret_access_key`) or a Bedrock API key (`api_key`), not both. `region` is required. `session_token` goes with an access key only. `inference_profile` is optional with either.

- `access_key_id` and `secret_access_key`: an access key of an IAM user. In the AWS console, open IAM, the user, Security credentials, then Create access key. The user needs `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream`.
- `api_key`: a Bedrock API key. In the Bedrock console, open API keys and generate a key. Meadow sends it in `x-api-key` to Bedrock's Anthropic Messages route, `https://bedrock-runtime.<region>.amazonaws.com/anthropic/v1/messages`, with the body in Anthropic's format and the Bedrock model ID in `model`. A short-term key expires, so store a new one before it does.
- `region`: a standard AWS region name such as `us-east-1`.
- `session_token`: send it with temporary credentials from AWS STS.
- `inference_profile`: `global` (the default), `us`, `eu` or `none`. Bedrock invokes Claude models through an inference profile, and this picks the prefix of the model ID Meadow sends: `global.anthropic.<model>`, `us.anthropic.<model>`, `eu.anthropic.<model>`, or `anthropic.<model>` with no profile. A global profile lets AWS process a call in any region. Set `us` or `eu` to keep processing in one geography. `us` needs a `us-` region and `eu` an `eu-` region, or the call returns 400. For another geography, pin the ID: `bedrock/jp.anthropic.<model>`. Meadow does not check that AWS offers the profile for a model.

Role ARNs and AWS profiles are not accepted.

A Bedrock API key is stored without a check, because AWS's identity call does not take one. Make one model call after storing it.

Meadow checks an access key by asking AWS who it belongs to. That proves the key is valid. It does not prove the account may invoke Bedrock models, so make one model call after storing it. An account that may not invoke answers 400 `Operation not allowed`. Meadow falls back on that one 400, and the attempt reads `provider account is not allowed to invoke models`.

Storing temporary credentials was checked against AWS. No model call through Meadow has been served by Bedrock yet.

#### vertex

All three fields are required.

- `service_account_json`: the JSON key file of a Google Cloud service account, as a JSON object or as a string. In the Google Cloud console, open IAM and Admin, Service Accounts, the account, Keys, Add key, JSON. It must have `"type": "service_account"`, `client_email`, and `private_key`. The account needs a role that can call Vertex AI, such as Vertex AI User.
- `project`: the ID of the Google Cloud project whose Vertex AI serves the calls. It can differ from the service account's own project when the account has `aiplatform.endpoints.predict` there.
- `region`: `global`, the multi-regions `us` or `eu`, or one region such as `us-east5`.

Meadow checks the key in two steps. It exchanges the key for an access token, then asks Google whether the account has `aiplatform.endpoints.predict` on `project`. An account without it is rejected with 400 `vertex service account lacks aiplatform.endpoints.predict on credentials.project; grant it the Vertex AI User role there`. If Google does not answer that question, for example because the Resource Manager API is off in the project, the key is stored anyway.

The check does not prove that a model is enabled. Claude models must be enabled in Model Garden, per project. A model that is not enabled answers 404, and Meadow tries the next provider. Some new models answer 403 until data sharing is turned on for the publisher, and Meadow reports that 403 as a rejected credential. Make one model call after storing the key.

On Vertex, Claude takes the Messages format only and Gemini takes Chat Completions only.

#### fireworks

`api_key` is a Fireworks API key. Create one in the Fireworks dashboard at `https://app.fireworks.ai/settings/users/api-keys` with Create API key.

Fireworks documents no model list that a key alone can read: its List Models call needs an account ID. Meadow checks the key with `GET https://api.fireworks.ai/v1/accounts` (List Accounts), which takes only the key. A key that Fireworks lets call models but not list accounts would be rejected at store time. No real Fireworks key has been checked this way.

Meadow calls `https://api.fireworks.ai/inference/v1/chat/completions`, `/inference/v1/responses` and `/inference/v1/messages`, with the key as `Authorization: Bearer`. Pin a model with its full Fireworks ID: `fireworks/accounts/fireworks/models/kimi-k3`. See [Models](/call-models/models#pin-a-provider).

#### deepseek

`api_key` is a DeepSeek API key. Create one at `https://platform.deepseek.com/api_keys`. Meadow checks it by listing models (`GET https://api.deepseek.com/models`).

Meadow calls `https://api.deepseek.com/chat/completions`, `/responses` and `/anthropic/v1/messages`, with the key as `Authorization: Bearer`. Pin a model as `deepseek/deepseek-flash` or `deepseek/deepseek-v4-pro`.

DeepSeek's prices change with the hour of the call, so Meadow stores every DeepSeek call with no cost, and a key with a spend limit cannot call DeepSeek. See [Spend limits](/call-models/spend-limits#providers-without-a-price).

<a id="sandbox-vendors"></a>

### Sandbox providers

| Provider | `credentials` fields | Live call tested |
| --- | --- | --- |
| `daytona` | `api_key`, optional `organization_id` | Yes |
| `modal` | `token_id`, `token_secret`, optional `environment` | Yes |

#### daytona

`api_key` is a Daytona API key from the Daytona dashboard under API keys. Set `organization_id` if your key needs it to pick an organization. Meadow checks the key by listing sandboxes.

#### modal

`token_id` (`ak-...`) and `token_secret` (`as-...`) are a Modal API token from Modal's settings under API tokens. `environment` is the name of the Modal environment to create sandboxes in. Leave it out to use your workspace's default.

Meadow checks the token, then looks up the app it will use in that environment and rejects a token that is not allowed to use the environment. It does not catch an environment name that does not exist: in a test, a made-up environment name was accepted and stored. Check the spelling against the environment list in Modal.

Provider consoles change. If a menu named here has moved, look for the provider's API keys page.

## When the credential is wrong

```bash
curl -sS -X PUT "$MEADOW_BASE_URL/v1/provider-keys/google" \
  -H "Authorization: Bearer $MEADOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"credentials": {"api_key": "sk-not-a-real-key-000000"}}'
```

```json
{"error":{"code":"invalid_request","message":"provider credential verification failed","type":"invalid_request"},"request_id":"req_0000e5f0"}
```

That response has the shape from before the change of 2026-11-24. Since then the same rejection has `error.code` `provider_credentials_rejected` and `error.param` `credentials`. That is read from the server's code: no new sample was captured.

| Status | Message | Meaning and fix |
| --- | --- | --- |
| 400 | `provider credential verification failed` | The provider rejected the credential. Check for a truncated copy, a revoked key, or a key from another account. |
| 400 | `credentials.<field> is required` or `credentials are required` | A field is missing. |
| 400 | `unexpected field in credentials` | A field this provider does not take. |
| 400 | `unknown provider` | The path names a provider Meadow does not support. |
| 400 | `azure credentials.endpoint must be a bare https azure openai origin` | Remove the path and query from `endpoint`, and use an Azure OpenAI host. |
| 400 | `bedrock credentials.region must be an aws region such as us-east-1` | Use the region code. |
| 400 | `vertex credentials.service_account_json has no usable private key` | The JSON key file is damaged or incomplete. Download a new one. |
| 400 | `vertex service account lacks aiplatform.endpoints.predict on credentials.project; grant it the Vertex AI User role there` | Grant the role in the project named in `project`, then store the key again. |
| 400 | `openrouter management keys cannot make model calls; store an inference key` | Create a normal key in OpenRouter. |
| 400 | `modal token cannot use this environment` | Use a token with access to the environment, or change `environment`. |
| 404 | `one or more project_ids were not found` | A `project_ids` entry is not a project in your account. |
| 502 | `provider verification request failed` | Meadow could not reach the provider, or the provider answered with an error that is not about the credential. Nothing was saved. Retry. If it repeats, check the provider's status page and, for Azure, the `endpoint`. |

Meadow never puts the provider's own error text in these messages.

A key that was valid when stored can be rejected later, for example after you revoke it at the provider. Model calls then fall back to your next provider, and the response carries the header `x-meadow-provider-auth-failed` naming the provider whose key was rejected. Watch for that header.

## Limit a key to some projects

By default every project in the account can use a stored key. Send `project_ids` to limit it:

```bash
curl -sS -X PUT "$MEADOW_BASE_URL/v1/provider-keys/xai" \
  -H "Authorization: Bearer $MEADOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"credentials": {"api_key": "'"$XAI_API_KEY"'"}, "project_ids": ["'"$PROJECT_ID"'"]}'
```

```json
{"created_at":"2026-11-23T22:14:38.578Z","last4":"g7H8","project_ids":["prj_00005ae1"],"provider":"xai","verified_at":"2026-11-23T22:15:31.355Z"}
```

Other projects then behave as if no key for that provider were stored. Leaving `project_ids` out, or sending `null`, means every project. Each `PUT` replaces the whole entry, so send `project_ids` again every time you replace a scoped key.

You cannot store two credentials for one provider. To use different provider accounts for different workloads, you need separate Meadow accounts today.

## List stored keys

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

```json
{
  "data": [
    {"created_at":"2026-11-23T22:14:39.769Z","last4":"j9K0","project_ids":null,"provider":"anthropic","verified_at":"2026-11-23T22:14:39.762Z"},
    {"created_at":"2026-11-23T22:15:12.661Z","last4":"c3D4","project_ids":null,"provider":"daytona","verified_at":"2026-11-23T22:15:12.653Z"},
    {"created_at":"2026-11-23T22:14:47.509Z","last4":"a1B2","project_ids":null,"provider":"google","verified_at":"2026-11-23T22:15:12.266Z"}
  ],
  "has_more": false,
  "object": "list"
}
```

The output is trimmed to three entries. With the CLI:

```bash
mdw provider-keys list
```

```text
PROVIDER    LAST4  PROJECTS  VERIFIED
anthropic   j9K0   -         2026-11-23T22:14:39Z
daytona     c3D4   -         2026-11-23T22:15:12Z
google      a1B2   -         2026-11-23T22:15:12Z
modal       m1N2   -         2026-11-23T22:15:30Z
openrouter  p3Q4   -         2026-11-23T22:14:40Z
xai         g7H8   -         2026-11-23T22:15:31Z
```

A `daytona` or `modal` entry also has `sandbox_health`, in the list and in the response to its `PUT`. A `modal` entry from the list on the hosted beta on 2026-11-28:

```json
{"created_at":"2026-11-28T06:39:57.146Z","last4":"m5N6","project_ids":null,"provider":"modal","sandbox_health":{"consecutive_failures":0,"last_failure_at":null,"last_failure_reason":null,"last_success_at":null,"opened_at":null,"retry_at":null,"state":"closed"},"verified_at":"2026-11-28T06:39:57.140Z"}
```

It says whether recent sandbox creates on that provider failed and whether Meadow is trying it last for now. Its fields are `state`, `consecutive_failures`, `last_failure_reason` (a reason code from `attempts`, such as `quota_exceeded`), `last_failure_at`, `opened_at`, `retry_at` and `last_success_at`. The `daytona` entry in the sample above was captured before 2026-11-28, when the field did not exist yet.

| `state` | Meaning |
| --- | --- |
| `closed` | The provider is tried in its usual place. |
| `open` | It failed lately. Until `retry_at`, a create whose route has no order tries the other provider first. A route with an order moves it only after a quota or capacity answer, or 3 failures in a row. |
| `half_open` | One create is trying it again. That create's result closes it or opens it again. |

Storing the key again clears it. See [Sandboxes](/run-sandboxes/sandboxes#when-a-provider-is-failing).

<a id="rotate-a-vendor-key"></a>

## Rotate a provider key

1. Create the new key at the provider. Keep the old one active.
2. `PUT /v1/provider-keys/{provider}` with the new credential. Meadow checks it and swaps it in. If the check fails, the old key stays in place.
3. Confirm `last4` and `verified_at` changed, and make one call.
4. Revoke the old key at the provider.

New requests use the new key as soon as the `PUT` returns. Requests already in flight finish on the old key, which is why step 4 comes last. For Modal, a server can keep using the old token for up to 5 minutes after the swap, so wait that long before you revoke it at Modal.

## Check a stored key again

Not on the hosted beta yet.

```bash
curl -sS -X POST "$MEADOW_BASE_URL/v1/provider-keys/anthropic/verify" \
  -H "Authorization: Bearer $MEADOW_API_KEY"
```

Meadow runs the same check as a `PUT` on the credential it holds, so you need not paste it again. When the provider accepts it, `verified_at` moves to now and the key is returned. When the provider rejects it, the call returns 400 `provider_credentials_rejected` and the stored credential and its `verified_at` stay as they were: store a new credential with `PUT`.

## Delete a key

```bash
curl -sS -X DELETE "$MEADOW_BASE_URL/v1/provider-keys/bedrock" \
  -H "Authorization: Bearer $MEADOW_API_KEY"
```

A successful delete returns 204 with no body. This run named a provider with no stored key:

```json
{"error":{"code":"provider_key_not_found","message":"provider key not found","type":"not_found"},"request_id":"req_0000c975"}
```

After a delete, requests that need that provider skip it. If no other provider can serve a request, it gets a 422 `no_provider_key`. Deleting the key in Meadow does not revoke it at the provider.

## API reference

Operations on this page: [`putProviderKey`](/reference/api-reference#putproviderkey), [`listProviderKeys`](/reference/api-reference#listproviderkeys), [`verifyProviderKey`](/reference/api-reference#verifyproviderkey), [`deleteProviderKey`](/reference/api-reference#deleteproviderkey).