Documentation
Everything you need to integrate CHETNA into your applications. Client-side hashing, REST API, and SDKs for JavaScript, Python, and Java.
Quickstart
Install the SDK
npm install @chetna/sdk
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.
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 thoughtAPI Reference
Base URL: https://chetnatech.com
POST/api/v1/hashes
Submit a hash to the public registry
{ "sha512": "...", "simhash": "...", "configFlags": 31, "category": "Technology" }{ "hashId": 42, "hitCount": 7, "isNew": false }GET/api/v1/hashes/:sha512/count
Check how many times a hash has been seen
{ "sha512": "abc...", "hitCount": 7, "firstSeen": "...", "lastHit": "..." }GET/api/v1/hashes/:sha512/similar
Find similar hashes via SimHash (Hamming distance)
{ "results": [{ "sha512": "...", "hammingDistance": 3, "hitCount": 5 }] }GET/api/v1/trends
Get trending hashes by time period
{ "trends": [{ "sha512": "...", "hitCount": 42, "category": "Tech" }] }POST/api/v1/reveals
Reveal the original text behind a hash (optional)
{ "hashId": 42, "text": "Will AI replace software engineers?" }{ "revealed": true }GET/api/v1/registries
List your private registries
{ "registries": [...] }POST/api/v1/registries
Create a new registry
{ "name": "my-registry", "description": "...", "isPublic": false }{ "registry": { "id": 1, "slug": "my-registry", ... } }POST/api/v1/api-keys
Generate a new API key
{ "name": "Production Key" }{ "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/sdkimport { 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 chetnafrom 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.0import 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=20Authentication
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
| Tier | Rate Limit | API Keys | Price |
|---|---|---|---|
| Public (no key) | 30 / min | — | Free |
| Free (with key) | 100 / min | 2 | $0 |
| Pro | 1,000 / min | 10 | $9/mo |
| Enterprise | 10,000+ / min | 50 | Custom |
Rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) are returned on 429 responses.