The Laravel AI SDK writes the stream format that the AI SDK useChat hook reads, so a chat needs one route, one React component and one CSRF header.
A provider failure mid-stream returns HTTP 200 with a masked error part, so alert on logged exceptions instead of 5xx status codes.
Each request resends the whole history, so input tokens grow with the square of the number of turns; cap history length and rate limit the route.