Add a video tool to Claude Sonnet 5.5 in the Messages API

Define a generate_video tool with input_schema, run it against Sume's /v1/videos when Claude Sonnet 5.5 returns tool_use, and return the job id as tool_result.

4 min readSume
All posts

To add a video tool to Claude Sonnet 5.5 through the Messages API, declare a client tool with a name, description and input_schema, run it yourself when the response has stop_reason: "tool_use", and reply with a tool_result block carrying the same tool_use_id. For the video call itself, POST to Sume's /v1/videos and return the job id.

Sonnet 5.5 is model id claude-sonnet-5-5, released 2026-09-28 at $2 input and $10 output per million tokens, per Anthropic's page. The tool-use round trip below follows Anthropic's tool-use overview, both read 2026-09-29. Use the hosted MCP route instead if you would rather not run the tool yourself.

What does Anthropic's tool loop require?

Client tools run in your application. Claude answers with a tool_use block, your code executes it, and the next request carries the result back.

From Anthropic's tool-use overview, read 2026-09-29.
StepWhat you send or receive
Definetools: name, description, input_schema
Claude asksstop_reason tool_use; block with id, name, input
You run itYour code calls the real API
Replyuser turn with a tool_result block and the same tool_use_id

What is the tool definition?

Keep the schema small. Sume's /v1/videos follows the OpenRouter video shape: model and prompt are required, and duration, resolution and aspect_ratio are optional. sume/auto lets Sume pick the model.

{
  "name": "generate_video",
  "description": "Start a short video job and return its job id.",
  "input_schema": {
    "type": "object",
    "properties": {
      "prompt": { "type": "string" },
      "duration": { "type": "integer" }
    },
    "required": ["prompt"]
  }
}

What does my code run when Claude calls it?

Forward the arguments to Sume with your API key, and hand the id back as the tool result. The create call returns at once with a polling_url; video is asynchronous.

curl -X POST https://api.sume.com/v1/videos \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: tool-call-001" \
  -d '{"model": "sume/auto", "prompt": "A paper boat in a rain gutter", "duration": 5}'

How does Claude learn the video is done?

Add a second tool that does GET /v1/videos/<job_id> and returns the status and, once completed, the download URL from unsigned_urls[0]. Or pass callback_url on the create call and let a signed webhook tell your server, then continue the conversation with the result.

Reuse the tool_use_id for the result you send back and keep the assistant content block intact in the next request, as Anthropic's example does. Do not create a second job for a call you already answered; the idempotency header makes a repeated submit return the original.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume