POST /v1/verify
Verify claims in AI-generated text against the Glyphmine knowledge graph.
Endpoint
POST https://api.glyphnet.io/v1/verifyAuthentication
Requires API key in X-API-Key header.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to verify (max 10,000 characters) |
mode | string | No | blocking, flagging, or logging. Default: flagging |
extract_claims | boolean | No | Extract individual claims. Default: true |
options | object | No | Additional options (see below) |
Options Object
| Field | Type | Default | Description |
|---|---|---|---|
min_confidence | number | 0.5 | Minimum confidence threshold (0.0-1.0) |
include_evidence | boolean | true | Include evidence in response |
max_claims | number | 50 | Maximum claims to extract |
Example Request
import requests
response = requests.post(
"https://api.glyphnet.io/v1/verify",
headers={
"X-API-Key": "gn_live_your_key_here",
"Content-Type": "application/json"
},
json={
"text": "The Earth orbits the Sun at an average distance of 93 million miles. The Moon orbits the Earth.",
"mode": "flagging",
"options": {
"min_confidence": 0.7,
"include_evidence": True
}
}
)
result = response.json()
print(f"Verified: {result['summary']['verified']}/{result['summary']['total_claims']}")Response
{
"request_id": "req_7f8a9b0c1d2e3f4a",
"mode": "flagging",
"claims": [
{
"text": "The Earth orbits the Sun",
"verified": true,
"confidence": 1.0,
"source": "astronomy/solar_system",
"path": ["earth", "orbits", "sun"],
"evidence": "Earth is the third planet from the Sun, completing one orbit every 365.25 days",
"reasoning": "Direct match found in knowledge graph via orbital relationship"
},
{
"text": "at an average distance of 93 million miles",
"verified": true,
"confidence": 0.95,
"source": "astronomy/distances",
"path": ["earth", "distance", "sun", "93_million_miles"],
"evidence": "1 AU (Earth-Sun distance) = 92.96 million miles",
"reasoning": "Matched via astronomical unit conversion"
},
{
"text": "The Moon orbits the Earth",
"verified": true,
"confidence": 1.0,
"source": "astronomy/moon",
"path": ["moon", "orbits", "earth"],
"evidence": "The Moon is Earth's only natural satellite",
"reasoning": "Direct match found in knowledge graph"
}
],
"summary": {
"total_claims": 3,
"verified": 3,
"unverified": 0,
"avg_confidence": 0.983
},
"flagged": false,
"blocked": false,
"processing_time_ms": 67
}Response Fields
Root Object
| Field | Type | Description |
|---|---|---|
request_id | string | Unique request identifier |
mode | string | Verification mode used |
claims | array | Array of claim objects |
summary | object | Aggregated statistics |
flagged | boolean | True if any claims unverified |
blocked | boolean | True if blocking mode and failed |
processing_time_ms | number | Processing time in milliseconds |
Claim Object
| Field | Type | Description |
|---|---|---|
text | string | The extracted claim text |
verified | boolean | Whether the claim was verified |
confidence | number | Confidence score (0.0 to 1.0) |
source | string | Knowledge graph source |
path | array | Concept path in the graph |
evidence | string | Supporting evidence |
reasoning | string | Explanation of verification |
Summary Object
| Field | Type | Description |
|---|---|---|
total_claims | number | Total claims extracted |
verified | number | Claims that were verified |
unverified | number | Claims that couldn't be verified |
avg_confidence | number | Average confidence score |
Verification Modes
| Mode | Behavior |
|---|---|
flagging | Returns results with flagged: true if any claims unverified |
blocking | Returns blocked: true and 400 status if any claims unverified |
logging | Silent mode - logs but always returns success |
See Verification Modes Guide for details.
Error Responses
400 Bad Request
{
"error": "invalid_request",
"message": "The 'text' field is required and must be a non-empty string."
}400 Text Too Long
{
"error": "text_too_long",
"message": "Text exceeds maximum length of 10,000 characters.",
"details": {
"max_length": 10000,
"actual_length": 15234
}
}401 Unauthorized
{
"error": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked."
}429 Rate Limited
{
"error": "rate_limit_exceeded",
"message": "You have exceeded your rate limit. Please retry after 60 seconds.",
"details": {
"limit": 200,
"reset_at": "2024-01-20T15:30:00Z"
}
}