# Chat with an AI preset

> `POST` `/v1/ai/chat`

URL: https://www.agencytitan.com/docs/tag/ai-chat/POST/v1/ai/chat

Operation ID: `ai_chat_create`

Tag: [ai_chat](https://www.agencytitan.com/docs/tag/ai-chat.md)

## Description

Runs one non-streaming AI chat turn with a published tenant AI preset. Use this when an applicable published preset exists for the task rather than improvising the preset's specialized work. Client- and process-scoped presets require an accessible scope id; process scope ids are process-instance ids. Pass conversation_id to continue a conversation owned by the acting user.

## Parameters

- `Idempotency-Key` (header, required, `string`) — Caller-generated key for deterministic command replay (1-255 characters).

## Request body

- Required: yes
- Content-Type: `application/json`
  - Type: `object`
  - Properties:
    - `ai_configuration_id` (`string`, required)
    - `conversation_id` (`string`)
    - `model` (`string`) — Optional call-level model override, supplied with provider. Use a pinned model ID or latest:<family_key>:<tier>, for ex…
    - `prompt` (`string`, required)
    - `provider` (`string`) — Optional call-level model provider. Supply together with model; a latest alias must use the matching family provider.
    - `reasoning_effort` (`string`) — Optional call-level effort override. Omit to use the preset, Auto, or model default. Clamped to the selected model's su…
    - `scope` (`object`)
    - `site_id` (`string`) — Optional website context for a site-page preset run.
    - `structured_output` (`boolean`) — Optional override; omitted uses the preset structured-output setting.

## Responses

- `200` (`application/json`): Successful response.
  - Type: `object`
  - Properties:
    - `data` (`object`, required)
- `400` (`application/json`): Request validation failed (unknown or out-of-range parameters/properties are rejected).
  - Type: `object`
  - Properties:
    - `error` (`object`, required)
- `401` (`application/json`): Missing, invalid, expired, or revoked bearer token.
  - Type: `object`
  - Properties:
    - `error` (`string`, required)
    - `error_description` (`string`, required)
- `403` (`application/json`): The authenticated user does not have permission for this operation.
  - Type: `object`
  - Properties:
    - `error` (`object`, required)
- `404` (`application/json`): The requested resource was not found.
  - Type: `object`
  - Properties:
    - `error` (`object`, required)
- `409` (`application/json`): The request conflicts with an existing record or partially applied.
  - Type: `object`
  - Properties:
    - `error` (`object`, required)
- `429` (`application/json`): Per-tenant rate limit exceeded (600 requests/minute across all /v1 REST endpoints). The Retry-After header indicates how many seconds to wait.
  - Type: `object`
  - Properties:
    - `error` (`object`, required)
- `500` (`application/json`): An unexpected internal error occurred.
  - Type: `object`
  - Properties:
    - `error` (`object`, required)

## Authentication

- `bearerAuth` — http (bearer) — All /v1 endpoints (except `/v1/openapi.json` and `/v1/llms.txt`) require a bearer token. Two equal first-class paths: (1) an OAuth 2.0 access token from the au…

## Useful links

- Interactive page: https://www.agencytitan.com/docs/tag/ai-chat/POST/v1/ai/chat
- API reference home: https://www.agencytitan.com/docs/
- Tag page: https://www.agencytitan.com/docs/tag/ai-chat.md
- This operation as Markdown: https://www.agencytitan.com/docs/tag/ai-chat/POST/v1/ai/chat.md
- OpenAPI JSON: https://www.agencytitan.com/docs/openapi.json
- Full API Markdown: https://api.agencytitan.com/v1/llms.txt
- API keys: https://app.agencytitan.com/settings/api-mcp
