> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qa.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat API

> Interact with the QA.tech AI Chat Assistant programmatically

The Chat API enables programmatic interaction with QA.tech's AI Chat Assistant. Create conversations, send messages, start change reviews, and poll for responses—all via REST API. This is ideal for integrating QA.tech's AI capabilities into your automation workflows, project management systems, or custom tooling.

## When to Use This API

* **Automated test creation** – Send context from your system to create tests without opening the QA.tech UI
* **PR/Change reviews** – Automatically trigger AI-powered change reviews from CI/CD pipelines
* **Custom integrations** – Build buttons or workflows in your project management tools that interact with QA.tech Chat
* **AI-assisted QA workflows** – Let your automation systems communicate with QA.tech's AI assistant

<Tip>
  For simpler chat interactions, consider using the [CLI chat
  command](/cli/commands/chat) which handles polling automatically: `qatech chat
      "Create a login test"`
</Tip>

## Authentication

All endpoints require Bearer token authentication. Create your API key in the QA.tech dashboard: **Organization Settings → API Keys**. The key is shown only once, at creation. See the [API Introduction](/api-reference/introduction#authentication) for details.

## Endpoints

For full request, response, and error details, see the generated reference pages:

* [Start Chat Conversation](/api-reference/chat/start-chat-conversation) – Create a conversation and send the first message
* [Start Change Review Chat](/api-reference/chat/start-change-review-chat) – Create a conversation that reviews a pull request or raw code changes
* [Send Chat Message](/api-reference/chat/send-chat-message) – Send a follow-up message to an existing conversation
* [Get Chat Conversation](/api-reference/chat/get-chat-conversation) – Retrieve conversation metadata and messages

## How Conversations Work

Chat processing is **asynchronous**. Creating a conversation or sending a message returns `202 Accepted` immediately with an empty `messages` array — the assistant's reply is not included. To read the reply, poll [Get Chat Conversation](/api-reference/chat/get-chat-conversation) until the most recent `assistant` message reaches the `COMPLETED` status. We recommend polling every **2-5 seconds**.

<Note>
  Assistant responses typically complete within 10-60 seconds depending on the
  complexity of the request. Test creation and execution may take several
  minutes.
</Note>

You can target a specific application environment for the conversation — for example a preview deployment or an uploaded mobile build — by passing application overrides when creating it. See the [Start Chat Conversation](/api-reference/chat/start-chat-conversation) reference for the override format.

## Change Reviews

[Start Change Review Chat](/api-reference/chat/start-change-review-chat) creates a conversation that initiates an AI-powered review of code changes. It supports two modes:

* **PR mode** – Provide a pull request URL (GitHub or GitLab) and QA.tech fetches the changes
* **Raw changes mode** – Provide a change description and a git diff directly, useful when the changes are not in a hosted PR

Both modes accept optional extra context to help the AI understand the changes, and require application overrides specifying which environment to review against.

For GitHub pull requests (`mode: "pr"`, `vcsProviderId: "github"`), an explicit change-review request also creates or updates the **QA.tech / PR Review** check on the PR. This applies even when **Auto-run on PRs** is disabled in the GitHub App integration. See [PR Review check on GitHub](/configuration/github-app#pr-review-check-on-github).

## Related

* [AI Chat Assistant](/core-concepts/ai-chat-assistant) – Learn about QA.tech's AI assistant
* [API Introduction](/api-reference/introduction) – Authentication and ID reference
* [Start Run API](/api-reference/runs/start-test-run) – Trigger test runs programmatically
