---
title: "Set Agent Provider Key"
method: PUT
path: "/api/agents/{agent_id}/provider-keys/{provider}"
tags: ["agents"]
---

# Set Agent Provider Key

`PUT /api/agents/{agent_id}/provider-keys/{provider}`

## Request

- Base URL: `https://app.thinqos.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.thinqos.com/api/agents/{agent_id}/provider-keys/{provider}`
- Auth: none declared

Set or update an encrypted provider API key on the agent identity.

## Path parameters

- `agent_id` string, uuid, required
- `provider` string, required

## Headers

- `x-impersonate-identity-id` string, nullable

## Request body

- SetAgentProviderKeyRequest
  - `api_key` string, required
  - `provider_scope` string, nullable

## Response `200`

Successful Response

- SetAgentProviderKeyResponse
  - `provider` string, required
  - `valid` boolean, nullable, required
  - `validation_error` string, nullable
  - `provider_scope` string, nullable
  - `scope_outcome` string, nullable
  - `scope_candidates` string[]
  - `scope_detail` string, nullable
  - `batch_eligible` boolean

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/thinqos/apis/thinqos-api.md) · [All operations](https://skmtc.dev/thinqos/apis/thinqos-api/llms.txt) · [OpenAPI document](https://skmtc.dev/thinqos/apis/thinqos-api/revisions/5387b4ded614?raw)
