Skip to main content
POST
/
api
/
chat
cURL
curl --request POST \
  --url https://recoup-api.vercel.app/api/chat \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "prompt": "<string>",
  "messages": [
    {
      "id": "<string>",
      "role": "user",
      "content": "<string>"
    }
  ],
  "artistId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "model": "openai/gpt-5-mini",
  "excludeTools": [
    "create_scheduled_actions"
  ],
  "roomId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "topic": "<string>"
}
'
"<string>"

Authorizations

x-api-key
string
header
required

Your Recoup API key. Learn more.

Body

application/json

Chat stream request

Request body for chat streaming. Exactly one of 'prompt' or 'messages' must be provided.

prompt
string

Single text prompt for the assistant. Required if 'messages' is not provided.

messages
object[]

Array of UIMessage objects for context. Required if 'prompt' is not provided.

artistId
string<uuid>

The unique identifier of the artist (optional)

model
string

The AI model to use for text generation (optional)

Example:

"openai/gpt-5-mini"

excludeTools
string[]

Array of tool names to exclude from execution

Example:
["create_scheduled_actions"]
roomId
string<uuid>

UUID of the chat room. If not provided, one will be generated automatically.

topic
string

Topic name for the new chat room (e.g., 'Pulse Feb 2'). Only applies when creating a new room - ignored if room already exists. To edit the topic of an existing room, use PATCH /api/chats.

Response

Streaming response with UI message parts. Events include: message-start (assistant begins message), message-delta (incremental updates), message-end (assistant finishes message), error (stream error), and metadata (usage data).

Server-Sent Events stream containing UI message parts