Skip to main content
POST
/
api
/
v1
/
ai
AI chat
curl --request POST \
  --url http://localhost:3001/api/v1/ai \
  --header 'Content-Type: application/json' \
  --cookie nut-session= \
  --data '
{
  "message": "<string>",
  "history": [
    {
      "role": "user",
      "content": "<string>",
      "name": "<string>",
      "toolCalls": [
        {}
      ],
      "toolCallId": "<string>"
    }
  ],
  "skillPersona": "<string>",
  "agentPersona": "<string>",
  "systemPrompt": "<string>",
  "attachedContextFiles": [
    {
      "name": "<string>",
      "type": "<string>",
      "content": "<string>"
    }
  ]
}
'
"<string>"

Authorizations

nut-session
string
cookie
required

Session cookie authentication

Body

application/json
message
string
required

The user message to send

history
object[]

Previous conversation messages

skillPersona
string

Skill persona block to append to the system prompt. Overrides general guidance when provided.

agentPersona
string
deprecated

Deprecated — use skillPersona instead. Agent persona block to append to the system prompt.

systemPrompt
string

Custom system prompt. When omitted the server uses the default project-aware system prompt.

attachedContextFiles
object[]

Additional context files to include in the conversation. Each entry is injected as a user/assistant message pair before the final user message.

Response

Streamed plain-text response. The body is a UTF-8 text stream containing only the assistant's generated content (tool calls and results are processed server-side and not exposed).

Plain-text stream of assistant content