SDKs

Anthropic SDK

Use the official Anthropic SDKs by pointing them at Spoof.

Because the Messages API is Anthropic-compatible, the official Anthropic SDKs work with Spoof. Set the base URL to https://api.spoofzone.com and use your spf_ key as the API key.

from anthropic import Anthropic

client = Anthropic(
  base_url="https://api.spoofzone.com",
  api_key="spf_your_key",
)

message = client.messages.create(
  model="claude-sonnet-4-6",
  max_tokens=1024,
  messages=[{"role": "user", "content": "Hello, Spoof!"}],
)
print(message.content[0].text)
python · 13 lines

Everything else works as documented by the SDK, including streaming, tool use, and token counting. For images, use any OpenAI-compatible client pointed at the same base URL.

Anthropic SDK | Spoof