Skip to main content

Runtime request families

Select the gateway route that matches your client and the task: text, vectors, audio, or moderation. A request family is one of these API formats.

The route also controls which policy stages run. Chat Completions, Responses, and Messages run the input and output stages. Embeddings, audio, moderation, and legacy completions run only the input stage.

Base URL and authentication​

Send each request to the central agent URL of the agent. For a direct local test, use http://127.0.0.1:41002. Put the API token in the Authorization: Bearer header. Do not use the gateway token as the client credential. For the base URL of the control-plane API, see the Verdictan API overview.

Request families​

FamilyRouteUse it forResponse
Chat CompletionsPOST /v1/chat/completionsOpenAI-style chat clientsJSON or SSE
ResponsesPOST /v1/responsesResponses-style text clientsJSON or SSE
MessagesPOST /v1/messagesAnthropic-style message envelopes and content blocksJSON or SSE
EmbeddingsPOST /v1/embeddingsVector generationJSON
Audio transcriptionPOST /v1/audio/transcriptionsSpeech to textJSON
Audio speechPOST /v1/audio/speechText to speechBinary audio
ModerationPOST /v1/moderationsContent moderation through the configured backendJSON
Legacy completionsPOST /v1/completionsLegacy text-completion clientsJSON

Other gateway surfaces​

The request family registry does not contain these surfaces. Each one keeps its own authentication, publication, routing, and governance boundary.

SurfaceRouteOwning page
Model discoveryGET /v1/models and GET /v1/models/:model_idRuntime configuration
WebSocket proxyGET /v1/chat/completions/ws and GET /v1/responses/wsWebSocket gateway
Published-host MCPGET /mcp and POST /mcpConnect an MCP client

The WebSocket routes apply request and response policy to complete text frames. They reject binary frames and malformed JSON-like text.

Policy stages by family​

The stage identifiers below are the stages that the registry declares for each family. Different routes do not necessarily run the same controls.

The gateway evaluates the active policy chain on each family before it sends the request to the provider. On the embeddings, audio, moderation, and legacy completions routes, the gateway applies these rules:

  • The input stage examines the request text. This text is input for embeddings, audio speech, and moderation. It is prompt for legacy completions and audio transcription.
  • The gateway does not examine the audio file of a transcription request.
  • Output stage controls do not apply, because these routes do not return governed text. The gateway skips them.
  • A chain entry that sets stage: post-request stops the request with HTTP 400 and the code policy.incompatible_active_chain.
  • A block or escalate verdict stops the request with HTTP 400. These routes cannot hold a request for review.
  • A redact verdict masks the request text before the gateway sends the request.
  • Each evaluated request records a decision event. The event details contain route and request_family.
FamilySupported stagesLimit
Chat Completionspre_request, post_request, pre_responseFull input and output policy path
Responsespre_request, post_request, pre_responseFull input and output policy path
Messagespre_request, post_request, pre_responseSame stage identifiers with an Anthropic-shaped body. Policy parity with Chat Completions and Responses is not a commitment.
Embeddingspre_requestInput stage on input. Output controls are skipped.
Audio transcriptionpre_requestInput stage on prompt. The audio file is not examined.
Audio speechpre_requestInput stage on input. Output controls are skipped.
Moderationpre_requestInput stage on input. Output controls are skipped.
Legacy completionspre_requestInput stage on prompt. No parity with Chat Completions

Select a text family​

  • If the client uses the OpenAI chat-completions shape, use /v1/chat/completions.
  • If the client uses the Responses API, use /v1/responses.
  • If the client must use the Anthropic Messages shape, use /v1/messages.

The three text families share the same stage identifiers. Route shape, streaming translation, structured-output support, and provider support are different. Run tests for the selected family with the active policy chain.

Examples​

Structured outputs​

Use a model that supports JSON schema output. This complete Chat Completions body specifies an order number:

{
  "model": "gpt-4o-mini",
  "messages": [
    {"role": "user", "content": "Return the order number from: Order 1042 is ready."}
  ],
  "response_format": {
    "type": "json_schema",
    "json_schema": {
      "name": "order_summary",
      "strict": true,
      "schema": {
        "type": "object",
        "properties": {"order_number": {"type": "integer"}},
        "required": ["order_number"],
        "additionalProperties": false
      }
    }
  }
}

Save it as request.json. Use the base URL and API token from the quickstart:

curl --fail-with-body "$VERDICTAN_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $VERDICTAN_CLIENT_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

The base URL ends in /v1. Replace the model with an allowed model that supports the schema. On success, parse choices[0].message.content as JSON. Make sure that order_number is 1042.

The Messages route does not accept the OpenAI response_format field. Read Format translation before you use structured outputs through a different provider.

Request-time cache and session hints​

Chat Completions and Responses accept these request-time hints when the runtime cache settings allow them. Do not infer equivalent handling on Messages from the shared field names.

FieldLocationEffect
cache_controlRequest bodyRequests prompt-caching behavior when the runtime policy allows it
session_idRequest bodyGroups related requests onto the same session lane
x-session-idRequest headerHeader form of the same session identifier

If a request contains session_id and x-session-id, the two values must match. The gateway rejects a mismatch with the reason code session_id_mismatch.

Limits and failure behavior​

  • The registry matches the exact method and path. A prefix such as /v1/chat/completions/ws is not a Chat Completions request.
  • The embeddings, audio, moderation, and legacy completions routes run only the input stage. An output control in the chain has no effect on these requests.
  • The provider must support structured output. Run a test of the selected model with the schema before production use.
  • Runtime settings such as the default provider, moderation backend, model list, privacy, and response caches are not request-time selections. Configure them in the policy config. See Runtime configuration.

Next steps​