Loading page content
Paste OpenAI SDK code. Get the Anthropic SDK equivalent with model mapping, parameter renames, and message-format adjustments.
from anthropic import Anthropic
client = Anthropic(api_key="sk-...")
response = client.messages.create(
system="You are a senior engineer.",model="claude-opus-4-7",
messages=[
{"role": "user", "content": "Refactor this function."},
],
max_tokens=1024,
temperature=0.2,
)
print(response.content[0].text)