---
title: "Generate a technical-chat response"
method: POST
path: "/v1/chat/technical"
---

# Generate a technical-chat response

`POST /v1/chat/technical`

## Request

- Base URL: `https://api.struck.build`
- URL: `https://api.struck.build/v1/chat/technical`
- Auth: HTTP bearer

Returns complete JSON by default. Set stream: true for NDJSON events. Both modes run in the foreground, with an approximately 13-minute deadline. Charging and retries: https://unravel.struck.build/developers#api-charging-and-retries.

## Headers

- `Idempotency-Key` string, uuid

## Request body

- TechnicalChatRequest
  - `messages` object[], required: The conversation so far, oldest first. Roles alternate starting with "user", and the final message is always "user".
    - `role` 'user' | 'assistant', required
    - `content` string, required
  - `filters` object, required
    - `country` 'Netherlands' | 'England', required
    - `province` string
    - `municipality` string
  - `stream` boolean: Return NDJSON only when true. Omitted or false returns complete JSON.

## Response `200`

Complete JSON when stream is omitted or false; a UTF-8 NDJSON stream when true. JSON contains only the final answer and cited sources, with a maximum serialized size of 4,000,000 bytes.

- TechnicalChatResponse
  - `request_id` string, uuid, required
  - `content` string, required
  - `sources` object[], required: Only cited sources, in ascending source_number order.
    - `source_number` integer, required: The N in the answer's citation marker. The marker is [Source N], or [Source N - article] when the source is one article of a zoning plan, and a Dutch answer may write Bron for Source ([Bron N - article]), so match the number after the keyword rather than the whole bracket. Unique within one response; the numbers carry no meaning across responses.
    - `title` string, required: The name of the source document, for example "Besluit bouwwerken leefomgeving".
    - `url` string, uri: The document's page in the Struck document library, when the library lists it. Absent otherwise.
  - `credits_charged` integer, required

## Other responses

- `400`: The request body is not valid JSON.
- `401`: The API key is missing, invalid, or revoked.
- `402`: The organization does not have enough credits.
- `403`: API access is not enabled for this organization.
- `409`: The Idempotency-Key was already used: `idempotency_conflict` when the body differs, `already_completed` when it matches an earlier admitted request, whose response cannot be replayed.
- `413`: The request body exceeds the maximum size.
- `422`: The request body is invalid.
- `429`: The API key has exceeded its rate limit.
- `500`: An unexpected error occurred.
- `503`: The chat service is unavailable.
- `504`: The chat service timed out.

---

[API](https://skmtc.dev/struck/apis/struck-api.md) - [All operations](https://skmtc.dev/struck/apis/struck-api/llms.txt) - [OpenAPI document](https://skmtc.dev/struck/apis/struck-api/revisions/311a4ee0b35d?raw)
