Complete in 5 minutes

Your First API Call

Get started with Tork in three simple steps. By the end of this guide, you'll have made your first content evaluation request.

1

Create Your Account

Sign up for a free Tork account to get started.

Create your account at the Tork dashboard. The free tier includes:

  • 1,000 API calls per month
  • Access to all evaluation endpoints
  • Basic analytics dashboard
  • Email support
Create Free Account
2

Get Your API Key

Generate an API key from your dashboard.

Once logged in, navigate to Settings → API Keys and click "Generate New Key".

Your API Key
tork_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
⚠️

Keep your API key secure. Never expose it in client-side code or public repositories.

3

Make Your First Call

Install the SDK and scan text for PII.

Python

bash
pip install tork-governance
python
from tork import Tork

# Initialize the client with your API key
tork = Tork(api_key="your_api_key")

# Scan text for PII
result = tork.govern("Check this text for PII: john@example.com")

print(f"Action: {result['action']}")      # "redact"
print(f"Redacted: {result['redacted']}")  # "Check this text for PII: [EMAIL]"

JavaScript

bash
npm install @tork/governance
javascript
import { Tork } from '@tork/governance';

// Initialize the client with your API key
const tork = new Tork({ apiKey: 'your_api_key' });

// Scan text for PII
const result = await tork.govern('Check this text for PII: john@example.com');

console.log('Action:', result.action);      // "redact"
console.log('Redacted:', result.redacted);  // "Check this text for PII: [EMAIL]"

cURL

Replace YOUR_API_KEY with your actual API key:

bash
curl -X POST https://api.torkgovernance.com/v1/govern \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "content": "Check this text for PII: john@example.com"
  }'

Expected Response

json
{
  "action": "redact",
  "redacted": "Check this text for PII: [EMAIL]",
  "original": "Check this text for PII: john@example.com",
  "pii_detected": [
    {
      "type": "email",
      "value": "john@example.com",
      "position": { "start": 27, "end": 43 },
      "confidence": 0.99
    }
  ],
  "processing_time_ms": 45,
  "request_id": "req_abc123xyz"
}

Understanding the Response

actionGovernance decision: allow, redact, or deny
redactedText with PII replaced by placeholders
originalThe original input text
pii_detectedArray of detected PII with types and positions
processing_time_msTime to process in milliseconds
request_idUnique ID for this request (useful for debugging)

Bonus: Test PII Detection

See how Tork detects sensitive PII

Try this example to see how Tork detects sensitive PII like SSN and credit cards:

bash
curl -X POST https://api.torkgovernance.com/v1/govern \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "content": "My SSN is 123-45-6789 and credit card is 4111-1111-1111-1111"
  }'

Response (Unsafe Detected)

json
{
  "action": "deny",
  "redacted": "My SSN is [SSN] and credit card is [CREDIT_CARD]",
  "pii_detected": [
    { "type": "ssn", "value": "123-45-6789", "confidence": 0.99 },
    { "type": "credit_card", "value": "4111-1111-1111-1111", "confidence": 0.98 }
  ],
  "policy_applied": "default",
  "processing_time_ms": 52,
  "request_id": "req_def456uvw"
}

Notice how action: "deny" blocks high-risk PII and the pii_detected array shows what was found.

You're All Set!

You've successfully made your first API call. Explore the full documentation to discover all available endpoints and features.

Quick Reference

Base URL
https://api.torkgovernance.com/v1
Auth Header
Authorization: Bearer <key>
Content-Type
application/json
Free Tier
1,000 calls/month

Documentation

Learn to integrate TORK

Upgrade Plan

Current: free

Support

Get help from our team