---
title: "Chat with The Brain"
method: POST
path: "/v1/chat"
tags: ["Brain"]
---

# Chat with The Brain

`POST /v1/chat`

Send a natural language query to The Brain. It routes to the right specialist(s) automatically. Add "Respond as JSON with:" to your message and specify fields to get structured JSON back.

## Request body

- ChatRequest
  - `message` string, required — Your query to The Brain. Add "Respond as JSON with:" and list fields for structured output.
  - `stream` boolean — Enable streaming response
  - `model` string — Model ID from the provider's API. Use the exact ID the provider uses — e.g. "gpt-4o" for OpenAI, "claude-sonnet-4-20250514" for Anthropic, "anthropic/claude-sonnet-4" for OpenRouter. Requires a connected API key for the chosen provider.
  - `model_provider` 'openai' | 'anthropic' | 'xai' | 'openrouter' | 'venice' — Provider of the custom model. Must match the provider you connected your API key for.

## Response `200`

Analysis complete

- ChatResponse
  - `session_id` string, uuid
  - `content` string — The response. Contains markdown by default, or parseable JSON if you requested it.
  - `timestamp` string, date-time

## Other responses

- `401` — Invalid or revoked API key
- `429` — Rate limit exceeded (60 requests per minute)
- `504` — Query timeout. Break into smaller, more specific requests.

---

[API](https://skmtc.net/gigabraingg/apis/gigabrain-api.md) · [All operations](https://skmtc.net/gigabraingg/apis/gigabrain-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gigabraingg/gigabrain-api/revisions/bb4070b30d92/schema)
