---
title: "Chat Gemini Stream"
method: POST
path: "/api/chat/gemini/stream"
tags: ["chat_gemini"]
---

# Chat Gemini Stream

`POST /api/chat/gemini/stream`

## Request

- Base URL: `https://api.pcbgenerator.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pcbgenerator.com/api/chat/gemini/stream`
- Auth: HTTP bearer

Stream agent-loop events as SSE. Gated by FF_AGENT_LOOP.

§3.11 tenancy boundary: `context.user_id` is overwritten with the
JWT-verified subject (`user["sub"]`). The body's claimed user_id is
ignored — this is the point where the model (or a malicious client)
cannot forge tenancy. Tools downstream rely on `context.user_id` being
trustworthy when running ownership checks.

## Request body

- ChatRequest
  - `message` string, required
  - `history` ChatMessage[]
    - `role` 'user' | 'model', required
    - `content` string, required
  - `context` object, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/pcbgenerator/apis/pcb-stackup-generator-api.md) · [All operations](https://skmtc.dev/pcbgenerator/apis/pcb-stackup-generator-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pcbgenerator/apis/pcb-stackup-generator-api/revisions/b6084b3ace32?raw)
