Skip to main content
POST
/
chat
/
query
cURL
curl --request POST \
  --url https://api-prod.voltai.ai/chat/query/ \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "query": "<string>",
  "user_id": "<string>",
  "mode": "AUTO",
  "chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "topic_names": [
    "<string>"
  ]
}
'
{
  "final_answer": "<string>",
  "chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "chat_url": "<string>",
  "sources": [
    {
      "source_name": "<string>",
      "page": 123,
      "url": "<string>"
    }
  ],
  "mode": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.voltai.ai/llms.txt

Use this file to discover all available pages before exploring further.

Use POST /chat/query/ to ask a question and optionally continue the same conversation by sending back the returned chat_id. By default, the agent selects topic scope automatically; you can optionally pin scope to one or more knowledge topics with topic_names. Send your API key in the X-API-KEY header. The body must include query and user_id.

Request Notes

  • user_id (required) — your application’s identifier for the end-user making the request. Each (API key, user_id) pair is limited to one concurrent request. If the same user already has a request in flight, the endpoint returns 429.
  • mode controls the reasoning strategy. Defaults to AUTO.
    • AGENTIC — multi-step reasoning with tool use. Higher latency, best accuracy.
    • FAST — single-pass retrieval and generation. Lowest latency, good for simple look-ups.
    • AUTO — the system classifies the query and picks AGENTIC or FAST automatically.
  • chat_id — send the chat_id from a previous response to continue the same thread. Omit it to start a new thread.
  • topic_names (optional) — list of knowledge topic names to scope retrieval to (e.g. ["Family A", "Family B"]). Each name must match a topic in your organization (case-insensitive). If omitted or [], topic scope is chosen automatically. If any name does not match a topic, the endpoint returns 400.

Response Notes

  • The endpoint returns a single JSON object, not an array.
  • final_answer is the cleaned answer text returned by the agent.
  • chat_id is the chat thread UUID (Chat primary key). Pass it back in subsequent requests to continue the conversation.
  • chat_url is the web UI link for this thread: https://{app_host}/{org_name}/chat/{chat_id}, where {org_name} is the resolved organization’s name and {app_host} is your deployment’s application host.
  • sources contains text citations only, with a filename, page number, and library URL.
  • mode returns the reasoning mode that was actually used. When the request sends AUTO, this field reveals whether the system chose AGENTIC or FAST.

Concurrency & Sessions

Each (API key, user_id) pair is limited to one concurrent request. If a second request arrives for the same pair while one is still in progress, the API returns 429 with error code user_session_limit_exceeded. There is also an organization-wide session limit. If all org-level seats are occupied, the API returns 429 with error code session_limit_exceeded. Use GET /chat/sessions/ to check current session usage and see which user IDs are active.

Example Request

{
  "query": "What is EMEM?",
  "user_id": "usr_82af91",
  "mode": "AUTO"
}

Scoped to one or more topics (optional)

{
  "query": "What is the maximum operating temperature?",
  "user_id": "usr_82af91",
  "topic_names": ["Example Product Family"]
}

Follow-up Request (continuing a thread)

{
  "query": "What is the maximum operating temperature?",
  "user_id": "usr_82af91",
  "chat_id": "2d8a39d8-29d6-4f0f-bc5f-4c5f0f9c9d54"
}

Example Response

{
  "final_answer": "EMEM is embedded memory integrated into the device for storing code and data.",
  "chat_id": "2d8a39d8-29d6-4f0f-bc5f-4c5f0f9c9d54",
  "chat_url": "https://voltai.ai/ExampleOrg/chat/2d8a39d8-29d6-4f0f-bc5f-4c5f0f9c9d54",
  "sources": [
    {
      "source_name": "example-datasheet.pdf",
      "page": 12,
      "url": "https://voltai.ai/ExampleOrg/library?source_name=example-datasheet.pdf&source_page=12&source_type=text"
    }
  ],
  "mode": "FAST"
}

429 — Per-User Limit

{
  "error": "user_session_limit_exceeded",
  "message": "user_id 'usr_82af91' already has an active request. Please wait for it to complete.",
  "user_id": "usr_82af91"
}

429 — Org-Level Limit

{
  "error": "session_limit_exceeded",
  "message": "You have exceeded the session quota limit for your organization. Please try again later.",
  "total_seats": 10,
  "active_seats": 10,
  "available_seats": 0
}

Authorizations

x-api-key
string
header
required

Headers

Accept
enum<string>

Set to text/event-stream to opt into Server-Sent Events streaming. Any other value (or omitting the header) returns the standard JSON response.

Available options:
application/json,
text/event-stream

Body

application/json

Query payload for the Voltai agent.

Provide query and user_id. Topic scope is chosen automatically unless you pass topic_names.

query
string
required

The user's question.

user_id
string
required

Your application's identifier for the end-user making the request. Used for per-user session tracking and concurrency enforcement. Each (API key, user_id) pair is limited to one concurrent request.

Maximum string length: 255
mode
enum<string>
default:AUTO

Reasoning mode. AGENTIC uses multi-step reasoning and tool use for higher accuracy at higher latency. FAST uses single-pass retrieval for the lowest latency. AUTO (default) lets the system choose automatically based on query complexity.

Available options:
AGENTIC,
FAST,
AUTO
chat_id
string<uuid>

Existing chat ID to continue a prior thread. Omit to create a new chat.

topic_names
string[]

Optional. Names of knowledge topics to scope retrieval to. Each must match a topic in your organization (case-insensitive). If omitted or empty, topic scope is chosen automatically. If any name does not match a topic, the request returns 400.

Response

Agent response. Returned as a single JSON object by default, or as a Server-Sent Events stream when the request includes Accept: text/event-stream.

Agent response.

final_answer
string
required

Answer text returned by the Voltai agent after stripping internal tags and citation markup.

chat_id
string<uuid>
required

Thread identifier: the Chat UUID for this conversation. Reuse this value in subsequent requests to continue the same thread.

chat_url
string<uri>
required

Web UI link to this thread: https://voltai.ai/{organization_name}/chat/{chat_id} using the resolved organization's name.

sources
object[]
required

Text sources used to answer the question.

mode
string | null
required

The reasoning mode that was actually used to handle the query. When the request mode is AUTO, this field shows whether the system chose AGENTIC or FAST.