Converse With Live Data
The chat API provides a seamless way to converse with our AI, leveraging your data from third-party integrations and documents in Hyper Drive. Enhance your chat interactions by optionally specifying a context_id
to focus the conversation within a particular contextual group.
POST /v1/chat
Initiate a conversation with our AI by making a POST request to the /v1/chat
endpoint, ensuring to include your API key for authentication. Provide the entire message history to maintain contextual continuity. Below is an example using cURL, with an optional "context_id":
Example request
curl -X POST https://api.gethyper.ai/v1/chat \
-H "Authorization: Bearer {api_key}" \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "Summarize our sales in Q3"}], "context_id": "f03f7113-d60e-472f-a266-8e0a1f091386"}'
Protect your API key diligently and reset it immediately if you suspect any security issues.
Response
The AI will search the embeddings from your documents and data to find and present the relevant information. For the given query, the response might look like this:
Example response
"The Q3 sales report highlights a steady growth in product sales, with a notable increase in new customer acquisitions. The document also outlines key areas for improvement and strategies for the upcoming quarter."