SDKs
Overview

SDKs Overview

Official client libraries for GlyphNet.

Available SDKs

LanguagePackageStatus
PythonglyphnetStable
JavaScript/TypeScript@glyphnet/sdkStable
cURLNativeN/A

Quick Comparison

from glyphnet import GlyphNet
 
client = GlyphNet(api_key="gn_live_...")
result = client.verify("The Earth orbits the Sun")
 
print(f"Verified: {result.verified}")
print(f"Confidence: {result.confidence}")

Features by SDK

FeaturePythonJavaScriptcURL
Automatic retriesManual
Rate limit handlingManual
Type hints/TypeScriptN/A
Async supportN/A
Response modelsJSON
Error classesHTTP codes
StreamingManual

Installation

Python

pip install glyphnet

Requirements: Python 3.8+

JavaScript/TypeScript

npm install @glyphnet/sdk
# or
yarn add @glyphnet/sdk
# or
pnpm add @glyphnet/sdk

Requirements: Node.js 16+

Configuration

Environment Variables

All SDKs support environment variable configuration:

export GLYPHNET_API_KEY="gn_live_..."
export GLYPHNET_BASE_URL="https://api.glyphnet.io"  # Optional
export GLYPHNET_TIMEOUT="30000"  # Optional, milliseconds

Client Options

from glyphnet import GlyphNet
 
client = GlyphNet(
    api_key="gn_live_...",
    base_url="https://api.glyphnet.io",  # Optional
    timeout=30.0,  # Optional, seconds
    max_retries=3,  # Optional
)

Error Handling

All SDKs provide typed error classes:

from glyphnet import GlyphNet
from glyphnet.errors import (
    AuthenticationError,
    RateLimitError,
    QuotaExceededError,
    ValidationError,
    APIError
)
 
client = GlyphNet()
 
try:
    result = client.verify(text)
except AuthenticationError:
    print("Invalid API key")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after}s")
except QuotaExceededError:
    print("Monthly quota exceeded")
except ValidationError as e:
    print(f"Invalid request: {e.message}")
except APIError as e:
    print(f"API error: {e.status_code}")

Response Types

Both SDKs provide strongly-typed response objects:

VerificationResult

interface VerificationResult {
    requestId: string;
    text: string;
    claims: Claim[];
    flagged: boolean;
    summary: {
        totalClaims: number;
        verified: number;
        unverified: number;
        avgConfidence: number;
    };
    processingTimeMs: number;
}
 
interface Claim {
    text: string;
    verified: boolean;
    confidence: number;
    sources?: string[];
}

Choosing an SDK

Use Python when:

  • Building backend services
  • Data processing pipelines
  • Machine learning workflows
  • Scripts and automation

Use JavaScript when:

  • Node.js backend services
  • Serverless functions (Vercel, AWS Lambda)
  • Full-stack TypeScript applications
  • Browser-based verification (via backend proxy)

Use cURL when:

  • Quick testing and debugging
  • Shell scripts
  • CI/CD pipelines
  • Learning the API

Support