Skip to main content

Chat

Base URL: https://app.neuroflash.com/api/digital-twin-service

Chat with an individual digital twin. The twin responds based on its demographic profile, personality, and perspective.

Chat With Twin

POST/v1/workspaces/{workspace_id}/twins/{twin_id}/chat-completions

Path Parameters

ParameterTypeRequiredDescription
workspace_idstringYes
twin_idstringYes

Request Body

FieldTypeRequiredDescription
messagesarray<object>YesConversation history (at least one message required, last message must be from user)
rolestringYesRole: 'user' or 'assistant'
contentstringYesMessage content
attachmentsobjectNoList of file IDs to attach to this message (user messages only)
responseFormatobjectNoStructured output format using JSON schema. If null, uses default schema with 'answer' and 'reason' fields.
temperatureobjectNoSampling temperature for response generation
useWebSearchobjectNoWeb search mode: 'never', 'auto', or 'always'
useVerbalizedSamplingobjectNoGenerate 5 probability-weighted response options (tau=0.10). Mutually exclusive with custom responseFormat.

Example

curl -X POST "https://app.neuroflash.com/api/digital-twin-service/v1/workspaces/{workspace_id}/twins/{twin_id}/chat-completions" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messages": [],
"responseFormat": {},
"temperature": {},
"useWebSearch": {},
"useVerbalizedSampling": {}
}'

Response:

{}