Quickstart

Get your first API call working in 5 minutes.

1

Get your API key

Sign up at ambientmeta.com and copy your API key from the dashboard.

2

Install the SDK

pip install ambientmeta
3

Sanitize some text

from ambientmeta import AmbientMeta

client = AmbientMeta(api_key="am_live_your_key_here")

# Sanitize text before sending to an LLM
result = client.sanitize("Email John Smith at john@acme.com about the project")

print(result.sanitized)
# "Email [PERSON_1] at [EMAIL_1] about the project"

print(result.session_id)
# "ses_abc123..."
4

Call your LLM (with safe text)

import openai

response = openai.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": result.sanitized}]
)

llm_response = response.choices[0].message.content
5

Rehydrate the response

final = client.rehydrate(llm_response, result.session_id)

print(final.text)
# Original names and emails restored

That's it! Your LLM never saw the real PII. The original data stayed in your control the entire time.

Using curl

Sanitize

curl -X POST https://api.ambientmeta.com/v1/sanitize \
  -H "Authorization: Bearer am_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"text": "Email John Smith at john@acme.com about the merger"}'

Response:

{
  "sanitized": "Email [PERSON_1] at [EMAIL_1] about the merger",
  "session_id": "ses_a1b2c3d4e5f6",
  "entities_found": 2,
  "processing_ms": 12
}

Rehydrate

curl -X POST https://api.ambientmeta.com/v1/rehydrate \
  -H "Authorization: Bearer am_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"text": "I will contact [PERSON_1] at [EMAIL_1] tomorrow.", "session_id": "ses_a1b2c3d4e5f6"}'

Next Steps