Hi,
I’m having issues with Lens Loop’s Anthropic integration on Windows. I have two problems:
Problem 1: Wrong URL in Documentation The documentation states to use http://localhost:31300/anthropic/v1 for Anthropic, but this returns a 404 error. The URL actually works without the /v1 suffix: http://localhost:31300/anthropic
Problem 2: No Traces Captured When I use the working URL (without /v1), the API calls work and I get responses from Claude, but no traces appear in Lens Loop.
Environment:
- Windows
- Lens Loop (latest)
- Anthropic API
Test Script: I tested with this Python script to verify the behavior:
python
from anthropic import Anthropic
from dotenv import load_dotenv
import os
load_dotenv()
question = "?"
# Try multiple urls
base_url = os.getenv("ANTHROPIC_BASE_URL")
urls = [
base_url,
f"{base_url}/v1",
f"{base_url}/v2",
]
for url in urls:
print(f"Trying {url}")
try:
# Initialize the Anthropic client
client = Anthropic(
api_key=os.getenv("ANTHROPIC_API_KEY"),
base_url=url,
default_headers={
"X-Loop-Project": os.getenv("ANTHROPIC_LOOP_PROJECT"),
}
)
# Send the message to Claude and get the response
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[
{"role": "user", "content": question}
]
)
print("\nClaude's response:")
print(message.content[0].text)
except Exception as e:
print(f"Error: {e}")
print("-------------------")
Output:
Trying http://localhost:31300/anthropic
Claude's response:
Hello! How can I help you today? Feel free to ask me any questions or let me know what you'd like to discuss.
-------------------
Trying http://localhost:31300/anthropic/v1
Error: Error code: 404 - {'type': 'error', 'error': {'type': 'not_found_error', 'message': 'Not Found'}, 'request_id': 'req_011CVmTuCwetrtSfTxdJRaHA'}
-------------------
Trying http://localhost:31300/anthropic/v2
Error: Error code: 404
-------------------
Troubleshooting Done:
- Restarted Lens Loop
- Restarted computer
- Verified Anthropic API key works (responses come through)
Any help would be appreciated!