openai SDK, see the OpenAI-compat reference instead.
Surface comparison
When to use native (/v1/ai/chat)
Use the native surface when you:
- Are building a new integration and want full HASP capabilities from the start.
- Need PHI metadata in responses (entity types detected, redaction count).
- Want the HASP error vocabulary (
PHI_BLOCKED,BAA_REQUIRED, etc.) rather than the Anthropic mapping. - Are building tooling against the audit trail and want the richest response envelope.
When to use Anthropic-compat (/v1/messages)
Use the compat surface when you:
- Already have code using
@anthropic-ai/sdkand want HASP compliance with zero code changes. - Are evaluating HASP as a drop-in replacement for direct Anthropic calls.
- Are building a prototype and want to defer the native migration.
Migrating from compat to native
meta.request_id at top level and meta.phi if redaction was applied. Anthropic-compat responses follow the standard Anthropic shape with id as the request identifier.
What’s the same on both surfaces
- All compliance checks run. PHI scanning, BAA validation, credit checks, and audit logging are identical on both surfaces. You cannot bypass compliance by using the compat endpoint.
- Same API keys. The same
hasp_api_live_*key works on both surfaces with theai:chatscope. - Same model identifiers. The HASP model name (
claude-sonnet-4-6) is the same on both. - Same request_id. The
idfield on compat responses and themeta.request_idon native responses resolve to the same record viaGET /v1/ai/messages/{id}.