Create a legacy text completion
POST/v1/completions
Accept one string prompt and return one OpenAI-compatible legacy text
completion. DVARA wraps the prompt as a user message, then runs the
same configured policy, PII, guardrail, budget, admission, routing,
cache, response-control, audit, usage, and cost path as a synchronous
/v1/chat/completions call.
This endpoint deliberately supports only the legacy shape that maps
without changing its meaning. prompt must be one string; prompt
arrays and token arrays are refused. stream must be absent or
false, and n and best_of must be absent or 1. Unsupported forms
return HTTP 400 with unsupported_capability before provider
dispatch. user is accepted for client compatibility but ignored;
DVARA attributes governance and usage from the workspace API key.
Request
Responses
- 200
- 400
- 401
- 402
- 403
- 413
- 422
- 429
- 500
- 502
- 503
One legacy text completion
A required field is missing, no provider can serve the model, or the request uses an unsupported legacy shape.
No key was sent (api_key_required), or the key is unknown (invalid_api_key), revoked (api_key_revoked) or expired (api_key_expired).
A hard budget cap is exhausted (budget_cap_hard), the call would cost more than the per-call ceiling (per_call_cost_exceeded), or, without a licence, the monthly call band is used up (license_token_cap_exceeded, type token_cap_exceeded).
The key's nonempty scope list does not cover the operation (api_key_scope; chat, Responses, completions and the Cursor route need completions:write, embeddings need embeddings:write); a policy rule (policy_denied), guardrail (guardrail_blocked, hallucination_detected, grounding_unavailable), IP rule (IP_ACCESS_DENIED, in upper case, Enterprise platform) or data-residency rule (data_residency_violation) refused the call; PII tokenization or redaction was needed but unavailable (pii_tokenize_unavailable, pii_redact_unavailable); or the workspace is suspended (workspace_suspended) or must use its own provider credential (workspace_credential_required). A PII BLOCK is 400 pii_detected instead.
The input is over a configured guardrail size limit (input_too_large), such as messages per request, message length or input tokens.
The model's answer did not match the configured output schema (schema_validation_failed).
The key's rate limit is reached (rate_limit_exceeded, with a Retry-After header), priority admission control throttled the request (priority_throttled), or the provider is rate limiting the call (provider_rate_limited, with Retry-After when the provider gave one).
Response Headers
Seconds to wait before retrying, when known.
A configured guardrail plugin failed (guardrail_plugin_error), the key has no id in the gateway's configuration (api_key_misconfigured), or an unexpected error happened in the gateway (internal_error, type gateway_error).
Every configured provider on the route (and every fallback) has failed.
The provider's circuit breaker is open (provider_circuit_open), no fallback provider can serve what the request needs (failover_capability_mismatch), or the workspace's own provider 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 (type service_unavailable) and a Retry-After: 30 header until it can.