Integration Guide
Using claw.zip with the Anthropic SDK
The Anthropic SDK is the standard way OpenClaw users interact with Claude. claw.zip works as a drop-in proxy β change the base URL and you are done. This is the recommended starting point for any OpenClaw user looking to reduce their API costs immediately.
Difficulty:Easy
Time:1 minute
Before You Start
Prerequisites
- βAnthropic SDK (TypeScript or Python)
- βAn OpenClaw API key
- βA claw.zip account and API key
Step-by-Step
Integration Steps
Step 1
TypeScript SDK setup
For the TypeScript/JavaScript SDK, change the baseURL parameter.
typescript
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: 'your_openclaw_key',
baseURL: 'https://api.claw.zip',
defaultHeaders: {
'x-api-key': 'your_clawzip_key',
},
});Step 2
Python SDK setup
For the Python SDK, set the base_url parameter.
python
import anthropic
client = anthropic.Anthropic(
api_key="your_openclaw_key",
base_url="https://api.claw.zip",
default_headers={
"x-api-key": "your_clawzip_key",
},
)Step 3
Make requests as normal
All SDK features work identically. Messages, streaming, tool use, vision β everything is supported.
python
# Python example
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[
{"role": "user", "content": "What is prompt compression?"}
],
)
print(message.content[0].text)Step 4
Check compression stats
The response includes headers showing compression performance.
typescript
// TypeScript - access raw response
const response = await client.messages.create({
model: 'claude-sonnet-4-20250514',
max_tokens: 1024,
messages: [{ role: 'user', content: longPrompt }],
});
// Check your claw.zip dashboard for detailed stats:
// - Tokens saved per request
// - Compression ratio
// - Model routing decisions
// - Cost savingsDone
You Are All Set
That is it. One configuration change and all your OpenClaw API calls are now compressed through claw.zip. No code changes, no new dependencies, no breaking changes.
More Guides