Create a message
POST/v1/messages
The Anthropic Messages API, for Claude Code and the Anthropic SDKs. Since 1.8.5, in DVARA Open Source and the Enterprise platform. The call runs the same governance as Chat Completions: policy, PII, guardrails, limits, routing, budgets, usage, cost, and audit.
Send the DVARA workspace key as x-api-key (what Claude Code and the
Anthropic SDKs send) or as Authorization: Bearer. A key with scopes
needs completions:write.
On a route to Anthropic, the request goes on as the client sent it:
every field, message role, content block, and the anthropic-beta
header. It is changed only where governance changes it, such as
redacted text or the routed model. Extended thinking passes through.
The reply, plain or streamed, comes back as Anthropic sent it. On a
route to another provider, DVARA translates the request and writes the
reply in Anthropic's shape; extended thinking is refused with
unsupported_capability, naming the provider.
Refused on every route with unsupported_capability: mcp_servers,
container, server tools, and metadata keys other than user_id.
Errors come back in Anthropic's envelope with the same status and
code as on any other DVARA endpoint.
Request
Responses
- 200
- 400
- 401
- 402
- 403
- 413
- 429
- 500
- 502
- 503
Message object, or Anthropic stream events when stream is true
Invalid request, unsupported field or capability, unknown model, a missing or other anthropic-version, or a PII BLOCK action (pii_detected).
A key is required. Missing, invalid, revoked, or expired keys are refused.
A budget or call cap refused the call.
Policy, guardrail, scope, or IP access refused the call.
The request is over a guardrail size limit (input_too_large). The type is request_too_large.
Per-key rate limit reached.
An unexpected error in the gateway. The type is api_error.
The provider failed, or its response was larger than the set limit (provider_response_too_large).
The provider's circuit breaker is open (provider_circuit_open), no capable fallback is left (failover_capability_mismatch), or a workspace credential cannot be read (workspace_credential_unavailable). On the Enterprise platform, a gateway that cannot store audit events refuses every call with audit_store_full and a Retry-After: 30 header until it can. The type is overloaded_error.