AI Assistant
Endpoints for interacting with the Contit AI assistant, including starting threads, checking run status, and retrieving responses.
Base URL: https://api.contit.cloud
POST
/ai-assistant/thread
Start AI thread
Start a new AI assistant conversation thread or continue an existing one by providing a prompt.
Requires
ReadAccess policy
Request Body application/json
| Property | Type | Required | Description |
|---|---|---|---|
threadId |
string | — | Existing thread ID to continue, or null to start a new conversation |
prompt |
string | ✓ | The user's message or question |
Responses
200
Success — returns thread and run identifiers
threadId |
string | The thread ID (use for subsequent requests) |
runId |
string | The run ID (use to check status) |
401
Unauthorized
Code examples
curl -X POST "https://api.contit.cloud/ai-assistant/thread" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"threadId": "threadId_value",
"prompt": "prompt_value"
}'
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");
var content = new StringContent("{
\"threadId\": \"threadId_value\",
\"prompt\": \"prompt_value\"
}",
Encoding.UTF8, "application/json");
var response = await http.PostAsync(
"https://api.contit.cloud/ai-assistant/thread", content);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
"https://api.contit.cloud/ai-assistant/thread",
{
method: "POST",
headers: {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"threadId": "threadId_value",
"prompt": "prompt_value"
})
}
);
const data = await response.json();
import requests
headers = {"X-Api-Key": "YOUR_API_KEY"}
payload = {
"threadId": "threadId_value",
"prompt": "prompt_value"
}
response = requests.post(
"https://api.contit.cloud/ai-assistant/thread",
json=payload,
headers=headers
)
data = response.json()
Example Request
{
"threadId": null,
"prompt": "List all published articles from March 2026"
}
Example Response
200
{
"threadId": "thread_abc123def456ghi789",
"runId": "run_xyz789abc123def456"
}
Try it
Live
curl
Response
GET
/ai-assistant/thread/{threadId}/run/{runId}/status
Check AI run status
Check the status of an AI assistant run. Poll this endpoint until the status is 'completed' or 'failed'.
Requires
ReadAccess policy
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
threadId |
string | ✓ | The thread ID returned from the start endpoint |
runId |
string | ✓ | The run ID returned from the start endpoint |
Responses
200
Success
status |
string | Run status: 'completed', 'in_progress', or 'failed' |
401
Unauthorized
404
Not Found — thread or run does not exist
Code examples
curl -X GET "https://api.contit.cloud/ai-assistant/thread/{threadId}/run/{runId}/status" \
-H "X-Api-Key: YOUR_API_KEY"
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");
var response = await http.GetAsync("https://api.contit.cloud/ai-assistant/thread/{threadId}/run/{runId}/status");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
"https://api.contit.cloud/ai-assistant/thread/{threadId}/run/{runId}/status",
{
method: "GET",
headers: {
"X-Api-Key": "YOUR_API_KEY",
}
}
);
const data = await response.json();
import requests
headers = {"X-Api-Key": "YOUR_API_KEY"}
response = requests.get(
"https://api.contit.cloud/ai-assistant/thread/{threadId}/run/{runId}/status",
headers=headers
)
data = response.json()
Example Request
GET /ai-assistant/thread/thread_abc123def456ghi789/run/run_xyz789abc123def456/status
Example Response
200
{
"status": "completed"
}
Try it
Live
curl
Response
GET
/ai-assistant/thread/{threadId}/response
Get AI response
Retrieve the AI assistant's response text for a completed thread run.
Requires
ReadAccess policy
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
threadId |
string | ✓ | The thread ID |
Responses
200
Success
response |
string | The AI assistant's response text |
401
Unauthorized
404
Not Found
Code examples
curl -X GET "https://api.contit.cloud/ai-assistant/thread/{threadId}/response" \
-H "X-Api-Key: YOUR_API_KEY"
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");
var response = await http.GetAsync("https://api.contit.cloud/ai-assistant/thread/{threadId}/response");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
"https://api.contit.cloud/ai-assistant/thread/{threadId}/response",
{
method: "GET",
headers: {
"X-Api-Key": "YOUR_API_KEY",
}
}
);
const data = await response.json();
import requests
headers = {"X-Api-Key": "YOUR_API_KEY"}
response = requests.get(
"https://api.contit.cloud/ai-assistant/thread/{threadId}/response",
headers=headers
)
data = response.json()
Example Request
GET /ai-assistant/thread/thread_abc123def456ghi789/response
Example Response
200
{
"response": "I found 12 published articles from March 2026. Here are the most recent:\n\n1. **Breaking News** (March 15)\n2. **Weekly Update** (March 14)\n3. **Tech Review** (March 12)\n\nWould you like me to show more details about any of these?"
}
Try it
Live
curl
Response