Solution · Patient messaging

Draft and triage portal messages, safely.

Classify, route and draft replies to patient messages with a chat model that takes PHI under contract and stays in your region.

The problem

Why this is hard

Patient portal volume keeps climbing, and every message is protected health information. Teams want AI to triage urgency and draft replies, but a generic chat API means PHI leaving your jurisdiction to a provider with no BAA. phi-cloud gives you a chat endpoint that takes PHI on verified, resident providers — so the assist is real and the posture survives a questionnaire.

How it works

The pipeline, end to end

  1. 1

    Triage the message

    POST /v1/chat/completions

    Classify urgency, topic and routing with a resident chat model under X-PHI:true. Use JSON mode for a structured verdict your queue can act on.

  2. 2

    Pull relevant context

    POST /v1/embeddings

    Embed the message and retrieve prior thread context or care-pathway snippets from your own vector store — all in the same resident 4096-d space.

  3. 3

    Draft a reply

    POST /v1/chat/completions

    Generate a grounded draft for a human to review and send. Tool calling can enforce safe templates and required disclaimers.

  4. 4

    Human in the loop

    Your app

    phi-cloud returns the draft and the audit headers; your workflow keeps a clinician in control of what actually goes to the patient.

Why phi-cloud

What makes it compliant

PHI under contract

Messages route only to PHI-eligible providers in CH/EU; nothing touches an unverified model.

Region-pinned

Pin the jurisdiction per request; failover stays in-region.

Structured output

JSON mode and tools give you triage verdicts and safe reply templates, not free-form text.

Zero retention

No message is stored or trained on by the gateway or the provider.

In code

A representative call

Triage a message into a structured verdict your queue can route on — in the EU, under the PHI gate.

curl
curl https://phi-cloud.com/api/v1/chat/completions \
  -H "Authorization: Bearer $PHI_API_KEY" \
  -H "X-Region: EU" -H "X-PHI: true" \
  -d '{
    "model": "gemma-4",
    "response_format": {"type": "json_object"},
    "messages": [
      {"role":"system","content":"Return {urgency, topic, route}."},
      {"role":"user","content":"Patient message: ..."}
    ]
  }'
response
x-phi-routed: scaleway-gemma-4-26b/EU/phi
x-phi-tier: phi

Compliance posture

  • EU messaging → Scaleway (GDPR Art. 28 DPA, zero-retention, no-train).
  • CH messaging → Infomaniak (Swiss-resident, nFADP/GDPR).
  • PHI is gated per call; an unverified region returns phi_blocked rather than routing out.
  • phi-cloud never sees your patients — it forwards the request and stores nothing.

FAQ

Common questions

Only if you build it that way. phi-cloud returns a draft and a structured triage verdict; keeping a human in the loop is a design choice your application owns. The gateway just supplies the model output and the audit trail.
Set X-PHI:true. The gateway restricts routing to PHI-eligible providers for the region and refuses (phi_blocked) if none exists — it will never silently fail over to a general-only model.

Ready when you are

Build patient messaging on a gateway that survives the audit.

Free to test. Prepaid credits when you go live. The residency and PHI posture is the same in production.

Free to test · Prepaid credits, no subscription · No data retained