DenserAIDenserAI Docs
API

API Documentation

Use Denser.ai’s API chat integration to exchange messages programmatically. Build custom chat UIs, link external apps, and manage conversations via code.

Query the Denser chatbot programmatically to build custom experiences or integrations.

Request body

Prop

Type

Example requests

curl -X POST "https://denser.ai/api/query" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "What are the pricing options for Denser?",
    "chatbotId": "11111111-1111-1111-1111-111111111111",
    "key": "00000000-0000-0000-0000-000000000000",
    "context": [],
    "prompt": "",
    "model": "gpt-4o-mini",
    "citation": true
  }'
await fetch("https://denser.ai/api/query", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    question: "What are the pricing options for Denser?",
    chatbotId: "11111111-1111-1111-1111-111111111111",
    key: "00000000-0000-0000-0000-000000000000",
    context: [],
    prompt: "",
    model: "gpt-4o-mini",
    citation: true,
  }),
});

Responses

Answer with citations

{
  "statusCode": "200",
  "answer": "Denser.ai offers several pricing plans...",
  "passages": [
    {
      "source": "https://docs.denser.ai/docs/billing/upgrade",
      "text": "We offer four different subscription plans: Free Trial, Starter, Standard, and Business...",
      "score": 7.904721
    },
    {
      "source": "https://denser.ai/pricing",
      "text": "Use DenserChat for free. Upgrade to enable custom domains and more advanced features...",
      "score": 7.236598,
      "score_rerank": 5.964538097381592
    }
  ]
}
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": [
    "question must be a string",
    "key must be a string",
    "chatbotId must be a string"
  ]
}
{
  "statusCode": "401",
  "error": "Unauthorized",
  "message": "Invalid API key."
}
{
  "statusCode": "500",
  "error": "Internal Server Error",
  "message": "An internal server error occurred."
}