DEVELOPER DOCS / API
Integrate the NullTrace boundary.
A practical guide to authenticate and call the NullTrace endpoints. For documentation or support requests, email minerbagiorgio99@gmail.com.
Authentication
Requests to /v1/* require a tenant API key in the X-NullTrace-Key header. Account management routes under /v1/management/* use an X-NullTrace-Account-Token instead. Get your API key from the dashboard after signup.
POST /v1/anonymize
Send text to /v1/anonymize to detect and mask PII, secrets, and prompt injection before it reaches a model.
curl -s -X POST https://api.nulltrace.dev/v1/anonymize \
-H "Content-Type: application/json" \
-H "X-NullTrace-Key: <API_KEY>" \
-d '{
"text": "Contact mario.rossi@example.com about the invoice.",
"block_on_injection": false
}'
The response includes sanitized_text, entities_found, session_id, and prompt injection signals. Set block_on_injection to true to reject detected injection attempts with HTTP 400.
POST /v1/rehydrate
Restore original values in a sanitized string using the session_id from the anonymize call, or a token map you supply directly.
curl -s -X POST https://api.nulltrace.dev/v1/rehydrate \
-H "Content-Type: application/json" \
-H "X-NullTrace-Key: <API_KEY>" \
-d '{
"sanitized_text": "Contact {{EMAIL_1}} about the invoice.",
"session_id": "<SESSION_ID>"
}'
POST /v1/chat/completions
Call /v1/chat/completions to have NullTrace anonymize your messages, forward them to an OpenAI-compatible upstream provider, and rehydrate the response. X-NullTrace-Key identifies your NullTrace tenant, while Authorization is forwarded to the provider.
curl -s -X POST https://api.nulltrace.dev/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-NullTrace-Key: <API_KEY>" \
-H "Authorization: Bearer <PROVIDER_API_KEY>" \
-d '{
"model": "<MODEL_NAME>",
"messages": [
{ "role": "user", "content": "Draft a follow-up email for mario.rossi@example.com." }
]
}'
GET /v1/account/usage
GET /v1/account/usage reports your plan, quota, and remaining requests without consuming quota.
curl -s https://api.nulltrace.dev/v1/account/usage \
-H "X-NullTrace-Key: <API_KEY>"
Errors
bad_request — invalid request or blocked injection.unauthorized — missing or invalid credentials.forbidden — access to the requested session or object is not allowed.conflict — conflicting persisted state, including incompatible idempotency reuse.rate_limited — request rate exceeded.internal_error or upstream_error — service or provider failure.For support, use the dashboard ticketing flow or email minerbagiorgio99@gmail.com.
Create a free account and make your first protected request.