# Update LLM Provider's ApiKey

**PATCH** `/v1/private/llm-provider-key/{id}`

Update LLM Provider's ApiKey. api_key and auth_config are mutually exclusive: setting a valid auth_config on a provider that holds a static api_key clears the stored key; send auth_config as an empty object to clear the recipe and switch back to a static key

Base URL: `https://www.comet.com/opik/api`

Tags: `LlmProviderKey`

## Authorization

This operation requires no authorization.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` (uuid) | Yes | — |

## Request body

Optional. Media type: `application/json`

### Example request body

```json
{
  "api_key": "",
  "auth_config": {
    "credentials": [
      {
        "key": "string",
        "secret": "",
        "value": "string"
      }
    ],
    "expires_field": "expires_in",
    "fallback_ttl_seconds": 0,
    "send_as": "basic",
    "token_field": "access_token",
    "token_url": "https://developer.api.example.com/authentication/v1/token"
  },
  "base_url": "string",
  "configuration": {
    "additionalProp1": "string"
  },
  "headers": {
    "additionalProp1": "string"
  },
  "name": "string",
  "provider_name": "ollama"
}
```

## Responses

| Status | Description | Media type |
| --- | --- | --- |
| `204` | No Content | — |
| `401` | Bad Request | `application/json` |
| `403` | Access forbidden | `application/json` |
| `404` | Not found | `application/json` |

### Example response: 401 — Bad Request

```json
{
  "code": 0,
  "details": "string",
  "message": "string"
}
```

### Example response: 403 — Access forbidden

```json
{
  "code": 0,
  "details": "string",
  "message": "string"
}
```

### Example response: 404 — Not found

```json
{
  "code": 0,
  "details": "string",
  "message": "string"
}
```

## Related pages

- [Activate a pairing session](./activatepairingsession.md)
- [Add blueprint to existing config](./updateagentconfig.md)
- [Add items to annotation queue](./additemstoannotationqueue.md)
- [Add span comment](./addspancomment.md)
- [Add span feedback score](./addspanfeedbackscore.md)
- [Add thread comment](./addthreadcomment.md)
- [Add trace comment](./addtracecomment.md)
- [Add trace feedback score](./addtracefeedbackscore.md)
- [Agent Configs](./tags/agent-configs.md)
- [Agent Insights](./tags/agent-insights.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
