---
title: "Structured output: provider enforcement"
description: "Maps which provider types enforce response schemas, which keywords are stripped, and strict mode conditions for Duale AI structured output."
lang: en
status: public-preview
lastUpdated: 2026-10-21
url: https://duale.ai/en/docs/model-routing/structured-output
---

## AI-generated summary

This reference covers provider enforcement of structured output, removed schema keywords, strict mode rules, and tool parameter schema handling.

- Provider type enforcement of structured output declarations.
- Schema keywords removed before sending to providers.
- Restating removed limits in field descriptions.
- Strict mode structural rules for supported providers.
- Tool parameter schema keyword removal by provider type.

Summaries were generated by AI.

---

Whether a provider enforces your response schema depends on the provider type of the route and on its declared
features. Duale AI validates every answer against your schema either way. Use this reference to check enforcement for
each provider type and to shape a schema that keeps strict enforcement on.

## Check what each provider type enforces

Before you rely on a typed result, check whether the provider type of each route in the pool enforces the response
schema. Provider enforcement can improve the reliability of the first answer. Duale AI validates the final result on
every route.

| Provider type                      | Can enforce when `structured_output` is declared                                    |
| ---------------------------------- | ----------------------------------------------------------------------------------- |
| Anthropic                          | Yes                                                                                 |
| OpenAI Responses                   | Yes                                                                                 |
| Microsoft Foundry Responses        | Yes                                                                                 |
| Microsoft Foundry Chat Completions | Only when you also turn on **Strict Structured Responses**                          |
| Together AI                        | Yes                                                                                 |
| Mistral                            | Yes                                                                                 |
| Groq                               | Yes                                                                                 |
| Cerebras                           | Yes                                                                                 |
| xAI                                | Yes                                                                                 |
| OpenAI-compatible Chat Completions | Only when you also turn on **Strict Structured Responses**                          |
| Z.ai                               | No. Your schema is in the instructions; the provider receives a JSON-object request |
| DashScope Qwen                     | Yes, when the selected endpoint and region support JSON Schema output               |
| AWS Bedrock                        | No. Your schema reaches the model as an instruction only                            |
| Vertex AI                          | No. Your schema reaches the model as an instruction only                            |

Do not declare `structured_output` on a Z.ai, AWS Bedrock, or Vertex AI route. These provider types cannot enforce a
response schema. Duale AI adds the schema as a prompt instruction regardless of that declaration; leaving the feature
off keeps the route's claim accurate.

On a DashScope Qwen route, Duale AI sends your schema with strict enforcement when you declare `structured_output`. Confirm that the
selected endpoint and region support it before you enable the route, and check the features that a preset declares.
Without `structured_output`, DashScope receives a JSON-object request and the schema remains a prompt instruction. A
JSON response request also uses JSON-object mode; neither fallback depends on the `json_mode` declaration.

## Keywords that do not reach the provider as constraints

On routes that send a native response schema, except DashScope Qwen routes, Duale AI removes these keywords before it
sends the schema:

- numeric bounds and `multipleOf`;
- string length, `pattern`, and `format`;
- item counts and uniqueness;
- object property counts, `patternProperties`, and `propertyNames`;
- `default` and `discriminator`.

Duale AI still applies these rules when it validates the answer and builds the application result. An answer that
violates one fails validation and spends a provider request; it never becomes accepted output.

## Restate limits in field descriptions

On routes that remove these keywords, restate each limit in the field description. The description reaches the model
as an instruction to follow. It does not enforce the limit, so your application still validates the result.
[Integrate model routing in an application](https://duale.ai/en/docs/model-routing/application-integration.md#set-a-contextual-policy)
shows a field description that carries a length limit.

## Keep strict mode on

On OpenAI Responses, both Microsoft Foundry APIs, OpenAI-compatible Chat Completions, Together AI, Mistral, Groq, and
Cerebras routes, Duale AI turns strict mode on only when the schema meets two structural rules:

- **Name every property in the object's required list.** One missing property turns strict mode off for the whole request.
- **Give every object named properties.** A free-form or key-value map turns strict mode off for the whole request.

If one object fails either rule, Duale AI sends the schema without strict mode. It does not raise a configuration
error. Both models below illustrate that check and omit their imports, which are the Pydantic ones shown in
[Integrate model routing in an application](https://duale.ai/en/docs/model-routing/application-integration.md):

```python
# Strict mode is off for the entire request: `metadata` has no named properties.
class ReviewResult(BaseModel):
    decision: Literal["manual_review", "reject"]
    metadata: dict[str, str]

# Strict mode stays on: every object names its properties, and every property is required.
class ReviewMetadata(BaseModel):
    model_config = ConfigDict(extra="forbid")

    reviewer_queue: str
    source_system: str

class ReviewResult(BaseModel):
    model_config = ConfigDict(extra="forbid")

    decision: Literal["manual_review", "reject"]
    metadata: ReviewMetadata
```

## Anthropic and DashScope Qwen routes

On an Anthropic route, Duale AI sends the schema without the removed keywords and without a separate strict-mode
switch. The provider enforces that schema. The two structural rules above do not apply, but the description rule still
carries each removed limit to the model.

On a DashScope Qwen route with `structured_output`, Duale AI sends the response schema unchanged with strict
enforcement. It removes no keyword and applies no structural check. Use schema features that the configured endpoint
supports; an unsupported schema can fail at the provider.

## Tool parameter schemas

Duale AI removes the same keywords from the parameter schema of a Tool on Together AI and DashScope Qwen routes. It also
removes them on OpenAI-compatible Chat Completions and Microsoft Foundry Chat Completions routes when **Strict
Structured Responses** is on. Other provider types send the parameter schema unchanged.

[Route settings](https://duale.ai/en/docs/model-routing/provider-capabilities.md#declare-each-feature-on-the-route) explains how to
declare `structured_output` and `json_mode` on a route.

## Related content

- [Provider capabilities on a Model Route](https://duale.ai/en/docs/model-routing/provider-capabilities.md)
- [Scope and limits: purpose, excluded uses, and behavior](https://duale.ai/en/docs/scope-and-limits.md)
- [Prompt injection: sources and the three-property gate](https://duale.ai/en/docs/security/threat-model.md)
- [Model routing under your provider contracts](https://duale.ai/en/product/model-routing.md)
- [Model routing contract and limits](https://duale.ai/en/docs/model-routing/contract-and-limits.md)
- [Subprocessor list and transfer safeguards](https://duale.ai/en/legal/subprocessors.md)

---

## Sitemap

See the full [Markdown sitemap](https://duale.ai/sitemap.md) for all pages.
