Skip to content

Base API

Use this endpoint to analyze user messages before they are sent to an LLM using validation rules configured in the Web UI.

When enabled, HiveTrace performs:

  • sensitive data detection and masking (dataclean)
  • built-in policy validation (guardrails)
  • custom policy validation
  • token usage calculation
  • session/user association
  • monitoring persistence

Use this endpoint to analyze LLM responses before they are returned to the end user using Web UI validation settings.

When enabled, HiveTrace performs:

  • sensitive data detection and masking (dataclean)
  • built-in policy validation (guardrails)
  • token usage calculation
  • session/user association
  • monitoring persistence

Note: Custom policies are applied only to /process_request/.


FieldTypeDescription
application_idstring (UUID)Application identifier. Must exist in HiveTrace.
messagestringUser message or LLM response depending on the endpoint.

FieldTypeDescription
additional_parametersobjectMetadata for session and user tracking.

FieldTypeDescription
user_idstringExternal user identifier.
session_idstringExternal session identifier.

Both endpoints return a JSON object.

FieldTypeDescription
request_idstringAnalysis record UUID.
schema_versionstringResponse schema version.
statusstringsuccess | partial_success | error
errorsstring[]List of processing errors (may be empty).
tokens.countintegerNumber of tokens processed.
tokens.usage_severitystring | nulllow | high | critical
guardrails.flaggedbooleanIndicates built-in policy violations.
custom_policy.flaggedbooleanIndicates custom policy violations.
dataclean.flaggedbooleanIndicates sensitive data was detected.
dataclean.cleaned_textstring | nullSanitized version of the message after masking or cleaning.
dataclean.types[]arrayDetected entity types with counts.
{
"type": "NAME",
"count": 1
}

Окно терминала
curl -sS -X POST "$BASE_URL/process_request/" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"application_id":"<uuid>",
"message":"My name is John and my CVC is 222.",
"additional_parameters":{
"user_id":"user-123",
"session_id":"session-456"
}
}'

Окно терминала
curl -sS -X POST "$BASE_URL/process_response/" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"application_id":"<uuid>",
"message":"Hello John, I have processed your request.",
"additional_parameters":{
"user_id":"user-123",
"session_id":"session-456"
}
}'

{
"request_id": "62c51dcf-f7bb-44d3-8c3a-6007b2a44d7d",
"schema_version": "2.0.0",
"status": "success",
"errors": [],
"tokens": {
"count": 8,
"usage_severity": null
},
"guardrails": {
"flagged": false
},
"custom_policy": {
"flagged": false
},
"dataclean": {
"flagged": true,
"cleaned_text": "My name is XXXX",
"types": [
{
"type": "NAME",
"count": 1
}
]
}
}