Skip to content

MaaS_Cl_Opus_5.5

Claude Opus 5.5

Define tools in a message (beta)

With the inline-tools-2026-09-15 beta header, a tool_addition block in a mid-conversation system message can carry a full tool definition instead of a reference, so you can add a tool, change its schema, or move a server tool to a newer version mid-conversation without editing tools and without losing the prompt cache. This works on every model that supports mid-conversation tool changes, including Claude Opus 5.5.

For example, to define a custom tool mid-conversation:

curl --location --request POST 'https://genaiapi.cloudsway.net/{ENDPOINT}/v1/messages' \
--header 'Authorization: Bearer {Your AK}' \
--header 'Content-Type: application/json' \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: inline-tools-2026-09-15" \
  -d '{
    "model": "claude-opus-5-5",
    "max_tokens": 1024,
    "tools": [
      {
        "name": "get_weather",
        "description": "Get the current weather for a location.",
        "input_schema": {
          "type": "object",
          "properties": {
            "location": {"type": "string", "description": "City name"}
          },
          "required": ["location"]
        }
      }
    ],
    "messages": [
      {
        "role": "user",
        "content": "How many orders shipped yesterday?"
      },
      {
        "role": "system",
        "content": [
          {
            "type": "tool_addition",
            "tool": {
              "type": "tool_definition",
              "definition": {
                "name": "db_query",
                "description": "Run a read-only SQL query against the analytics database.",
                "input_schema": {
                  "type": "object",
                  "properties": {"sql": {"type": "string"}},
                  "required": ["sql"]
                }
              }
            }
          }
        ]
      }
    ]
  }'

Compact on demand (beta)

With the compact-2026-09-04 beta header, a request that sends the top-level compaction parameter returns a signed compaction block summarizing the whole conversation, which you then send first in place of the summarized messages. It is available on the models that support compaction, Claude Opus 5.5 included. You choose when to compact, the request can run in the background, and the thinking blocks in the turns you keep can stay valid after the swap (under the conditions in Compaction and preserved thinking), which matters on Claude Opus 5.5 because its thinking blocks are tied to the conversation.

# max_tokens caps the whole call, including any thinking, so allow several thousand tokens.
curl --location --request POST 'https://genaiapi.cloudsway.net/{ENDPOINT}/v1/messages' \
--header 'Authorization: Bearer {Your AK}' \
--header 'Content-Type: application/json' \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: compact-2026-09-04" \
  -d '{
    "model": "claude-opus-5-5",
    "max_tokens": 4096,
    "messages": [
      {"role": "user", "content": "I am building a recipe app. Help me name the main entities in the data model."},
      {"role": "assistant", "content": "Start with Recipe, Ingredient, and Step. Add a RecipeIngredient entry that holds the quantity and unit for each ingredient in a recipe."},
      {"role": "user", "content": "Good. Now suggest field names for Recipe."}
    ],
    "compaction": {"type": "summarize"}
  }'

Response:

{
  "id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
  "type": "message",
  "role": "assistant",
  "model": "claude-opus-5-5",
  "content": [
    {
      "type": "compaction",
      "content": "Summary of the conversation: the user is designing the data model for a recipe app. The entities agreed so far are Recipe, Ingredient, Step, and RecipeIngredient, which holds the quantity and unit. The user then asked for field names for Recipe.",
      "signature": "EuYBCkQY..."
    }
  ],
  "stop_reason": "compaction",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "iterations": [{ "type": "compaction", "input_tokens": 144, "output_tokens": 276 }]
  }
}