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.

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.
| Step | What you send or receive |
|---|---|
| Define | tools: name, description, input_schema |
| Claude asks | stop_reason tool_use; block with id, name, input |
| You run it | Your code calls the real API |
| Reply | user 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
- C# HttpClient default timeout: 100 seconds, and how to set it
HttpClient.Timeout defaults to 100 seconds per request and throws TaskCanceledException. How to set it, and why slow API jobs need polling instead.
- How to delete my data from an AI tool, and what stays
Delete your data from an AI tool in two steps: delete the account, then send a deletion request for stored files. How it works on Sume, and its limits.
- Do AI companies sell your data? What to read in the policy
Some may; the privacy policy is where to check. How to read its sale and sharing sections, and what Sume's policy says it collects and shares.
- Do API keys expire? Sume keys last until revoked
Some API keys expire and many last until revoked. Sume keys have no expiry date in current code, so rotation is on you. How and when to rotate.
Written by Sume