POST
/
knowledge-bases
/
{knowledge_base_id}
/
chat
curl --request POST \
  --url https://api.totoy.ai/v1/knowledge-bases/{knowledge_base_id}/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "output_language": "en",
  "language_level": "plain",
  "markdown_response": true,
  "messages": [
    {
      "role": "user",
      "content": "Who are the co-founders of Totoy?"
    }
  ]
}'
{
  "project_id": "pj_avX7imfLaPcQnv5ckvGlOEBA9",
  "output_language": "en",
  "language_level": "plain",
  "answer": {
    "role": "assistant",
    "content": "Hi!\nThe co-founders of Totoy are Benedikt Hielscher, Francis Rafal, Marcel Koller, Michael Perger and Simon Hoffmann.[R1]",
    "references": [
      {
        "text": "[R1]",
        "source_id": "src_oXiYDg8QOc9JsOk86idRXiywD",
        "page_number": 5,
        "backlink": "https://www.totoy.ai/totoy-company-overview.pdf",
        "custom_metadata": {
          "internal_tag": "general_documents"
        }
      }
    ]
  },
  "knowledge_base_id": "kb_feMfJbeqbAEj4u8K5HqmKpUbY",
  "markdown_response": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

knowledge_base_id
string
required

Unique identifier for a Knowledge Base.

Maximum length: 28

Body

application/json

Response

200
application/json
OK

The response is of type object.