---
title: "Chat jurídico com resposta fundamentada em decisões reais (RAG)"
method: POST
path: "/api/v1/chat"
tags: ["IA"]
---

# Chat jurídico com resposta fundamentada em decisões reais (RAG)

`POST /api/v1/chat`

## Request

- Base URL: `https://api.ragjur.ai`
- URL: `https://api.ragjur.ai/api/v1/chat`
- Auth: one of:
  - API key in header `x-api-key`
  - OAuth 2 (authorization code, authorization URL `https://mcp.ragjur.ai/oauth/authorize`, token URL `https://mcp.ragjur.ai/oauth/token`, scopes: `ragjur:read`)

Recupera decisões do tema na `fonte` e responde em prosa citando-as. `historico` mantém o contexto da conversa. Alias: `POST /api/v1/chat-estrategia`.

## Request body

- object
  - `pergunta` string, required
  - `fonte` string, required
  - `turma` string
  - `historico` object[]
    - `role` 'user' | 'assistant'
    - `content` string

## Response `200`

Resposta

- object
  - `resposta` string

## Other responses

- `400`: Parâmetro obrigatório ausente ou inválido
- `401`: Sem `x-api-key` ou chave inválida
- `403`: Chave desativada
- `429`: Rate limit excedido (janela deslizante por chave). Ver `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`.
- `500`: Erro interno
- `502`: Erro no Elasticsearch ou no modelo de IA

---

[API](https://skmtc.dev/ragjur/apis/ragjur-api.md) · [All operations](https://skmtc.dev/ragjur/apis/ragjur-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ragjur/apis/ragjur-api/revisions/448e3f75cc15?raw)
