Skip to main content
The HASP AI API exposes three inference surfaces: the native surface, the Anthropic-compatible surface, and the OpenAI-compatible surface. All three enforce the same compliance checks — BAA validation, credit accounting, PHI scanning — and all three reach the same Anthropic and OpenAI models; they differ only in wire format and who they’re designed for. This page compares the two most common choices: native versus Anthropic-compat. If you already build against the 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/sdk and 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.
The migration from compat to native is a single endpoint change plus adopting the HASP error vocabulary. No compliance or PHI-handling capabilities are lost by starting on compat.

Migrating from compat to native

The response shape differs: native responses include 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 the ai:chat scope.
  • Same model identifiers. The HASP model name (claude-sonnet-4-6) is the same on both.
  • Same request_id. The id field on compat responses and the meta.request_id on native responses resolve to the same record via GET /v1/ai/messages/{id}.