Skip to content

Chat Ai Sdk

POST
/api/ai-sdk/chat

Endpoint compatible con AI SDK 6.x (Vercel)

Request body esperado: { “messages”: [ {“role”: “user”, “content”: “¿Cuál es…?”} ], “userId”: “uuid-string”, “conversationId”: “uuid-string-opcional”, “model”: “gemini-2.5-flash” }

Response: Server-Sent Events en formato AI SDK: 0:“chunk de texto” 0:“más texto” d:{“finishReason”:“stop”,“usage”:{…},“conversationId”:”…”}

x-api-key
Any of:
string

Successful Response

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object