Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.clearmaas.com/llms.txt

Use this file to discover all available pages before exploring further.

Two paths:
  • response_format: {"type": "json_object"} — model returns valid JSON
  • response_format: {"type": "json_schema", "json_schema": {...}} — model output conforms to your schema

Example (json_schema, OpenAI)

resp = client.chat.completions.create(
    model="openai/gpt-4o-mini",
    messages=[{"role": "user", "content": "Extract name and age."}],
    response_format={
        "type": "json_schema",
        "json_schema": {
            "name": "person",
            "strict": True,
            "schema": {
                "type": "object",
                "properties": {
                    "name": {"type": "string"},
                    "age": {"type": "integer"},
                },
                "required": ["name", "age"],
            },
        },
    },
)

Cross-provider support

response_format is supported wherever the upstream model can honor it. For Gemini, ClearMaas’s translation layer maps it to responseMimeType + responseSchema. For OpenAI / Grok / DeepSeek (all OpenAI-compatible upstreams), the field reaches the upstream in its native shape. Anthropic doesn’t expose a response_format equivalent, so use Anthropic’s tool_use pattern when you need schema-constrained output there.
Providerjson_objectjson_schemaNotes
OpenAIYesYesOpenAI’s native field shape
Grok (xAI)YesYesxAI is OpenAI-compatible
DeepSeekYesPartialCheck DeepSeek’s per-model support
GeminiYesYesTranslated to responseMimeType + responseSchema
AnthropicNoNoUse tool_use pattern instead

See also