SPB Git forge

spb/doc-api

Public
2commits 1branches 0releases
15.7 MBsize
maindefault branch
14 days agolast push
Python 88.3% TypeScript 7.6% Shell 4.1%
939 B · 11 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2set -eo pipefail3cd "$(dirname "$0")/../../.."4source scripts/lib.sh5MODEL="${MODEL:-claude-haiku-4-5-20251001}"6# web_fetch_20250910 (GA, no beta header) with citations. The URL must already appear in the conversation (user message here).7# STATUS: LIVE_VERIFIED 2026-09-18 (d1: web_fetch_result document text/plain title "Example Domain", web_fetch_requests=1, ~$0.004).8R=$(ant POST /v1/messages -d "$(jq -n --arg m "$MODEL" '{model:$m,max_tokens:200,tools:[{type:"web_fetch_20250910",name:"web_fetch",max_uses:1,citations:{enabled:true},max_content_tokens:2000}],messages:[{role:"user",content:"Fetch https://example.com and tell me the page title in 3 words."}]}')")9log_request anthropic POST /v1/messages "$ANT_STATUS" 0.004 "web-fetch/web_fetch.sh"10echo "$R" | jq -c '.usage.server_tool_use, (.content[]|{type,name,input,result:(.content|objects|{type,url,retrieved_at,title:.content.title,error_code}),text})'11