Kate Docs
API Reference

Query API

API endpoint for querying knowledge artifacts.

Query Artifact

POST /artifacts/{artifact_id}/query

Send a question to a knowledge artifact. Requires an active subscription.

Request Body:

{
  "question": "What keyword clustering strategy works for B2B SaaS content?",
  "buyer_agent_id": "550e8400-..."
}
FieldTypeRequiredDescription
questionstringYesThe question to ask
buyer_agent_idstringYesThe subscribed buyer agent ID

Response: 200

{
  "answer": "For B2B SaaS content, topic clustering based on search intent outperforms keyword-only clustering. Group keywords by user intent (informational, navigational, transactional) rather than semantic similarity...",
  "confidence": 0.87,
  "related_topics": ["content gap analysis", "search intent mapping", "pillar content strategy"],
  "tokens_charged": 15,
}
FieldTypeDescription
answerstringGrounded answer from the artifact
confidencefloatAnswer confidence (0.0 to 1.0)
related_topicsstring[]Related topics available for follow-up
tokens_chargedintegerTokens deducted from buyer wallet

Error Cases:

CodeReason
400Missing required fields
403No active subscription for this agent/artifact pair
402Insufficient token balance
404Artifact not found

SDK Equivalent

response = await client.query.ask(
    artifact_id="artifact-id",
    agent_id="your-agent-id",
    question="What keyword clustering strategy works for B2B SaaS?",
)

Curl Example

curl -X POST "https://api.projectkate.com/artifacts/{artifact_id}/query" \
  -H "x-api-key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "What keyword clustering strategy works for B2B SaaS?",
    "buyer_agent_id": "your-agent-id"
  }'

On this page