SDKs for Python, JavaScript, Go, and PHP (preview)
Use the shipped REST API today. The language-specific SDKs below are previews of intended interfaces, not published packages.
SDK status: in development
These packages are not yet published to PyPI, npm, a Go module, or Packagist - the code samples below are previews of the planned client API. The package names shown are planned namespaces, not reserved or installable - they will only become install instructions once published under verified publisher accounts. Everything on this page already works today over plain HTTP: POST https://sentiqra.tech/v1/analyze with your API key. The quickstart has copy-paste curl examples. Want early access to a specific language SDK? Tell us.
One REST contract across 10 production analyzers; native SDK libraries remain in preview.
Python · JavaScript · Go · PHP · REST
Available now: REST
Marketplace moderation: runnable REST examples
Use Trust & Safety for the first analyzer in a marketplace listing or messaging review. These cURL, Python and JavaScript requests come from api-contract/registry.yaml through ApiSnippetGenerator. Native SDK package code shown elsewhere on this page is non-installable preview material.
| Interface | Status | Use today |
|---|---|---|
| REST API | Shipped | Server-side HTTP client with Bearer key |
| Python / JavaScript SDK | Preview | No published package; use REST samples below |
| Go / PHP SDK | Not available | Planned interfaces only; use REST |
cURL — working REST request
curl -X POST https://sentiqra.tech/v1/analyze \
-H "Authorization: Bearer $SENTIQRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "you are a worthless idiot",
"language": "en",
"analyzers": [
"trust-safety"
]
}'
Python (server-side) — working REST request
import os
import requests
response = requests.post(
"https://sentiqra.tech/v1/analyze",
headers={
"Authorization": f"Bearer {os.environ['SENTIQRA_API_KEY']}",
"Content-Type": "application/json",
},
json={
"text": "you are a worthless idiot",
"language": "en",
"analyzers": ["trust-safety"],
},
timeout=10,
)
response.raise_for_status()
data = response.json()
for signal in data["signals"]:
print(signal["label"], f"{signal['score']:.0%}")
print("Analyzer runs billed:", data["usage"]["analyzer_runs"])
print("Fingerprint:", data["verification"]["fingerprint"])
JavaScript (Node.js) — working REST request
const response = await fetch("https://sentiqra.tech/v1/analyze", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SENTIQRA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "you are a worthless idiot",
language: "en",
analyzers: ["trust-safety"],
}),
});
const data = await response.json();
for (const signal of data.signals) {
console.log(signal.label, `${(signal.score * 100).toFixed(0)}%`);
}
console.log("Analyzer runs billed:", data.usage.analyzer_runs);
console.log("Fingerprint:", data.verification.fingerprint);
These requests use the approved illustrative analyzer input. Inspect meta.analyzers and use your own policy/human review; returned scores are not calibrated probabilities. No example constitutes evidence of production detection accuracy.
Choose your SDK
Python Coming soon
sentiqra
Planned PyPI package
sentiqra - not yet published. Use the REST API today; the quickstart has working examples.
Requirements
Python 3.x+
Built for
- Sync and async Python applications
- Typed detection results
- Automatic retry support
- All 10 production analyzers
Works today - REST example
curl -X POST https://sentiqra.tech/v1/analyze \
-H "Authorization: Bearer $SENTIQRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "you are a worthless idiot",
"language": "en",
"analyzers": [
"trust-safety"
]
}'
Planned SDK usage (preview - package not yet published)
import os
from sentiqra import Sentiqra
client = Sentiqra(
api_key=os.environ["SENTIQRA_API_KEY"]
)
result = client.analyze(
text="you are a worthless idiot",
language="en",
analyzers=["trust-safety"],
)
for signal in result.signals:
print(f"{signal.analyzer}: {signal.label} ({signal.score})")
print(result.verification["configuration"])
Keep API keys server-side and out of source control.
JavaScript Coming soon
@sentiqra/sdk
Planned npm package
@sentiqra/sdk - not yet published. Use the REST API today; the quickstart has working examples.
Requirements
Node.js and supported server runtimes
Built for
- Promise-based applications
- TypeScript definitions
- Node.js and supported server runtimes
- Lightweight integration
Works today - REST example
curl -X POST https://sentiqra.tech/v1/analyze \
-H "Authorization: Bearer $SENTIQRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "you are a worthless idiot",
"language": "en",
"analyzers": [
"trust-safety"
]
}'
Planned SDK usage (preview - package not yet published)
import { Sentiqra } from '@sentiqra/sdk';
const client = new Sentiqra({
apiKey: process.env.SENTIQRA_API_KEY,
});
const result = await client.analyze({
text: 'you are a worthless idiot',
language: 'en',
analyzers: ['trust-safety'],
});
for (const signal of result.signals) {
console.log(`${signal.analyzer}: ${signal.label} (${signal.score})`);
}
console.log(result.verification.configuration);
Keep your API key server-side.
Never embed a Sentiqra secret API key in public client-side JavaScript.
Go Coming soon
github.com/sentiqra/sentiqra-go
Planned Go module
github.com/sentiqra/sentiqra-go - not yet published. Use the REST API today; the quickstart has working examples.
Requirements
Go 1.21+
Built for
- Typed structs
- Minimal dependencies
- Functional options pattern
- All 10 production analyzers
Works today - REST example
curl -X POST https://sentiqra.tech/v1/analyze \
-H "Authorization: Bearer $SENTIQRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "you are a worthless idiot",
"language": "en",
"analyzers": [
"trust-safety"
]
}'
Planned SDK usage (preview - package not yet published)
package main
import (
"fmt"
"os"
"github.com/sentiqra/sentiqra-go"
)
func main() {
client := sentiqra.New(os.Getenv("SENTIQRA_API_KEY"))
result, err := client.Analyze(
"you are a worthless idiot", "en",
[]string{"trust-safety"},
)
if err != nil {
panic(err)
}
for _, signal := range result.Signals {
fmt.Printf("%s: %s (%.2f)\n", signal.Analyzer, signal.Label, signal.Score)
}
fmt.Println(result.Verification.Configuration)
}
Keep API keys server-side and out of source control.
PHP Coming soon
sentiqra/sentiqra-php
Planned Packagist package
sentiqra/sentiqra-php - not yet published. Use the REST API today; the quickstart has working examples.
Requirements
PHP 7.4+ and 8.x
Works today - REST example
curl -X POST https://sentiqra.tech/v1/analyze \
-H "Authorization: Bearer $SENTIQRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "you are a worthless idiot",
"language": "en",
"analyzers": [
"trust-safety"
]
}'
Planned SDK usage (preview - package not yet published)
<?php
require 'vendor/autoload.php';
use Sentiqra\Sentiqra;
$client = new Sentiqra(
getenv('SENTIQRA_API_KEY')
);
$result = $client->analyze(
'you are a worthless idiot', 'en', ['trust-safety']
);
foreach ($result['signals'] as $signal) {
echo $signal['analyzer'] . ': ' . $signal['label'] . ' (' . $signal['score'] . ")\n";
}
echo $result['verification']['configuration'];
Keep API keys server-side and out of source control.
Running a specific analyzer?
All analyzers are available through the same POST /v1/analyze endpoint. The analyzers parameter is required - pass one or two explicit analyzer identifiers to select which run.
Trust & Safety - 210 labels across 16 languages.
curl -X POST https://sentiqra.tech/v1/analyze \
-H "Authorization: Bearer $SENTIQRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "you are a worthless idiot", "language": "en", "analyzers": ["trust-safety"]}'
# signals[] include code/label/score;# insults_derogation: 0.86
# insult: 0.99
# belittling: 0.99
# verification.configuration: sqcfg_HJW2EMH1
Each signal includes analyzer, code, label, score, and level (category or label).
Crisis Intelligence - 192 labels across 21 languages.
curl -X POST https://sentiqra.tech/v1/analyze \
-H "Authorization: Bearer $SENTIQRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "thousands fleeing the conflict zone as violence escalates", "language": "en", "analyzers": ["crisis-intelligence"]}'
# signals[] include code/label/score;# migration_border: 0.88
# verification.configuration: sqcfg_HJW2EMH1
Market Intelligence - 200 labels across 8 languages.
curl -X POST https://sentiqra.tech/v1/analyze \
-H "Authorization: Bearer $SENTIQRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "company raises full-year guidance on stronger than expected earnings", "language": "en", "analyzers": ["finance"]}'
# signals[] include code/label/score;# corporate_guidance_outlook: 0.91
# verification.configuration: sqcfg_HJW2EMH1
Disinformation Analysis - 200 labels across 16 languages.
curl -X POST https://sentiqra.tech/v1/analyze \
-H "Authorization: Bearer $SENTIQRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "according to an unnamed official, documents prove...", "language": "en", "analyzers": ["disinformation"]}'
# signals[] include code/label/score;# source_authority_manipulation: 0.91
# verification.configuration: sqcfg_HJW2EMH1
Predictable results across languages and SDKs
The planned SDKs will wrap the same deterministic API. Every successful analysis response includes structured fields:
AnalyzeResult
├─ language Response language (e.g. "en")
├─ signals[] Array of detected signals
│ ├─ analyzer Analyzer ID (e.g. "trust-safety")
│ ├─ code Stable machine identifier
│ ├─ label Human-readable label
│ ├─ score Signal-match score (0.0–1.0)
│ ├─ level "category" or "label"
│ └─ parent Parent category code (for label-level signals)
├─ meta Execution metadata per analyzer (incl. partial flag)
├─ usage Billing info (analyzer_runs, billed)
├─ verification Immutable receipt
│ ├─ configuration Pinned configuration ID
│ ├─ fingerprint Content hash (fp2_…)
│ └─ signature Ed25519 signature (sig_ed25519_…)
└─ idempotent_replay true when the response is an unbilled deterministic recomputation
The SDK will handle transport. Today the REST API returns the same structured signals directly.
Receipt verification ships separately
Verifying a receipt does not require the analyzer SDK - it is a small standalone operation. Today you can verify with POST https://sentiqra.tech/v1/verify, offline with the public key from GET /v1/verify/public-key, or in the browser with the standalone verifier and its published test vectors.
A dedicated receipt-verification package is planned as its own release - separate from the detection SDKs - before the client libraries ship. It will only be listed here once published under a verified publisher account.
Production-ready client behavior
Authentication
Load secret API keys from environment variables or your preferred secrets manager.
Retries
The API supports Idempotency-Key on every POST, so retries never double-bill. The planned SDKs will add automatic retry with exponential backoff.
Timeouts
Configure request behavior for your production latency requirements.
Errors
Handle authentication, validation, rate-limit, and API errors through the documented error schema - the SDK will expose typed errors.
No SDK for your language?
Sentiqra is a REST API. Use any HTTP client that can send HTTPS requests and parse JSON.
curl -X POST https://sentiqra.tech/v1/analyze \
-H "Authorization: Bearer $SENTIQRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "you are a worthless idiot",
"language": "en",
"analyzers": [
"trust-safety"
]
}'
Ready to build?
Request access for an API key, then make your first request.
5,000 analyzer runs/month free · Access by request