Skip to content

Instantly share code, notes, and snippets.

View TurtleShip's full-sized avatar

Seulgi Kim TurtleShip

View GitHub Profile
@TurtleShip
TurtleShip / code_exec_tool_with_token_count.py
Last active August 11, 2025 05:25
Testing code_execution_20250522 with token counting
#!/usr/bin/env python3
"""
Test script to verify if token counting works with code_execution_20250522 tool.
This answers Brad's question: "Does token counting not work with code_execution_20250522?"
According to the docs:
- Token counting: https://docs.anthropic.com/en/docs/build-with-claude/token-counting
- Code execution tool: https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/code-execution-tool
"""
{
"type": "object",
"properties": {
"command": {
"type": "string",
"description": "The command to execute"
},
"timeout": {
"type": "number",
"description": "Optional timeout in milliseconds (max 600000)"
@TurtleShip
TurtleShip / openapi_stainless.json
Last active August 28, 2025 05:55
OpenAPI spec that includes Threads API changes
{
"openapi": "3.1.0",
"info": {
"title": "Anthropic API",
"version": "138"
},
"paths": {
"/v1/messages": {
"post": {
"summary": "Create a Message",