chat

open suspend override fun chat(request: ChatRequest): ChatResponse

Sends request to the Messages API and returns Claude's answer.

Throws

when the API cannot be reached, when it returns an error, and when Claude declines the request.