GDPR prompt AI

API reference

The same masking as the chat, for your own code. The API speaks the OpenAI format, so existing code and SDKs work by changing the address and the key. Personal data is replaced with placeholders before it reaches a model and put back in the answer.

Base address https://api.gdprprompt.ai/v1

Quickstart

  1. A company admin creates a key in the console, under Keys. Keys start with eucc_sk_; keep them on your servers.
  2. Point the OpenAI SDK, or any HTTP client, at the base address above.
  3. Send the text as it is. The answer comes back with the real names and numbers in it.
curl https://api.gdprprompt.ai/v1/chat/completions \
  -H "Authorization: Bearer $EUCC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [
      {"role": "user", "content": "Draft a reply to Ana Novak about invoice 2024-117."}
    ]
  }'

Authentication

Send the key in the Authorization header: Bearer eucc_sk_…. A key belongs to a company, not to a person; admins can give each key a monthly token cap and revoke it at any time in the console. Calls with a revoked key fail at once with 401.

Models

Set model to auto. The gateway chooses the model for each request; the masking, and everything this page describes, is the same whichever answers.

curl
curl https://api.gdprprompt.ai/v1/models \
  -H "Authorization: Bearer $EUCC_API_KEY"
Response
{
  "object": "list",
  "data": [
    { "id": "auto", "object": "model" }
  ]
}

Chat completions

POST /chat/completions takes the OpenAI request body: model, messages and the usual options. Every message is masked, the model answers with placeholders, and the gateway restores them before the answer reaches you. If the masking cannot run, nothing is sent and you get 503.

Sessions

Each response carries an X-Session-Id header. Send it back with the next call of the same conversation, so a person keeps the same placeholder across turns and the answer can refer back to them. The link between placeholders and real values is kept encrypted for one hour; without the header, each call starts a new session.

# The first call returns a session id in the X-Session-Id header (-i shows it)
curl -i https://api.gdprprompt.ai/v1/chat/completions \
  -H "Authorization: Bearer $EUCC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "auto", "messages": [
        {"role": "user", "content": "Summarise the call with Ana Novak."}]}'

# Send it back with the next call: Ana Novak stays [PERSON_1] for the model
curl https://api.gdprprompt.ai/v1/chat/completions \
  -H "Authorization: Bearer $EUCC_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Session-Id: $SESSION_ID" \
  -d '{"model": "auto", "messages": [...]}'

Streaming

Set "stream": true to receive the answer as server-sent events in the OpenAI format. Placeholders are restored as the text arrives.

stream = client.chat.completions.create(
    model="auto", messages=messages, stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Preview the masking

POST /pseudonymize shows what would leave the gateway, without calling a model: the masked text and a count per category. The real values are never returned and nothing is stored. Placeholders and categories use the names a model receives: PERSON, ADDRESS, PLACE, ORGANISATION,COMPANY, NATIONAL_ID, TAX_ID, BANK_ACCOUNT, PHONE,EMAIL, BIRTH_DATE, DEATH_DATE, ID_NUMBER, DESCRIPTION.

curl
curl https://api.gdprprompt.ai/v1/pseudonymize \
  -H "Authorization: Bearer $EUCC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Remind Ana Novak, tax number 41270517, of invoice 2024-117."}'
Response
{
  "text": "Remind [PERSON_1], tax number [TAX_ID_1], of invoice 2024-117.",
  "detected": { "PERSON": 1, "TAX_ID": 1 }
}

Documents

POST /documents extracts the text of a file, with text recognition for scans, without the file leaving the gateway. Send the text in a chat message to have it masked and answered. Supported: PDF, DOCX, XLSX, PPTX, ODT, EML, MSG, TXT, CSV, PNG, JPG and TIFF, up to 25 MB.

curl https://api.gdprprompt.ai/v1/documents \
  -H "Authorization: Bearer $EUCC_API_KEY" \
  -F "file=@contract.pdf"
Response
{
  "text": "LEASE AGREEMENT\nconcluded between ...",
  "pages": 3,
  "ocr_pages": 1,
  "kind": "pdf"
}

Files

When an answer includes a file made for you, such as an edited Word document, it links tohttps://api.gdprprompt.ai/files/<token>. Download it with the same key. The file holds the real values, so it is handed only to the key that asked for it; anyone else gets 404.

Errors

Errors come back in the OpenAI shape, {"error": {"message", "type", "code"}}, with these status codes:

StatusMeaning
400The request is wrong: no messages, a content type the gateway cannot read, or a model your plan does not include. Use model auto.
401No key, or the key is invalid or revoked.
402The company's plan needs payment or its tokens are used up.
403The company is suspended, or the key does not belong to a company.
404A file token that does not exist, has expired or belongs to someone else.
415A document type the gateway does not read, a file over 25 MB, or too many pages.
429A limit is reached: the key's monthly cap or the company's limit for this member.
502The model provider did not answer. Retry, or pick another model.
503The masking could not run, so nothing was sent anywhere. Retry in a moment.

Limits and usage

Usage counts against the company's plan in tokens, with the key's own monthly cap if an admin set one. The console shows usage per key and per member. A call over a limit returns 429; a plan that needs payment returns 402.

What happens to the data

Detection runs on our servers and on Amazon Bedrock in Frankfurt, without retention. The model provider sees only text with placeholders, under terms without retention or training. The placeholder vault is encrypted per company. For who processes what, see who sees what.