API reference

AI Assistant

API referencehttps://api.contit.cloud

AI Assistant

Endpoints for interacting with the Contit AI assistant, including starting threads, checking run status, and retrieving responses.

POST /ai-assistant/thread

Start AI thread

Start a new AI assistant conversation thread or continue an existing one by providing a prompt.

Richiede la policy ReadAccess

Corpo della richiesta application/json

ProprietàTipoObbligatorioDescrizione
threadId string — Existing thread ID to continue, or null to start a new conversation
prompt string The user's message or question

Risposte

200Success — returns thread and run identifiers
threadIdstringThe thread ID (use for subsequent requests)
runIdstringThe run ID (use to check status)
401Unauthorized

Esempi di codice

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"
}'
Esempio di richiesta
{
  "threadId": null,
  "prompt": "List all published articles from March 2026"
}
Esempio di risposta 200
{
  "threadId": "thread_abc123def456ghi789",
  "runId": "run_xyz789abc123def456"
}
Prova Live
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'.

Richiede la policy ReadAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
threadIdstringThe thread ID returned from the start endpoint
runIdstringThe run ID returned from the start endpoint

Risposte

200Success
statusstringRun status: 'completed', 'in_progress', or 'failed'
401Unauthorized
404Not Found — thread or run does not exist

Esempi di codice

curl -X GET "https://api.contit.cloud/ai-assistant/thread/{threadId}/run/{runId}/status" \
  -H "X-Api-Key: YOUR_API_KEY"
Esempio di richiesta
GET /ai-assistant/thread/thread_abc123def456ghi789/run/run_xyz789abc123def456/status
Esempio di risposta 200
{
  "status": "completed"
}
Prova Live
GET /ai-assistant/thread/{threadId}/response

Get AI response

Retrieve the AI assistant's response text for a completed thread run.

Richiede la policy ReadAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
threadIdstringThe thread ID

Risposte

200Success
responsestringThe AI assistant's response text
401Unauthorized
404Not Found

Esempi di codice

curl -X GET "https://api.contit.cloud/ai-assistant/thread/{threadId}/response" \
  -H "X-Api-Key: YOUR_API_KEY"
Esempio di richiesta
GET /ai-assistant/thread/thread_abc123def456ghi789/response
Esempio di risposta 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?"
}
Prova Live