AskVault API: get started
The AskVault API lets your own code ask your agent a question and get an answer grounded in your content, with the sources it came from. Create an API key, send a POST request, and you have your first cited answer in a few minutes.
Before you start
Starter+- A workspace with content. Add your website or files first. Pages become available to the API as they are indexed. See Add your website.
- A paid plan. The API starts on Starter. The Free plan does not include API access. Webhooks need Growth.
- An API key. Create one in API keys. The key identifies the workspace, so requests never carry a workspace id.
- Any HTTP client. There are no official SDKs. curl,
fetch, Pythonrequestsor whatever you already use all work. Keep the key on your server, never in browser or mobile code.
Your first request
-
Create an API key and copy it. It starts with
ak_and is shown once. -
Send a question:
Terminal window curl -X POST https://api.askvault.co/v1/query \-H "Authorization: Bearer ak_xxx" \-H "Content-Type: application/json" \-d '{"query": "What is your refund policy?"}' -
Read
answerandsourcesin the JSON that comes back. Each source names the document and, when it has one, the page URL, so you can show your user where the answer came from.
If the content does not cover the question, the agent says it does not know instead of guessing, and sources comes back empty. Treat an empty sources as the signal to route the question to a person.
What you can build
Everything below uses the same agent, knowledge and rules as your widget and channels, and uses the same message credits.
Common patterns:
- A chat window in your own product. Call
/v1/query/streamfrom your server and relay the words to your front end. - A helper inside your support tool. Call
/v1/queryto draft a suggested reply, and send the sources along with it. - Your own mobile app. Your app calls your server, and your server calls AskVault with the key.
Keep a stable session_id per end user so each person has their own conversation under one key. See Ask a question with the API.
Limits at a glance
Each key defaults to 60 requests a minute and 1,000 a day, and can be raised to 1,000 a minute and 100,000 a day in the new dashboard. Errors come back as JSON with a detail message and an X-Request-ID header. See API errors and rate limits.