---
title: "POST /api/ai_assistant/converse"
method: POST
path: "/api/ai_assistant/converse"
tags: ["AI Assistant"]
---

# POST /api/ai_assistant/converse

`POST /api/ai_assistant/converse`

POST operation for /api/ai_assistant/converse

## Headers

- `X-EDH-USER` string, required
- `X-EDH-TOKEN` string, required

## Request body

- object
  - `prompt` string, required — The user message to send to the AI assistant
  - `system_prompt` string, nullable — Optional system instruction to guide the AI response
  - `max_tokens` integer, nullable — Maximum number of tokens in the response
  - `temperature` number, float, nullable — Temperature (0.0 = deterministic, 1.0 = creative)
  - `top_p` number, float, nullable — Top-p nucleus sampling parameter
  - `knowledge_base_id` string, nullable — Bedrock Knowledge Base ID for RAG-based responses
  - `number_of_results` integer — Number of KB chunks to retrieve (only used with knowledge_base_id)
  - `inference_profile_arn` string, nullable — Custom Bedrock inference profile ARN. Defaults to cluster-configured model.
  - `model_id` string, nullable — Bedrock model ID to use for inference. Defaults to cluster-configured model.
  - `messages` object[], nullable — Conversation history to provide context for the AI assistant
    - `role` 'user' | 'assistant'
    - `content` string

## Response `200`

AI assistant response generated successfully

- object
  - `success` boolean
  - `message` object
    - `message` string — The AI-generated response text
    - `usage` object, nullable
      - `inputTokens` integer
      - `outputTokens` integer
      - `totalTokens` integer

## Other responses

- `401` — Authentication required
- `500` — AI assistant invocation failed

---

[API](https://skmtc.dev/aws-samples/apis/engineering-development-hub-edh-api.md) · [All operations](https://skmtc.dev/aws-samples/apis/engineering-development-hub-edh-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/aws-samples/engineering-development-hub-edh-api/revisions/058396b8f0f1/schema)
