# CodePipelineApiKeyCredentials

An API key for a code pipeline engine, with where its traffic goes.

**Kind:** an object, used in requests and responses. In a request it is called `CodePipelineApiKeyCredentialsInput`.

## In a request

| Field | Type | Required | Description |
|---|---|---|---|
| `apiKey` | `string` |  | The key. Leave it empty on Maitento's own fallback entry (`isOwnLicense` false). Write-only: never returned. |
| `baseUrl` | `string \| null` |  | The endpoint to send this key's requests to, for providers that give each key its own host (for example Qwen's regional endpoints). Null: the engine's default endpoint. |
| `hostingMode` | `string \| null` |  | Where the key's model is hosted: `Direct`, `CustomEndpoint`, `AzureFoundry`, `Bedrock` or `Vertex` (see `CodePipelineHostingMode`). Null: `Direct`. |
| `modelNameOverrides` | `map<string, string> \| null` |  | The model id this key needs for each model name (for example a deployment name on Azure), keyed by the model name the agent asks for. Null or empty: model names are used as they are. |
| `boundModel` | `string \| null` |  | The one model this key serves. Null: any model of its engine. Set it for your own endpoint, so an agent asking for a different model never gets this endpoint. |
| `contextWindowTokens` | `integer \| null` |  | The context window of `boundModel`, in tokens, for a model the coding tool doesn't know. Null for the built-in engines' models. |
| `awsRegion` | `string \| null` |  | The AWS region, when `hostingMode` is `Bedrock`. |
| `gcpProjectId` | `string \| null` |  | The Google Cloud project id, when `hostingMode` is `Vertex`. |
| `gcpRegion` | `string \| null` |  | The Google Cloud region, when `hostingMode` is `Vertex`. |
| `engine` | [`CodeEngineType`](https://docs.maitento.com/reference/types/code-engine-type.md) |  | The engine this credential is for. |
| `credentialId` | `string \| null` |  | Your id for this credential. The run records it on the tokens the credential used (`tokenUsage`) and, when your own credential fails, in `credentialFailures`, so you can tell which key did what. |
| `isOwnLicense` | `boolean` |  | True for your own key or sign-in, which you pay the provider for. False marks a fallback to Maitento's own key: leave its `apiKey` empty. Its use counts as platform usage, and your tenant can forbid it. |
| `priority` | `integer \| null` |  | The order to try this engine's credentials in: lower first. Null: after the numbered ones. |
| `billingMode` | `string \| null` |  | The kind of plan the credential is on with its provider (for example `SubscriptionPlan` or `PayAsYouGoApi`), recorded for reporting. Null when not given. |

```json
{
  "apiKey": "...",
  "baseUrl": "...",
  "hostingMode": "...",
  "modelNameOverrides": {
    "key": "..."
  },
  "boundModel": "...",
  "contextWindowTokens": 0,
  "awsRegion": "...",
  "gcpProjectId": "...",
  "gcpRegion": "...",
  "engine": "Claude",
  "credentialId": "...",
  "isOwnLicense": false,
  "priority": 0,
  "billingMode": "..."
}
```

## In a response

Every field is present in a response; empty ones are `null`.

| Field | Type | Description |
|---|---|---|
| `baseUrl` | `string \| null` | The endpoint to send this key's requests to, for providers that give each key its own host (for example Qwen's regional endpoints). Null: the engine's default endpoint. |
| `hostingMode` | `string \| null` | Where the key's model is hosted: `Direct`, `CustomEndpoint`, `AzureFoundry`, `Bedrock` or `Vertex` (see `CodePipelineHostingMode`). Null: `Direct`. |
| `parsedHostingMode` | [`CodePipelineHostingMode`](https://docs.maitento.com/reference/types/code-pipeline-hosting-mode.md) | `hostingMode` as an enum value: `Direct` when it is null or not recognised. Set by Maitento. |
| `modelNameOverrides` | `map<string, string> \| null` | The model id this key needs for each model name (for example a deployment name on Azure), keyed by the model name the agent asks for. Null or empty: model names are used as they are. |
| `boundModel` | `string \| null` | The one model this key serves. Null: any model of its engine. Set it for your own endpoint, so an agent asking for a different model never gets this endpoint. |
| `contextWindowTokens` | `integer \| null` | The context window of `boundModel`, in tokens, for a model the coding tool doesn't know. Null for the built-in engines' models. |
| `awsRegion` | `string \| null` | The AWS region, when `hostingMode` is `Bedrock`. |
| `gcpProjectId` | `string \| null` | The Google Cloud project id, when `hostingMode` is `Vertex`. |
| `gcpRegion` | `string \| null` | The Google Cloud region, when `hostingMode` is `Vertex`. |
| `engine` | [`CodeEngineType`](https://docs.maitento.com/reference/types/code-engine-type.md) | The engine this credential is for. |
| `credentialId` | `string \| null` | Your id for this credential. The run records it on the tokens the credential used (`tokenUsage`) and, when your own credential fails, in `credentialFailures`, so you can tell which key did what. |
| `isOwnLicense` | `boolean` | True for your own key or sign-in, which you pay the provider for. False marks a fallback to Maitento's own key: leave its `apiKey` empty. Its use counts as platform usage, and your tenant can forbid it. |
| `priority` | `integer \| null` | The order to try this engine's credentials in: lower first. Null: after the numbered ones. |
| `billingMode` | `string \| null` | The kind of plan the credential is on with its provider (for example `SubscriptionPlan` or `PayAsYouGoApi`), recorded for reporting. Null when not given. |

```json
{
  "baseUrl": "...",
  "hostingMode": "...",
  "parsedHostingMode": "Direct",
  "modelNameOverrides": {
    "key": "..."
  },
  "boundModel": "...",
  "contextWindowTokens": 0,
  "awsRegion": "...",
  "gcpProjectId": "...",
  "gcpRegion": "...",
  "engine": "Claude",
  "credentialId": "...",
  "isOwnLicense": false,
  "priority": 0,
  "billingMode": "..."
}
```

## Where it's used

- Inside [`CodePipelineProcessCredentials`](https://docs.maitento.com/reference/types/code-pipeline-process-credentials.md)
