---
title: "Update Project Ai Keys"
method: PUT
path: "/api/projects/{project_id}/ai-keys"
tags: ["Projects"]
---

# Update Project Ai Keys

`PUT /api/projects/{project_id}/ai-keys`

## Request

- Base URL: `https://api.agentstack.tech` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agentstack.tech/api/projects/{project_id}/ai-keys`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

AI ключи проекта (пул / «пожертвованные» участником).

Ключи пишутся в ``project.protected.keys.api.service_keys`` (как у пользователя).
При ``use_shared_project_keys`` KeySelector отдаёт их после пользовательских ключей.
``override_user_keys`` — только ключи проекта для всех участников.

Можно передать только флаги без ``api_keys``.

## Path parameters

- `project_id` integer, required: Project ID

## Headers

- `Idempotency-Key` string

## Request body

- object: {"api_keys": {...}?,"use_shared_project_keys"?: bool, "override_user_keys"?: bool}

## Response `200`

Successful Response

- unknown

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/agentstack/apis/agentstack-core-api.md) · [All operations](https://skmtc.dev/agentstack/apis/agentstack-core-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentstack/apis/agentstack-core-api/revisions/8ecf3406e74a?raw)
