---
title: "Chat with AI about a policy"
method: POST
path: "/v1/policies/{id}/ai-chat"
tags: ["Policies"]
---

# Chat with AI about a policy

`POST /v1/policies/{id}/ai-chat`

Ask policy-specific questions and request draft improvements while preserving human review before policy changes are applied.

## Path parameters

- `id` string, required

## Headers

- `X-Organization-Id` string

## Request body

- AISuggestPolicyRequestDto
  - `instructions` string, required — User instructions about what changes to make to the policy
  - `chatHistory` object[] — Chat history for context (array of messages with role and content)
    - `role` 'user' | 'assistant'
    - `content` string

## Response `200`

Streaming AI response

## Other responses

- `401` — Unauthorized
- `404` — Policy not found

---

[API](https://skmtc.net/trycompai/apis/comp-ai-api.md) · [All operations](https://skmtc.net/trycompai/apis/comp-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trycompai/comp-ai-api/versions/726b9523fb22/schema)
