Skip to main content
POST
/
api
/
v1
/
ai
/
conversations
/
chat
Chat with conversation memory
curl --request POST \
  --url https://api.dualship.run/api/v1/ai/conversations/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Workspace-Id: <x-workspace-id>' \
  --data '
{
  "conversation_id": "<string>",
  "message": "<string>",
  "workspace_id": "<string>",
  "document_ids": [
    "<string>"
  ],
  "max_history": 50,
  "max_tokens": 8192,
  "model": "<string>",
  "system_prompt": "<string>",
  "temperature": 1
}
'
{
  "content": "Here is my response...",
  "conversation_id": "conv_abc123",
  "input_tokens": 150,
  "model": "gpt-4",
  "output_tokens": 200
}

Authorizations

Authorization
string
header
required

JWT Bearer token authentication

Headers

X-Workspace-Id
string
required

Workspace ID

Body

application/json

Chat request

conversation_id
string
required
Required string length: 1 - 100
message
string
required
Minimum string length: 1
workspace_id
string
required
document_ids
string[]
Maximum array length: 10
max_history
integer
Required range: 1 <= x <= 100
max_tokens
integer
Required range: 1 <= x <= 16384
model
string
system_prompt
string
Maximum string length: 10000
temperature
number
Required range: 0 <= x <= 2

Response

Chat response

Conversation chat response

content
string
Example:

"Here is my response..."

conversation_id
string
Example:

"conv_abc123"

input_tokens
integer
Example:

150

model
string
Example:

"gpt-4"

output_tokens
integer
Example:

200