Skip to content

Getting Started

Marcello Marchetti edited this page Jun 5, 2026 · 4 revisions

Getting Started

This guide walks you from zero to your first agent chat against the XRCopilot public API — first with a raw REST call, then with each of the three official SDKs.

For the full HTTP contract see REST-API-Reference; for the SDK surface see SDK-Overview.


1. Prerequisites

To call the API you need:

  • A tenant (company) on the XRCopilot platform, identified by your companyId.
  • A subscription key — the API key used to authenticate every request.
  • At least one configured, active agent inside a topic, so you have a topicId, agentId, and endpointId to chat with. Agents are created and activated from the platform UI (see the Administrator-Guide and User-Manuals).

If you do not yet have a subscription key, contact your Hevolus account manager or platform administrator.


2. Authentication

All API requests require authentication using a subscription key passed in the request header.

Header:

Ocp-Apim-Subscription-Key: <YOUR_API_KEY>

Every request must include this header. Requests without a valid key are rejected.


3. Base URL

All endpoints are served under the production base URL:

https://apim-hipexr-prod-italynorth.azure-api.net/api/lab-public/

Every request must also include the API version as a query parameter:

Environment Version Parameter
Production api-version=2025-05-01

4. Your first chat — REST

The basic chat call is synchronous: POST /agents/{companyId}/{topicId}/{agentId}/{endpointId}/chat runs the agent and returns the assistant's reply directly in the HTTP response body. Because the agent may invoke skills, search, or deep reasoning, a single call can take many seconds to complete.

Long-running conversations. If you would rather not hold the connection open, use the asynchronous variant (StartChatAsync / start_chat / startChatAsync, which posts to .../chat-async). It returns immediately with a 202 Accepted and a conversationId you poll for the result; see SDK-Overview.

Send a message to an agent with POST /agents/{companyId}/{topicId}/{agentId}/{endpointId}/chat:

curl -X POST "https://apim-hipexr-prod-italynorth.azure-api.net/api/lab-public/agents/company-id/topic-id/agent-id/endpoint-id/chat?api-version=2025-05-01" \
  -H "Ocp-Apim-Subscription-Key: <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "companyId": "company-id",
    "topicId": "topic-id",
    "agentId": "agent-id",
    "endpointId": "endpoint-id",
    "message": "What products do you offer for enterprise customers?",
    "conversationId": "<YOUR_CONVERSATION_ID>",
    "answerLanguage": "en"
  }'

Reuse the same conversationId on subsequent requests to continue the conversation. For the full request/response schema, error codes, and the conversation-history endpoint used to retrieve replies, see REST-API-Reference.


5. Your first chat — SDK

Install the SDK for your platform (see SDK-Overview for full installation details), then run the minimal snippet below. As noted in section 4, ChatAsync / chat / chatAsync is synchronous — it sends the message and returns the assistant's reply in the response (which can take many seconds). For long-running conversations you can use the asynchronous variant (StartChatAsync / start_chat / startChatAsync), which returns immediately and lets you poll the conversation history for the result; see SDK-Overview.

.NET

dotnet add package Hevolus.XRCopilotLab.Client.Public
using XRCopilotLab.Client;

var client = new AppClient("<YOUR_API_KEY>");

var prompt = new UserPrompt
{
    CompanyId = "company-id",
    TopicId = "topic-id",
    AgentId = "agent-id",
    EndpointId = "endpoint-id",
    Message = "Hello, how can you help me?"
};

var response = await client.Agents.ChatAsync(prompt);
Console.WriteLine(response.Message);

JavaScript

npm install xrcopilotlab.client.public.js
const XRCopilotLabClient = require('xrcopilotlab.client.public.js');

const client = new XRCopilotLabClient("<YOUR_API_KEY>");

const prompt = {
    CompanyId: "company-id",
    TopicId: "topic-id",
    AgentId: "agent-id",
    EndpointId: "endpoint-id",
    Message: "Hello, how can you help me?"
};

const response = await client.chatAsync(prompt);
console.log(response.Message);

Python

pip install hevolus-xrcopilotlab
import asyncio
from xrcopilotlab import XRCopilotLabClient
from xrcopilotlab.models import UserPrompt


async def main():
    async with XRCopilotLabClient(api_key="<YOUR_API_KEY>") as client:
        prompt = UserPrompt(
            company_id="company-id",
            topic_id="topic-id",
            agent_id="agent-id",
            endpoint_id="endpoint-id",
            message="Hello, how can you help me?",
        )
        response = await client.agents.chat(prompt)
        print(response.message)


asyncio.run(main())

Next steps

Clone this wiki locally