# ModelCredentialRequest

A credential to create, or what an existing one should become. On an update every field is replaced. Keys are matched by id: an existing key sent with its id and no value is kept as it is, a key sent with a value is stored, and an existing key left out is removed.

**Kind:** an object, used in requests.

## Fields

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | `string` |  |  |
| `description` | `string \| null` |  |  |
| `provider` | [`ModelKeyProvider`](https://docs.maitento.com/reference/types/model-key-provider.md) |  |  |
| `endpoint` | `string \| null` |  | An HTTPS endpoint on the public internet; null for the provider's public API. |
| `cloud` | [`CredentialCloudInput`](https://docs.maitento.com/reference/types/credential-cloud.md#in-a-request)`\| null` |  | For an Anthropic credential: Claude on Amazon Bedrock (with `awsRegion`) or Google Vertex AI (with `gcpProjectId` and `gcpRegion`), with no `endpoint`. The key is then the Bedrock API key, or the service account's JSON key file. Only code pipelines' Claude Code agents run on it. |
| `keys` | [`ModelCredentialKeyRequest`](https://docs.maitento.com/reference/types/model-credential-key-request.md)`[]` |  |  |
| `models` | [`CredentialModelInput`](https://docs.maitento.com/reference/types/credential-model.md#in-a-request)`[]` |  |  |
| `tag` | `string \| null` |  |  |

## Example

```json
{
  "name": "...",
  "description": "...",
  "provider": "Anthropic",
  "endpoint": "...",
  "cloud": {
    "kind": "Bedrock",
    "awsRegion": "...",
    "gcpProjectId": "...",
    "gcpRegion": "..."
  },
  "keys": [
    {
      "id": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
      "value": "..."
    }
  ],
  "models": [
    {
      "model": "...",
      "deploymentName": "...",
      "contextWindowTokens": 0
    }
  ],
  "tag": "..."
}
```

## Where it's used

- [`credentials.create`](https://docs.maitento.com/reference/api/credentials.md) (`POST /credentials`)
- [`credentials.testUnsaved`](https://docs.maitento.com/reference/api/credentials.md) (`POST /credentials/test`)
- [`credentials.update`](https://docs.maitento.com/reference/api/credentials.md) (`PUT /credentials/by-id/{id}`)
