Documentation

Everything you need to integrate CHETNA into your applications. Client-side hashing, REST API, and SDKs for JavaScript, Python, and Java.

Quickstart

1

Install the SDK

npm install @chetna/sdk
2

Get an API key

Sign up at chetnatech.com/signup, verify your email, then go to Account to generate a key. Free tier: 100 req/min.

3

Submit your first hash

import { ChetnaClient } from "@chetna/sdk";

const client = new ChetnaClient({ apiKey: "ck_..." });
const result = await client.submit("Your thought here");
console.log(result.hitCount); // How many others had this thought

API Reference

Base URL: https://chetnatech.com

POST/api/v1/hashes

Submit a hash to the public registry

Auth: Optional (API key for higher rate limits)
Request Body
{ "sha512": "...", "simhash": "...", "configFlags": 31, "category": "Technology" }
Response
{ "hashId": 42, "hitCount": 7, "isNew": false }
GET/api/v1/hashes/:sha512/count

Check how many times a hash has been seen

Auth: Optional
Response
{ "sha512": "abc...", "hitCount": 7, "firstSeen": "...", "lastHit": "..." }
GET/api/v1/hashes/:sha512/similar

Find similar hashes via SimHash (Hamming distance)

Auth: Optional
Response
{ "results": [{ "sha512": "...", "hammingDistance": 3, "hitCount": 5 }] }
GET/api/v1/trends

Get trending hashes by time period

Auth: Optional
Response
{ "trends": [{ "sha512": "...", "hitCount": 42, "category": "Tech" }] }
POST/api/v1/reveals

Reveal the original text behind a hash (optional)

Auth: Optional
Request Body
{ "hashId": 42, "text": "Will AI replace software engineers?" }
Response
{ "revealed": true }
GET/api/v1/registries

List your private registries

Auth: Required (session)
Response
{ "registries": [...] }
POST/api/v1/registries

Create a new registry

Auth: Required (session)
Request Body
{ "name": "my-registry", "description": "...", "isPublic": false }
Response
{ "registry": { "id": 1, "slug": "my-registry", ... } }
POST/api/v1/api-keys

Generate a new API key

Auth: Required (session, verified email)
Request Body
{ "name": "Production Key" }
Response
{ "key": "ck_...", "message": "Save this key now." }

SDKs

All SDKs hash text client-side before sending to the server. Your original text never leaves your device.

JavaScript / TypeScript

npm install @chetna/sdk
import { ChetnaClient } from "@chetna/sdk";

const client = new ChetnaClient({
  apiKey: "ck_your_api_key",
  baseUrl: "https://chetnatech.com",
});

// Submit a thought (hashed client-side)
const result = await client.submit("Will AI replace engineers?");
console.log(`Hit count: ${result.hitCount}`);

// Search for similar thoughts
const similar = await client.similar(result.sha512, { distance: 10 });

Python

pip install chetna
from chetna import ChetnaClient

client = ChetnaClient(
    api_key="ck_your_api_key",
    base_url="https://chetnatech.com",
)

# Submit a thought (hashed client-side)
result = client.submit("Will AI replace engineers?")
print(f"Hit count: {result.hit_count}")

# Search for similar thoughts
similar = client.similar(result.sha512, distance=10)

Java

Maven: app.chetna:chetna-sdk:0.1.0
import app.chetna.client.ChetnaClient;

ChetnaClient client = new ChetnaClient(
    "ck_your_api_key",
    "https://chetnatech.com"
);

// Submit a thought (hashed client-side)
var result = client.submit("Will AI replace engineers?");
System.out.println("Hit count: " + result.getHitCount());

cURL

# Submit a pre-computed hash
curl -X POST https://chetnatech.com/api/v1/hashes \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ck_your_api_key" \
  -d '{"sha512":"abc123...","configFlags":31}'

# Check hit count
curl https://chetnatech.com/api/v1/hashes/abc123.../count

# Get trending
curl https://chetnatech.com/api/v1/trends?period=24h&limit=20

Authentication

API Keys

Pass your API key in the X-API-Key header. Keys start with ck_ and are 43 characters long.

X-API-Key: ck_a1b2c3d4e5f6g7h8i9j0...

Public Access (No Key)

All read and write endpoints work without authentication at reduced rate limits (30 req/min per IP). API keys unlock higher limits.

Key Security

  • Keys are shown only once on creation — we store only the SHA-256 hash
  • Rotate keys by revoking the old one and creating a new one
  • Never expose keys in client-side code or public repositories

Rate Limits

TierRate LimitAPI KeysPrice
Public (no key)30 / minFree
Free (with key)100 / min2$0
Pro1,000 / min10$9/mo
Enterprise10,000+ / min50Custom

Rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) are returned on 429 responses.