Skip to content

Anthropic

SideSeat automatically extracts model information, token usage, and costs from Anthropic Claude API calls.

  • SideSeat running locally (sideseat)
  • SDK installed (pip install sideseat / uv add sideseat or npm install @sideseat/sdk)
  • Anthropic API credentials configured
from sideseat import SideSeat
SideSeat()
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}]
)
print(message.content[0].text)
AttributeSource
gen_ai.systemanthropic
gen_ai.request.modelRequest model parameter
gen_ai.response.modelResponse model field
gen_ai.usage.input_tokensusage.input_tokens
gen_ai.usage.output_tokensusage.output_tokens
gen_ai.request.max_tokensMax tokens parameter

Streaming responses are captured:

with client.messages.stream(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{"role": "user", "content": "Tell me a story"}]
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)

Claude tool use is fully traced:

tools = [{
"name": "get_weather",
"description": "Get weather for a location",
"input_schema": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"}
},
"required": ["location"]
}
}]
message = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
tools=tools,
messages=[{"role": "user", "content": "What's the weather in Paris?"}]
)

SideSeat captures:

  • Tool definitions
  • Tool use requests
  • Tool results

Image inputs are captured:

import base64
with open("image.png", "rb") as f:
image_data = base64.b64encode(f.read()).decode()
message = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What's in this image?"},
{"type": "image", "source": {
"type": "base64",
"media_type": "image/png",
"data": image_data
}}
]
}]
)

Claude’s extended thinking feature is captured:

message = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=16000,
thinking={
"type": "enabled",
"budget_tokens": 10000
},
messages=[{"role": "user", "content": "Solve this complex problem..."}]
)

Thinking blocks appear in the message thread.