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

# Store or replace a vendor credential

PUT https%3A%2F%2Fapi.usemeadow.ai/v1/provider-keys/{provider}
Content-Type: application/json

Stores the credential for one provider, replacing any credential stored for it
before. Meadow first makes one cheap read call to the vendor to check the
credential. A credential the vendor rejects is not saved and the call returns
400\. If the vendor cannot be reached the call returns 502, and you can retry.

`credentials` depends on the provider:

| Provider                                                                      | Fields                                                                                                                                                             |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `anthropic`, `openai`, `google`, `xai`, `openrouter`, `fireworks`, `deepseek` | `api_key`                                                                                                                                                          |
| `azure`                                                                       | `api_key`, `endpoint`, `deployments`, and optionally `api_version` and `deployment_types`                                                                          |
| `bedrock`                                                                     | `access_key_id`, `secret_access_key`, `region`, and optionally `session_token` and `inference_profile`; or `api_key`, `region`, and optionally `inference_profile` |
| `vertex`                                                                      | `service_account_json`, `project`, `region`                                                                                                                        |
| `daytona`                                                                     | `api_key`, and optionally `organization_id`                                                                                                                        |
| `modal`                                                                       | `token_id`, `token_secret`, and optionally `environment`                                                                                                           |

Rules:

* A field that is not in the table returns 400.
* `azure`: `endpoint` is the bare `https` origin of your Azure OpenAI resource.
  `deployments` maps a Meadow model id to your deployment name and must not be
  empty. It decides which unpinned models route to Azure. A model id written
  `azure/<deployment>` is sent to that deployment as written. Leave
  `api_version` out to use Azure's v1 API, which takes no `api-version`. Send
  it to use the dated API. One credential holds one resource and one deployment
  per model. `deployment_types` maps a deployment name to Azure's deployment
  type code (`GlobalStandard`, `DataZoneStandard`, `Standard`,
  `GlobalProvisionedManaged`, `DataZoneProvisionedManaged`, `ProvisionedManaged`,
  `GlobalBatch`, `DataZoneBatch`, `DeveloperTier`). Calls are priced only on a
  `GlobalStandard` deployment; another type, or none, leaves the call with no cost.
* `bedrock`: an IAM user access key, or a Bedrock API key in `api_key` (not
  both). `region` is a standard AWS region name such as `us-east-1`. Send
  `session_token` with temporary credentials from STS. With `api_key`, Meadow
  calls Bedrock's Anthropic Messages route (`/anthropic/v1/messages`) and does
  not check the key with AWS before storing it. `inference_profile` is
  `global` (the default), `us`, `eu` or `none`, and decides where AWS may
  process a call: see Bedrock under Models. `us` needs a `us-` region and `eu`
  an `eu-` region, or the call returns 400.
* `vertex`: `service_account_json` is the service account key, as a JSON object
  or as a string holding it. `project` is the project whose Vertex AI serves the
  calls. `region` is `global`, the multi-regions `us` or `eu`, or one region
  such as `us-east5`. The `token_uri` inside the key is ignored. The service
  account needs `aiplatform.endpoints.predict` on `project` (the Vertex AI User
  role has it), or the call returns 400.
* The check at store time does not prove that a model call will work. Azure's
  check lists models and Bedrock's asks AWS who the key is. Both pass for an
  account that may not invoke models. Make one small call after you store a
  credential.
* `openrouter`: store an inference key. A management key returns 400.
* `fireworks`: the check is `GET https://api.fireworks.ai/v1/accounts`.
  `deepseek`: the check is `GET https://api.deepseek.com/models`.
* `anthropic`: a Claude Code login token is accepted as `api_key`.
* `project_ids` limits the credential to those projects. Left out or `null`
  means every project. Always send it for a credential that should be scoped.
  An id that does not exist returns 404.
* After a Modal credential is replaced or deleted, the old token can stay in use
  for up to 5 minutes.

Scope: `admin`.

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

Reference: https://docs.usemeadow.ai/api-endpoints/provider-keys/put-provider-key

## Authentication

- `Authorization` header (bearer token, required) — A Meadow API key, sent as `Authorization: Bearer mdw_...`. The header `x-api-key: mdw_...` is accepted in its place.

## Request

### Path parameters

- `provider` (enum, required) — The provider the credential belongs to.
  - Allowed values: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`, `daytona`, `modal`

### Body (application/json)

This endpoint expects a ProviderKeyWrite.

- `credentials` (map from string to any, required) — The vendor credential. Its fields depend on the provider. * `anthropic`, `openai`, `google`, `xai`, `openrouter`, `fireworks`, `deepseek`: `{api_key}`. * `azure`: `{api_key, endpoint, deployments}`, and optionally `api_version` and `deployment_types` (deployment name to Azure's deployment type code, such as `GlobalStandard`; only a `GlobalStandard` deployment is priced). `endpoint` is the bare resource origin, such as `https://<resource>.openai.azure.com`. `deployments` maps a Meadow model id to your deployment name. It decides which unpinned models route to Azure. `azure/<deployment>` sends an unmapped name as written. Without `api_version` Meadow calls Azure's v1 API (`/openai/v1/chat/completions`, `/openai/v1/responses`) with the deployment name as `model`. With `api_version` it calls the dated API (`/openai/deployments/<deployment>/chat/completions` and `/openai/responses`, both with `?api-version=`). One key holds one resource. * `bedrock`: `{access_key_id, secret_access_key, region}`, and optionally `session_token` and `inference_profile`. An IAM access key, signed with SigV4. `region` is a standard AWS region name. `session_token` is for temporary credentials. Or `{api_key, region}` with an optional `inference_profile`: a Bedrock API key, sent in `x-api-key` to Bedrock's Anthropic Messages route. A credential holds one of the two, not both. `inference_profile` is one of `global` (the default), `us`, `eu` or `none`. It sets the prefix of the Bedrock model id for models Meadow picks: `global.anthropic.<model>`, `us.anthropic.<model>`, `eu.anthropic.<model>`, or `anthropic.<model>` with no profile. `us` needs a `us-` region (not `us-gov-`) and `eu` needs an `eu-` region, or the write returns 400. A pinned id such as `bedrock/us.anthropic.<model>` is always sent as written. * `vertex`: `{service_account_json, project, region}`. `project` is the project whose Vertex AI serves the calls. It may differ from the service account's own project when the account has `aiplatform.endpoints.predict` there. `region` is `global`, the multi-regions `us` or `eu`, or a single region such as `us-east5`. The `token_uri` inside `service_account_json` is ignored. * `daytona`: `{api_key}`, and optionally `organization_id`. * `modal`: `{token_id, token_secret}`, and optionally `environment`. Any other field returns 400. Each credential is checked when it is stored: one read call for the API key providers and Azure (its model list), STS `GetCallerIdentity` for `bedrock`, and for `vertex` a token exchange plus a check that the account has `aiplatform.endpoints.predict` on `project`. A stored `bedrock` or `azure` credential can still be refused at call time by an account that may not invoke models.
- `project_ids` (list of string, optional, nullable) — Limit the credential to these projects. Null or left out means every project.

## Response

### 200

Checked against the vendor and stored.

- `provider` (enum, required) — The name of a vendor. Model providers and sandbox providers share one list. Model providers: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`. Sandbox providers: `daytona`, `modal`.
  - Allowed values: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`, `daytona`, `modal`
- `created_at` (datetime, required) — When a credential for this provider was first stored. Replacing it does not change this.
- `last4` (string, optional) — The last four characters of the stored key (for `modal`, of the token id).
- `project_ids` (list of string, optional, nullable) — The projects that may use the credential. Null means every project.
- `verified_at` (datetime, optional, nullable) — When Meadow last checked the credential against the vendor.
- `sandbox_health` (SandboxProviderHealth, optional) — What Meadow remembers about recent sandbox creates on this provider with this account's key. Present for `daytona` and `modal` only. It is a circuit breaker. `closed`: the provider is tried in its usual place. `open`: it failed lately, so a create with another provider in its route tries the other one first, until `retry_at`. `half_open`: one create is trying it again, and that create's result closes it or opens it again. A provider opens after 3 failed creates in a row within 10 minutes (timeout or vendor error), for 60 seconds, or after one quota, capacity or rate limit answer, for 30 seconds. A rejected key (401 or 403) does not count. An order the caller or the project set moves an open provider only on a hard signal: a quota or capacity answer, or the 3 failures in a row. A route with one provider is never reordered. Storing the key again clears it.

## Errors

### 400 Bad Request Error

A field is missing or not allowed, the provider name is unknown, or the vendor rejected the credential. Nothing was stored.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 401 Unauthorized Error

The key is missing, malformed, unknown, revoked, or expired, or a key it was minted from no longer exists. Check the key and the header.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 403 Forbidden Error

The key does not have the `admin` scope. Use an admin key.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 404 Not Found Error

An id in `project_ids` does not exist in the account.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 413 Content Too Large Error

The request body is larger than this route allows: 1 MiB for JSON bodies, 16 MiB on the model routes, 100 MiB for a file upload, and 100 MB for a build context.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 429 Too Many Requests Error

More than 20 failed authentications came from your address in one minute, and this request also failed to authenticate: fix the key, wait for `retry-after` seconds, then retry. Or the server instance was full and no slot came free for the account within 3 seconds (`error.code` `account_in_flight_limit_exceeded`): wait for `retry-after` seconds, then retry.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 500 Internal Server Error

Meadow failed. Retry with backoff, and tell us if it persists.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 502 Bad Gateway Error

Meadow could not reach the vendor to check the credential. Nothing was stored. Retry.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

## Types

### SandboxProviderHealth

What Meadow remembers about recent sandbox creates on this provider with this account's key. Present for `daytona` and `modal` only. It is a circuit breaker. `closed`: the provider is tried in its usual place. `open`: it failed lately, so a create with another provider in its route tries the other one first, until `retry_at`. `half_open`: one create is trying it again, and that create's result closes it or opens it again. A provider opens after 3 failed creates in a row within 10 minutes (timeout or vendor error), for 60 seconds, or after one quota, capacity or rate limit answer, for 30 seconds. A rejected key (401 or 403) does not count. An order the caller or the project set moves an open provider only on a hard signal: a quota or capacity answer, or the 3 failures in a row. A route with one provider is never reordered. Storing the key again clears it.

- `state` (enum, required)
  - Allowed values: `closed`, `open`, `half_open`
- `consecutive_failures` (integer, required) — Failed creates in the current run of failures.
- `last_failure_reason` (string, optional, nullable) — The reason code of the last counted failure, as in `attempts[].reason`.
- `last_failure_at` (datetime, optional, nullable)
- `opened_at` (datetime, optional, nullable) — When the provider last went from `closed` to `open`.
- `retry_at` (datetime, optional, nullable) — While `open`: when the next create may try the provider again.
- `last_success_at` (datetime, optional, nullable) — The last create that ended a run of failures.

### ErrorError

- `type` (enum, required) — The class of the failure. - `invalid_request`: the request is malformed or breaks a rule (400), or is too large (413). - `conflict`: the request is valid and the current state refuses it (409). Before 2026-11-24 a 409 used `invalid_request`. - `unauthorized`: the key is missing, unknown, revoked, or expired (401). - `forbidden`: the key's scope or limit does not allow this, or the project's routing is locked (403). - `not_found`: no such resource or route (404). - `no_provider_key`: no stored credential can serve this request (422). - `all_providers_failed`: every vendor in the route was tried (502). - `provider_error`: a vendor failed and no fallback was possible (502). - `rate_limited`: too many requests (429). - `insufficient_quota`: a dollar `limit` on the key, or on a key above it, is spent (402). The name is OpenAI's. - `unavailable`: a dependency Meadow needs is not set up (503). - `internal`: Meadow failed (500), or the feature is not set up (501).
  - Allowed values: `invalid_request`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `no_provider_key`, `all_providers_failed`, `provider_error`, `rate_limited`, `insufficient_quota`, `unavailable`, `internal`
- `message` (string, required) — A sentence for people. It can change, so do not match on it.
- `code` (string, optional) — A stable name for the specific failure. Every Meadow error carries one. `type` stays the general class, and several codes share a type. Branch on `code` when you need to tell two failures of one type apart, for example `api_key_expired` from `api_key_revoked`. The full list is in the Errors guide. A new code can be added at any time, so treat a code you do not know as its `type`. A spent limit (`key_request_limit_exceeded`, `key_token_limit_exceeded`) stays a 403 and not a 429, so a client that retries a 429 does not resend a call a spent key can never make. A spent dollar `limit` (`key_spend_limit_exceeded`) is a 402 for the same reason.
- `param` (string, optional) — The request field, query parameter or header the error is about, when there is one. A nested field is written with dots, such as `credentials.api_key`. Set on most validation errors (400).
- `attempts` (list of Attempt, optional) — The vendors Meadow tried for this request, in order. Present only when it tried at least one.
- `retry` (enum, optional) — Whether to send the same request again. Set on routes under `/v1/sandboxes` only. The values are BoxRouter's (https://boxrouter.ai/docs/error-codes). - `safe`: send the same request again, after `retry-after` seconds when the response has that header. A 429, a 409 `exec_start_in_progress` or `idempotency_request_in_progress`, a 502 `sandbox_unreachable`, and a 5xx on a `GET`, `PUT` or `DELETE`, on `POST /v1/sandboxes/route`, or on a sandbox create or background command start sent with `Idempotency-Key`. - `after_fix`: change the request, the key or the account first. Any other 4xx. - `check_outcome`: read the sandbox or the command before you send it again, because the work may have happened. A 5xx on any other `POST`, which includes a blocking command. - `never`: do not send it again. A 501. When the response has `x-should-retry`, `retry` is `safe` exactly when the header is `true`.
  - Allowed values: `safe`, `after_fix`, `check_outcome`, `never`
- `outcome` (enum, optional) — What happened to the work. Set on routes under `/v1/sandboxes` only. The values are BoxRouter's (https://boxrouter.ai/docs/error-codes). - `not_started`: nothing was changed. Every 4xx, a 501, and a 502 `sandbox_unreachable`. - `unknown`: the work may have happened. Any other 5xx. - `completed` and `partial`: the work happened, in whole or in part. Meadow does not send them today. Handle them as `unknown`. A sandbox create that fails after Meadow accepted it is not an error response: the create returns 202, and the sandbox later has `status` `failed` and a `failure_reason`.
  - Allowed values: `not_started`, `completed`, `partial`, `unknown`

### Attempt

One try at one vendor, for a model call or a sandbox create.

- `provider` (enum, required) — The name of a vendor. Model providers and sandbox providers share one list. Model providers: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`. Sandbox providers: `daytona`, `modal`.
  - Allowed values: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`, `daytona`, `modal`
- `outcome` (enum, required) — How the try ended. - `served`: this vendor served the request. - `unsupported`: the vendor cannot do what was asked, such as a resource size, a network rule, or a model it does not offer. - `refused`: the vendor rejected the request or the stored credential. - `no_capacity`: the vendor had no capacity. - `timeout`: the vendor did not answer in time. - `rate_limited`: the vendor answered 429. - `error`: any other failure.
  - Allowed values: `served`, `unsupported`, `refused`, `no_capacity`, `timeout`, `rate_limited`, `error`
- `reason` (enum, optional) — A stable code for why the try ended as it did. It is narrower than `outcome`, and it is the code to branch on or to count. More values can be added: treat one you do not know like `vendor_error`. - `served`: this vendor served the request. - `no_capacity`: the vendor had no capacity. - `quota_exceeded`: the vendor account is out of quota or credit. - `rate_limited`: the vendor answered 429. - `timeout`: the vendor did not answer in time. - `auth_failed`: the vendor rejected the stored vendor key. - `invalid_request`: the vendor rejected the request itself. - `refused`: the vendor refused for another reason. - `unsupported`: the vendor cannot do what was asked, such as a model, a GPU type, a size or a network rule. - `no_provider_key`: skipped, because no usable vendor key was stored. - `image_pull_failed`, `build_failed`: the vendor could not pull or build the image (sandboxes). - `provider_lost`: the vendor lost the sandbox while it was starting. - `vendor_error`: any other failure.
  - Allowed values: `served`, `no_capacity`, `quota_exceeded`, `rate_limited`, `timeout`, `auth_failed`, `invalid_request`, `refused`, `unsupported`, `no_provider_key`, `image_pull_failed`, `build_failed`, `provider_lost`, `vendor_error`
- `started_at` (datetime, optional) — When Meadow started this try. Absent on attempts recorded before 2026-11-24.
- `finished_at` (datetime, optional) — When this try ended.
- `detail` (string, optional) — A short description of what happened, written by Meadow, such as `provider returned HTTP 404`. On a `served` sandbox attempt it reports resources the vendor granted that differ from the request, such as `provider granted cpu 2 instead of 1.5` or `gpu type H200 instead of H100`. It says `provider built a copy of the image for this size` when this create made a new Daytona snapshot for an `image_id`. On an `unsupported` attempt it carries the vendor's size limit, such as `daytona cannot serve this size: CPU request 8 exceeds maximum allowed per sandbox (4)`. Absent when there is nothing to say.
- `duration_ms` (integer, optional) — How long the try took, in milliseconds.

## Examples

### A replaced credential keeps its created_at (last4 replaced)

**Response**

```json
{
  "provider": "anthropic",
  "created_at": "2026-11-23T22:14:39.769Z",
  "last4": "a1B2",
  "project_ids": null,
  "verified_at": "2026-11-23T22:18:57.864Z"
}
```

**SDK Code**

```python A replaced credential keeps its created_at (last4 replaced)
import requests

url = "https://api.example.com/v1/provider-keys/anthropic"

headers = {"Authorization": "Bearer <token>"}

response = requests.put(url, headers=headers)

print(response.json())
```

```javascript A replaced credential keeps its created_at (last4 replaced)
const url = 'https://api.example.com/v1/provider-keys/anthropic';
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go A replaced credential keeps its created_at (last4 replaced)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/provider-keys/anthropic"

	req, _ := http.NewRequest("PUT", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby A replaced credential keeps its created_at (last4 replaced)
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/provider-keys/anthropic")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java A replaced credential keeps its created_at (last4 replaced)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.example.com/v1/provider-keys/anthropic")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php A replaced credential keeps its created_at (last4 replaced)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.example.com/v1/provider-keys/anthropic', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp A replaced credential keeps its created_at (last4 replaced)
using RestSharp;

var client = new RestClient("https://api.example.com/v1/provider-keys/anthropic");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift A replaced credential keeps its created_at (last4 replaced)
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/provider-keys/anthropic")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### A provider that takes one API key

**Request**

```json
{
  "credentials": {
    "api_key": "YOUR_VENDOR_API_KEY"
  }
}
```

**Response**

```json
{
  "provider": "anthropic",
  "created_at": "2026-11-23T22:14:39.769Z",
  "last4": "a1B2",
  "project_ids": null,
  "verified_at": "2026-11-23T22:18:57.864Z"
}
```

**SDK Code**

```python A provider that takes one API key
import requests

url = "https://api.example.com/v1/provider-keys/anthropic"

payload = { "credentials": { "api_key": "YOUR_VENDOR_API_KEY" } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript A provider that takes one API key
const url = 'https://api.example.com/v1/provider-keys/anthropic';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"credentials":{"api_key":"YOUR_VENDOR_API_KEY"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go A provider that takes one API key
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/provider-keys/anthropic"

	payload := strings.NewReader("{\n  \"credentials\": {\n    \"api_key\": \"YOUR_VENDOR_API_KEY\"\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby A provider that takes one API key
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/provider-keys/anthropic")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"credentials\": {\n    \"api_key\": \"YOUR_VENDOR_API_KEY\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java A provider that takes one API key
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.example.com/v1/provider-keys/anthropic")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"credentials\": {\n    \"api_key\": \"YOUR_VENDOR_API_KEY\"\n  }\n}")
  .asString();
```

```php A provider that takes one API key
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.example.com/v1/provider-keys/anthropic', [
  'body' => '{
  "credentials": {
    "api_key": "YOUR_VENDOR_API_KEY"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp A provider that takes one API key
using RestSharp;

var client = new RestClient("https://api.example.com/v1/provider-keys/anthropic");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"credentials\": {\n    \"api_key\": \"YOUR_VENDOR_API_KEY\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift A provider that takes one API key
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["credentials": ["api_key": "YOUR_VENDOR_API_KEY"]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/provider-keys/anthropic")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Modal

**Request**

```json
{
  "credentials": {
    "environment": "main",
    "token_id": "YOUR_MODAL_TOKEN_ID",
    "token_secret": "YOUR_MODAL_TOKEN_SECRET"
  }
}
```

**Response**

```json
{
  "provider": "anthropic",
  "created_at": "2026-11-23T22:14:39.769Z",
  "last4": "a1B2",
  "project_ids": null,
  "verified_at": "2026-11-23T22:18:57.864Z"
}
```

**SDK Code**

```python Modal
import requests

url = "https://api.example.com/v1/provider-keys/anthropic"

payload = { "credentials": {
        "environment": "main",
        "token_id": "YOUR_MODAL_TOKEN_ID",
        "token_secret": "YOUR_MODAL_TOKEN_SECRET"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Modal
const url = 'https://api.example.com/v1/provider-keys/anthropic';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"credentials":{"environment":"main","token_id":"YOUR_MODAL_TOKEN_ID","token_secret":"YOUR_MODAL_TOKEN_SECRET"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Modal
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/provider-keys/anthropic"

	payload := strings.NewReader("{\n  \"credentials\": {\n    \"environment\": \"main\",\n    \"token_id\": \"YOUR_MODAL_TOKEN_ID\",\n    \"token_secret\": \"YOUR_MODAL_TOKEN_SECRET\"\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Modal
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/provider-keys/anthropic")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"credentials\": {\n    \"environment\": \"main\",\n    \"token_id\": \"YOUR_MODAL_TOKEN_ID\",\n    \"token_secret\": \"YOUR_MODAL_TOKEN_SECRET\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Modal
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.example.com/v1/provider-keys/anthropic")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"credentials\": {\n    \"environment\": \"main\",\n    \"token_id\": \"YOUR_MODAL_TOKEN_ID\",\n    \"token_secret\": \"YOUR_MODAL_TOKEN_SECRET\"\n  }\n}")
  .asString();
```

```php Modal
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.example.com/v1/provider-keys/anthropic', [
  'body' => '{
  "credentials": {
    "environment": "main",
    "token_id": "YOUR_MODAL_TOKEN_ID",
    "token_secret": "YOUR_MODAL_TOKEN_SECRET"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Modal
using RestSharp;

var client = new RestClient("https://api.example.com/v1/provider-keys/anthropic");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"credentials\": {\n    \"environment\": \"main\",\n    \"token_id\": \"YOUR_MODAL_TOKEN_ID\",\n    \"token_secret\": \"YOUR_MODAL_TOKEN_SECRET\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Modal
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["credentials": [
    "environment": "main",
    "token_id": "YOUR_MODAL_TOKEN_ID",
    "token_secret": "YOUR_MODAL_TOKEN_SECRET"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/provider-keys/anthropic")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Azure, limited to one project

**Request**

```json
{
  "credentials": {
    "api_key": "YOUR_AZURE_API_KEY",
    "api_version": "2024-10-21",
    "deployments": {
      "gpt-4o": "my-gpt4o-deployment"
    },
    "endpoint": "https://your-resource.openai.azure.com"
  },
  "project_ids": [
    "prj_000057e9"
  ]
}
```

**Response**

```json
{
  "provider": "anthropic",
  "created_at": "2026-11-23T22:14:39.769Z",
  "last4": "a1B2",
  "project_ids": null,
  "verified_at": "2026-11-23T22:18:57.864Z"
}
```

**SDK Code**

```python Azure, limited to one project
import requests

url = "https://api.example.com/v1/provider-keys/anthropic"

payload = {
    "credentials": {
        "api_key": "YOUR_AZURE_API_KEY",
        "api_version": "2024-10-21",
        "deployments": { "gpt-4o": "my-gpt4o-deployment" },
        "endpoint": "https://your-resource.openai.azure.com"
    },
    "project_ids": ["prj_000057e9"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Azure, limited to one project
const url = 'https://api.example.com/v1/provider-keys/anthropic';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"credentials":{"api_key":"YOUR_AZURE_API_KEY","api_version":"2024-10-21","deployments":{"gpt-4o":"my-gpt4o-deployment"},"endpoint":"https://your-resource.openai.azure.com"},"project_ids":["prj_000057e9"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Azure, limited to one project
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/provider-keys/anthropic"

	payload := strings.NewReader("{\n  \"credentials\": {\n    \"api_key\": \"YOUR_AZURE_API_KEY\",\n    \"api_version\": \"2024-10-21\",\n    \"deployments\": {\n      \"gpt-4o\": \"my-gpt4o-deployment\"\n    },\n    \"endpoint\": \"https://your-resource.openai.azure.com\"\n  },\n  \"project_ids\": [\n    \"prj_000057e9\"\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Azure, limited to one project
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/provider-keys/anthropic")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"credentials\": {\n    \"api_key\": \"YOUR_AZURE_API_KEY\",\n    \"api_version\": \"2024-10-21\",\n    \"deployments\": {\n      \"gpt-4o\": \"my-gpt4o-deployment\"\n    },\n    \"endpoint\": \"https://your-resource.openai.azure.com\"\n  },\n  \"project_ids\": [\n    \"prj_000057e9\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Azure, limited to one project
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.example.com/v1/provider-keys/anthropic")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"credentials\": {\n    \"api_key\": \"YOUR_AZURE_API_KEY\",\n    \"api_version\": \"2024-10-21\",\n    \"deployments\": {\n      \"gpt-4o\": \"my-gpt4o-deployment\"\n    },\n    \"endpoint\": \"https://your-resource.openai.azure.com\"\n  },\n  \"project_ids\": [\n    \"prj_000057e9\"\n  ]\n}")
  .asString();
```

```php Azure, limited to one project
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.example.com/v1/provider-keys/anthropic', [
  'body' => '{
  "credentials": {
    "api_key": "YOUR_AZURE_API_KEY",
    "api_version": "2024-10-21",
    "deployments": {
      "gpt-4o": "my-gpt4o-deployment"
    },
    "endpoint": "https://your-resource.openai.azure.com"
  },
  "project_ids": [
    "prj_000057e9"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Azure, limited to one project
using RestSharp;

var client = new RestClient("https://api.example.com/v1/provider-keys/anthropic");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"credentials\": {\n    \"api_key\": \"YOUR_AZURE_API_KEY\",\n    \"api_version\": \"2024-10-21\",\n    \"deployments\": {\n      \"gpt-4o\": \"my-gpt4o-deployment\"\n    },\n    \"endpoint\": \"https://your-resource.openai.azure.com\"\n  },\n  \"project_ids\": [\n    \"prj_000057e9\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Azure, limited to one project
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "credentials": [
    "api_key": "YOUR_AZURE_API_KEY",
    "api_version": "2024-10-21",
    "deployments": ["gpt-4o": "my-gpt4o-deployment"],
    "endpoint": "https://your-resource.openai.azure.com"
  ],
  "project_ids": ["prj_000057e9"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/provider-keys/anthropic")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Azure on the v1 API, without api_version

**Request**

```json
{
  "credentials": {
    "api_key": "YOUR_AZURE_API_KEY",
    "deployments": {
      "gpt-4o": "my-gpt4o-deployment"
    },
    "endpoint": "https://your-resource.openai.azure.com"
  }
}
```

**Response**

```json
{
  "provider": "anthropic",
  "created_at": "2026-11-23T22:14:39.769Z",
  "last4": "a1B2",
  "project_ids": null,
  "verified_at": "2026-11-23T22:18:57.864Z"
}
```

**SDK Code**

```python Azure on the v1 API, without api_version
import requests

url = "https://api.example.com/v1/provider-keys/anthropic"

payload = { "credentials": {
        "api_key": "YOUR_AZURE_API_KEY",
        "deployments": { "gpt-4o": "my-gpt4o-deployment" },
        "endpoint": "https://your-resource.openai.azure.com"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Azure on the v1 API, without api_version
const url = 'https://api.example.com/v1/provider-keys/anthropic';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"credentials":{"api_key":"YOUR_AZURE_API_KEY","deployments":{"gpt-4o":"my-gpt4o-deployment"},"endpoint":"https://your-resource.openai.azure.com"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Azure on the v1 API, without api_version
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/provider-keys/anthropic"

	payload := strings.NewReader("{\n  \"credentials\": {\n    \"api_key\": \"YOUR_AZURE_API_KEY\",\n    \"deployments\": {\n      \"gpt-4o\": \"my-gpt4o-deployment\"\n    },\n    \"endpoint\": \"https://your-resource.openai.azure.com\"\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Azure on the v1 API, without api_version
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/provider-keys/anthropic")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"credentials\": {\n    \"api_key\": \"YOUR_AZURE_API_KEY\",\n    \"deployments\": {\n      \"gpt-4o\": \"my-gpt4o-deployment\"\n    },\n    \"endpoint\": \"https://your-resource.openai.azure.com\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Azure on the v1 API, without api_version
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.example.com/v1/provider-keys/anthropic")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"credentials\": {\n    \"api_key\": \"YOUR_AZURE_API_KEY\",\n    \"deployments\": {\n      \"gpt-4o\": \"my-gpt4o-deployment\"\n    },\n    \"endpoint\": \"https://your-resource.openai.azure.com\"\n  }\n}")
  .asString();
```

```php Azure on the v1 API, without api_version
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.example.com/v1/provider-keys/anthropic', [
  'body' => '{
  "credentials": {
    "api_key": "YOUR_AZURE_API_KEY",
    "deployments": {
      "gpt-4o": "my-gpt4o-deployment"
    },
    "endpoint": "https://your-resource.openai.azure.com"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Azure on the v1 API, without api_version
using RestSharp;

var client = new RestClient("https://api.example.com/v1/provider-keys/anthropic");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"credentials\": {\n    \"api_key\": \"YOUR_AZURE_API_KEY\",\n    \"deployments\": {\n      \"gpt-4o\": \"my-gpt4o-deployment\"\n    },\n    \"endpoint\": \"https://your-resource.openai.azure.com\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Azure on the v1 API, without api_version
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["credentials": [
    "api_key": "YOUR_AZURE_API_KEY",
    "deployments": ["gpt-4o": "my-gpt4o-deployment"],
    "endpoint": "https://your-resource.openai.azure.com"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/provider-keys/anthropic")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Bedrock with temporary credentials, kept to US processing

**Request**

```json
{
  "credentials": {
    "access_key_id": "YOUR_AWS_ACCESS_KEY_ID",
    "inference_profile": "us",
    "region": "us-east-1",
    "secret_access_key": "YOUR_AWS_SECRET_ACCESS_KEY",
    "session_token": "YOUR_AWS_SESSION_TOKEN"
  }
}
```

**Response**

```json
{
  "provider": "anthropic",
  "created_at": "2026-11-23T22:14:39.769Z",
  "last4": "a1B2",
  "project_ids": null,
  "verified_at": "2026-11-23T22:18:57.864Z"
}
```

**SDK Code**

```python Bedrock with temporary credentials, kept to US processing
import requests

url = "https://api.example.com/v1/provider-keys/anthropic"

payload = { "credentials": {
        "access_key_id": "YOUR_AWS_ACCESS_KEY_ID",
        "inference_profile": "us",
        "region": "us-east-1",
        "secret_access_key": "YOUR_AWS_SECRET_ACCESS_KEY",
        "session_token": "YOUR_AWS_SESSION_TOKEN"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Bedrock with temporary credentials, kept to US processing
const url = 'https://api.example.com/v1/provider-keys/anthropic';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"credentials":{"access_key_id":"YOUR_AWS_ACCESS_KEY_ID","inference_profile":"us","region":"us-east-1","secret_access_key":"YOUR_AWS_SECRET_ACCESS_KEY","session_token":"YOUR_AWS_SESSION_TOKEN"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Bedrock with temporary credentials, kept to US processing
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/provider-keys/anthropic"

	payload := strings.NewReader("{\n  \"credentials\": {\n    \"access_key_id\": \"YOUR_AWS_ACCESS_KEY_ID\",\n    \"inference_profile\": \"us\",\n    \"region\": \"us-east-1\",\n    \"secret_access_key\": \"YOUR_AWS_SECRET_ACCESS_KEY\",\n    \"session_token\": \"YOUR_AWS_SESSION_TOKEN\"\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Bedrock with temporary credentials, kept to US processing
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/provider-keys/anthropic")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"credentials\": {\n    \"access_key_id\": \"YOUR_AWS_ACCESS_KEY_ID\",\n    \"inference_profile\": \"us\",\n    \"region\": \"us-east-1\",\n    \"secret_access_key\": \"YOUR_AWS_SECRET_ACCESS_KEY\",\n    \"session_token\": \"YOUR_AWS_SESSION_TOKEN\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Bedrock with temporary credentials, kept to US processing
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.example.com/v1/provider-keys/anthropic")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"credentials\": {\n    \"access_key_id\": \"YOUR_AWS_ACCESS_KEY_ID\",\n    \"inference_profile\": \"us\",\n    \"region\": \"us-east-1\",\n    \"secret_access_key\": \"YOUR_AWS_SECRET_ACCESS_KEY\",\n    \"session_token\": \"YOUR_AWS_SESSION_TOKEN\"\n  }\n}")
  .asString();
```

```php Bedrock with temporary credentials, kept to US processing
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.example.com/v1/provider-keys/anthropic', [
  'body' => '{
  "credentials": {
    "access_key_id": "YOUR_AWS_ACCESS_KEY_ID",
    "inference_profile": "us",
    "region": "us-east-1",
    "secret_access_key": "YOUR_AWS_SECRET_ACCESS_KEY",
    "session_token": "YOUR_AWS_SESSION_TOKEN"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Bedrock with temporary credentials, kept to US processing
using RestSharp;

var client = new RestClient("https://api.example.com/v1/provider-keys/anthropic");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"credentials\": {\n    \"access_key_id\": \"YOUR_AWS_ACCESS_KEY_ID\",\n    \"inference_profile\": \"us\",\n    \"region\": \"us-east-1\",\n    \"secret_access_key\": \"YOUR_AWS_SECRET_ACCESS_KEY\",\n    \"session_token\": \"YOUR_AWS_SESSION_TOKEN\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Bedrock with temporary credentials, kept to US processing
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["credentials": [
    "access_key_id": "YOUR_AWS_ACCESS_KEY_ID",
    "inference_profile": "us",
    "region": "us-east-1",
    "secret_access_key": "YOUR_AWS_SECRET_ACCESS_KEY",
    "session_token": "YOUR_AWS_SESSION_TOKEN"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/provider-keys/anthropic")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Vertex on the US multi-region

**Request**

```json
{
  "credentials": {
    "project": "your-project",
    "region": "us",
    "service_account_json": {
      "client_email": "meadow@your-project.iam.gserviceaccount.com",
      "private_key": "YOUR_PRIVATE_KEY",
      "private_key_id": "YOUR_KEY_ID",
      "project_id": "your-project",
      "type": "service_account"
    }
  }
}
```

**Response**

```json
{
  "provider": "anthropic",
  "created_at": "2026-11-23T22:14:39.769Z",
  "last4": "a1B2",
  "project_ids": null,
  "verified_at": "2026-11-23T22:18:57.864Z"
}
```

**SDK Code**

```python Vertex on the US multi-region
import requests

url = "https://api.example.com/v1/provider-keys/anthropic"

payload = { "credentials": {
        "project": "your-project",
        "region": "us",
        "service_account_json": {
            "client_email": "meadow@your-project.iam.gserviceaccount.com",
            "private_key": "YOUR_PRIVATE_KEY",
            "private_key_id": "YOUR_KEY_ID",
            "project_id": "your-project",
            "type": "service_account"
        }
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Vertex on the US multi-region
const url = 'https://api.example.com/v1/provider-keys/anthropic';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"credentials":{"project":"your-project","region":"us","service_account_json":{"client_email":"meadow@your-project.iam.gserviceaccount.com","private_key":"YOUR_PRIVATE_KEY","private_key_id":"YOUR_KEY_ID","project_id":"your-project","type":"service_account"}}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Vertex on the US multi-region
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/provider-keys/anthropic"

	payload := strings.NewReader("{\n  \"credentials\": {\n    \"project\": \"your-project\",\n    \"region\": \"us\",\n    \"service_account_json\": {\n      \"client_email\": \"meadow@your-project.iam.gserviceaccount.com\",\n      \"private_key\": \"YOUR_PRIVATE_KEY\",\n      \"private_key_id\": \"YOUR_KEY_ID\",\n      \"project_id\": \"your-project\",\n      \"type\": \"service_account\"\n    }\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Vertex on the US multi-region
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/provider-keys/anthropic")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"credentials\": {\n    \"project\": \"your-project\",\n    \"region\": \"us\",\n    \"service_account_json\": {\n      \"client_email\": \"meadow@your-project.iam.gserviceaccount.com\",\n      \"private_key\": \"YOUR_PRIVATE_KEY\",\n      \"private_key_id\": \"YOUR_KEY_ID\",\n      \"project_id\": \"your-project\",\n      \"type\": \"service_account\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Vertex on the US multi-region
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.example.com/v1/provider-keys/anthropic")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"credentials\": {\n    \"project\": \"your-project\",\n    \"region\": \"us\",\n    \"service_account_json\": {\n      \"client_email\": \"meadow@your-project.iam.gserviceaccount.com\",\n      \"private_key\": \"YOUR_PRIVATE_KEY\",\n      \"private_key_id\": \"YOUR_KEY_ID\",\n      \"project_id\": \"your-project\",\n      \"type\": \"service_account\"\n    }\n  }\n}")
  .asString();
```

```php Vertex on the US multi-region
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.example.com/v1/provider-keys/anthropic', [
  'body' => '{
  "credentials": {
    "project": "your-project",
    "region": "us",
    "service_account_json": {
      "client_email": "meadow@your-project.iam.gserviceaccount.com",
      "private_key": "YOUR_PRIVATE_KEY",
      "private_key_id": "YOUR_KEY_ID",
      "project_id": "your-project",
      "type": "service_account"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Vertex on the US multi-region
using RestSharp;

var client = new RestClient("https://api.example.com/v1/provider-keys/anthropic");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"credentials\": {\n    \"project\": \"your-project\",\n    \"region\": \"us\",\n    \"service_account_json\": {\n      \"client_email\": \"meadow@your-project.iam.gserviceaccount.com\",\n      \"private_key\": \"YOUR_PRIVATE_KEY\",\n      \"private_key_id\": \"YOUR_KEY_ID\",\n      \"project_id\": \"your-project\",\n      \"type\": \"service_account\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Vertex on the US multi-region
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["credentials": [
    "project": "your-project",
    "region": "us",
    "service_account_json": [
      "client_email": "meadow@your-project.iam.gserviceaccount.com",
      "private_key": "YOUR_PRIVATE_KEY",
      "private_key_id": "YOUR_KEY_ID",
      "project_id": "your-project",
      "type": "service_account"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/provider-keys/anthropic")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```