Skip to main content
POST
/
v2
/
chat
Chat endpoint
curl --request POST \
  --url https://api.infyn.dev/v2/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "user_id": "<string>",
  "message": "<string>",
  "chat_id": "<string>",
  "thread_id": "<string>",
  "max_context_tokens": 123
}
'
{
  "response": "<string>",
  "context_used": [
    {
      "content": "<string>",
      "relevance_score": 123,
      "recency_score": 123,
      "combined_score": 123,
      "source_type": "RECENT_CHAT",
      "timestamp": "2023-11-07T05:31:56Z",
      "thread_id": "<string>",
      "memory_id": "<string>",
      "chat_id": "<string>"
    }
  ],
  "memory_updated": true,
  "tokens_used": 123,
  "context_truncated": true,
  "chunks_created": 123,
  "thread_id": "<string>"
}

Authorizations

Authorization
string
header
required

Supply Authorization: Bearer <token>. The token can be either a JWT (from supported auth vendors) or an API key generated via /v1/api-key/generate.

Body

application/json
user_id
string
required

External or internal user identifier.

message
string
required
chat_id
string | null
thread_id
string | null
max_context_tokens
integer | null

Response

200 - application/json

Enhanced chat response

response
string
context_used
object[]
memory_updated
boolean
tokens_used
integer | null
context_truncated
boolean
chunks_created
integer | null
thread_id
string | null