API Reference
POST /v1/verify

POST /v1/verify

Verify claims in AI-generated text against the Glyphmine knowledge graph.

Endpoint

POST https://api.glyphnet.io/v1/verify

Authentication

Requires API key in X-API-Key header.

Request Body

FieldTypeRequiredDescription
textstringYesText to verify (max 10,000 characters)
modestringNoblocking, flagging, or logging. Default: flagging
extract_claimsbooleanNoExtract individual claims. Default: true
optionsobjectNoAdditional options (see below)

Options Object

FieldTypeDefaultDescription
min_confidencenumber0.5Minimum confidence threshold (0.0-1.0)
include_evidencebooleantrueInclude evidence in response
max_claimsnumber50Maximum 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

FieldTypeDescription
request_idstringUnique request identifier
modestringVerification mode used
claimsarrayArray of claim objects
summaryobjectAggregated statistics
flaggedbooleanTrue if any claims unverified
blockedbooleanTrue if blocking mode and failed
processing_time_msnumberProcessing time in milliseconds

Claim Object

FieldTypeDescription
textstringThe extracted claim text
verifiedbooleanWhether the claim was verified
confidencenumberConfidence score (0.0 to 1.0)
sourcestringKnowledge graph source
patharrayConcept path in the graph
evidencestringSupporting evidence
reasoningstringExplanation of verification

Summary Object

FieldTypeDescription
total_claimsnumberTotal claims extracted
verifiednumberClaims that were verified
unverifiednumberClaims that couldn't be verified
avg_confidencenumberAverage confidence score

Verification Modes

ModeBehavior
flaggingReturns results with flagged: true if any claims unverified
blockingReturns blocked: true and 400 status if any claims unverified
loggingSilent 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"
  }
}