# PartitionEmbeddingProfileRequest

Sets a partition's embedding profile together with its keys and fallback consent, in one change, so the keys always match the profile's provider. If the new profile needs the same index as the current one, only the keys change. If not, it starts a re-index: the partition's index is discarded, every file is embedded again, and search is refused until that completes. Refused while a re-index is already running.

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

## Fields

| Field | Type | Required | Description |
|---|---|---|---|
| `profile` | [`PartitionEmbeddingProfileInput`](https://docs.maitento.com/reference/types/partition-embedding-profile.md#in-a-request) | yes | The profile to index the partition with. Constraints: required (empty or whitespace-only strings are rejected). |
| `credentials` | [`PartitionEmbeddingCredentialInput`](https://docs.maitento.com/reference/types/partition-embedding-credential.md#in-a-request)`[]` | yes | Your keys for the profile's provider, in failover order. May be empty only with `allowMaitentoFallback` true, which means "no key of my own, use Maitento's", or with a `credentialStackId`. Constraints: required (empty or whitespace-only strings are rejected). |
| `allowMaitentoFallback` | `boolean` |  | Consent to fall back to Maitento's key for this provider when your keys are exhausted. |
| `credentialStackId` | `uuid \| null` |  | The id of one of your credential stacks for the partition to embed with, set in the same change, so the profile and the stack that serves it always match. With a stack, `credentials` may be empty, and Maitento's key is never used. Null leaves the partition's stack as it is; clear one with `PUT /partitions/by-id/{id}/embedding-credential-stack`. |
| `allowReindex` | `boolean` |  | Whether this request may start a re-index. Defaults to true. Send false when you only mean to update the keys: if the profile would need a different index, the request is refused with `api:embeddings:reindex-not-permitted` and nothing changes. When the profile needs the same index, a failed re-index is resumed if the keys or consent changed, or, when this is true, even if they did not (a deliberate retry). |

## Example

```json
{
  "profile": {
    "provider": "OpenAi",
    "model": "...",
    "dimensions": 0,
    "chunkSizeTokens": 0,
    "chunkOverlapTokens": 0,
    "custom": false
  },
  "credentials": [
    {
      "provider": "OpenAi",
      "apiKey": "...",
      "baseUrl": "...",
      "modelIdentifier": "...",
      "credentialId": "...",
      "priority": 0
    }
  ],
  "allowMaitentoFallback": false,
  "credentialStackId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "allowReindex": false
}
```

## Where it's used

- [`partitions.changeEmbeddingProfile`](https://docs.maitento.com/reference/api/partitions.md) (`PUT /partitions/by-id/{id}/embedding-profile`)
