Guides

Getting Started

From credentials to your first response in a few minutes.

Prerequisites

You’ll need a Klart AI workspace with at least one configured agent. If your team doesn’t have one yet, request access or talk to us first.

1. Get your credentials

Every request needs two values, both found in the API Keys section of your workspace at admin.klartai.com:

  • An API key, sent as the x-api-key header.
  • Your team ID, sent as the Klart-Team-Id header.

See Authentication for how these are used and what happens if either is missing or wrong.

2. Make your first request

Send a POST request to /chat with the agent you want to talk to (mention) and a list of messages:

cURL · POST /chat
curl -X POST "https://prod.klartprompts.com/api/chat" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Klart-Team-Id: YOUR_TEAM_ID" \
  -d '{
    "mention": "sales-assistant",
    "messages": [
      { "role": "user", "content": "How can I take some days off?" }
    ]
  }'

What is mention?

mentionidentifies which of your configured agents should answer — a free-form value with no special characters that your team defines when setting up agents. Check your Klart AI dashboard if you’re not sure which value to use for a given agent.

3. Read the response

A successful call returns the agent’s answer, plus any source documents it grounded the answer in:

200 OK
{
  "response": "You can request time off from the Time Off tab in the HR portal. Your manager will need to approve it before it's confirmed.",
  "documents": [
    { "url": "https://your-company.example/hr/time-off-policy", "title": "Time Off Policy" }
  ]
}

documentsis omitted or empty when the agent didn’t need to cite a specific source. See the API Reference for the full response schema.

Next steps

  • API Reference — full request/response schema and an interactive request builder.
  • Errors — every error response you might see and what to do about it.