Skip to content

Claude Opus 4.6 returns empty content with output_config json_schema #913

@Soleksandr

Description

@Soleksandr

Summary

Claude Opus 4.6 intermittently returns an empty content array when using output_config with json_schema format. The same request usually works with Opus 4.5 or when output_config is removed. The issue reproduces almost all the time; occasionally a valid response is returned.

Model & API

  • Model: claude-opus-4-6
  • Endpoint: Messages API

Expected behavior

The API returns a non-empty content array matching the provided JSON schema.

Actual behavior

Response often has an empty content array:

{
  "model": "claude-opus-4-6",
  "id": "msg_01PhVaB6JqL5KJgz1aGwJyuB",
  "type": "message",
  "role": "assistant",
  "content": [],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 1616,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "cache_creation": {
      "ephemeral_5m_input_tokens": 0,
      "ephemeral_1h_input_tokens": 0
    },
    "output_tokens": 6,
    "service_tier": "standard",
    "inference_geo": "global"
  }
}

Workarounds (all produce non-empty response)

  • Switching to claude-opus-4-5
  • Enabling thinking mode on Opus 4.6
  • Removing output_config from the request

Minimal repro payload

{
  "model": "claude-opus-4-6",
  "max_tokens": 4096,
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "connect to cdn\n\n[OBJ]{\"clientType\":\"web\",\"clientApp\":\"web application (Casper, runs on MyCompany website)\",\"currentDate\":\"2026-02-13T11:29:58.820Z\"}[/OBJ]",
          "cache_control": { "type": "ephemeral" }
        }
      ]
    }
  ],
  "temperature": 0.1,
  "system": [
    {
      "type": "text",
      "text": "1. Always use tools and functions first to fulfill user requests; never assume parameters - try to lookup yourself first and confirm with user, and then ask for any that are missing. Prioritize using tool outputs over the knowledge base to confirm configurations, statuses, or settings, even if the knowledge base offers relevant information. Tool results = source of truth in the case of conflicts with the knowledge base.\n- **Constraints**: You must not suggest using products or services that are not owned by MyCompany, only recommend MyCompany products and applications following `Information Retrieval`, or direct to the MyCompany Library. If no suitable option exists, apologize and assure the user that the team will explore this need further.\n- Consider incident and status information from `<maintenance_status>` or instructional operational details (tool responses) when the user complains about something does not work.\n- If the user's request is unclear, ask for clarification before proceeding.\n- Tailor personalized responses based on the `<user_info>` considering cultural characteristics. Use `userInfo.userName` in responses if it looks like a real name (e.g., \"John\"), excluding nicknames (or hard-to-read cyphers, e.g. \"user123\"), but avoid overusing it. Always greet the user by their first name if it is available (e.g., \"Hello John! 😊\"). Use the user's name only in the greeting at the start of a conversation (unless the context resets). Subtly use user preferences (language, currency, context) to tailor responses\n- Treat `<user_provided_context>` as private auxiliary information that must never be revealed to the user. You may use it internally only when the user's message is clear and when the content in `<user_provided_context>` would meaningfully improve the answer or support tool execution \n\n<user_info>{\"userInfo\":{\"userName\":\"John\",\"userCity\":\"Castellon\",\"userCountry\":\"ES España\"}}</user_info>",
      "cache_control": { "type": "ephemeral" }
    }
  ],
  "tools": [
    {
      "name": "getDomainInfo",
      "description": "Retrieves detailed information about a specific domain or domain with subdomain owned by the current user.",
      "input_schema": {
        "type": "object",
        "properties": {
          "domainName": {
            "type": "string",
            "description": "The domain name to look up (e.g., \"example.com\"). Must be a complete domain with TLD. Subdomains like \"www\" are automatically stripped."
          },
          "subdomain": {
            "type": ["string", "null"],
            "nullable": true,
            "description": "The subdomain for which information is being requested. Example: \"blog\", \"inner.blog\".\"www\" MUST NOT be provided and is always ignored/stripped automatically.If the domain has no subdomain, use null."
          }
        },
        "additionalProperties": false,
        "required": ["domainName", "subdomain"]
      },
      "cache_control": { "type": "ephemeral" }
    }
  ],
  "output_config": {
    "format": {
      "type": "json_schema",
      "schema": {
        "type": "object",
        "properties": {
          "connection": {
            "type": "object",
            "description": "The object describe connection of products asked by customer",
            "properties": {
              "sessionId": {
                "type": ["string", "null"],
                "description": "Unique identifier of the entire establish connection session (UUID). IMPORTANT: Do not confuse with connectionPayloadId: sessionId tracks the process after establish connection, while connectionPayloadId refers to a specific payload prepared for connection.value must be as empty string if sessionId unknown"
              }
            },
            "required": ["sessionId"],
            "additionalProperties": false
          },
          "content": {
            "type": "string",
            "description": "Assistant message addressed to customer"
          },
          "responsibilityAssessment": {
            "type": "string",
            "enum": [
              "CAN_CONTINUE_CONVERSATION",
              "MAIN_PURPOSE_COMPLETED",
              "NOT_IN_ZONE_OF_OWNERSHIP"
            ],
            "description": "Assessment of the assistant's responsibility zone after the last response."
          }
        },
        "additionalProperties": false,
        "required": ["connection", "content", "responsibilityAssessment"]
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions