AI Systems Instructor • Real Estate Technologist
Quick Answer: Create an Anthropic account at console.anthropic.com, generate an API key, install the Python SDK, use system prompts for your Context Cards, and build scripts that process real estate documents and generate content at scale. Claude's large context window handles documents other APIs can't.
Claude's 200K context window makes it the go-to API for real estate workflows involving long documents. Inspection reports, lease agreements, HOA packages, and detailed market data that would get truncated in other APIs process fully in Claude. This guide shows you how to set up the Anthropic API, choose the right Claude model for each task, and build automations that handle the document-heavy reality of real estate work.
Tools Needed
Anthropic account, Python 3.8+ (or JavaScript/TypeScript), code editor (VS Code recommended), terminal/command line
Go to console.anthropic.com and create an account. Navigate to API Keys and generate a new key. Name it clearly: 'real-estate-production' or 'listing-automation.' Copy the key immediately and store it as an environment variable on your computer. Set a spending limit in your account settings. For most real estate operations, $20-50/month handles thousands of API calls. Anthropic bills per token (input and output separately), and Claude Haiku is extremely cost-effective for routine tasks.
Tip: Store your API key as an environment variable named ANTHROPIC_API_KEY. Every Anthropic SDK automatically looks for this variable, so your code stays clean and your key stays secure.
Anthropic offers multiple Claude models, each with different speed/quality/cost tradeoffs. Claude Sonnet is the workhorse: excellent quality for most real estate tasks at moderate cost. Use it for listing descriptions, market analysis, and client communication. Claude Haiku is the speed demon: fast and cheap, perfect for batch operations like processing 100 lead responses or generating social media captions. Claude Opus is the heavyweight: highest quality for complex analysis, CMA narratives, and document review where accuracy matters most. Match model to task.
Tip: Start every new workflow with Claude Haiku. If the output quality isn't sufficient, move up to Sonnet. Only use Opus for tasks where quality differences are noticeable and worth the 10x cost premium. Most real estate content tasks run perfectly on Sonnet.
Claude's API has a dedicated 'system' parameter—this is where your Context Card goes. Unlike other APIs where the system message is just another message in the conversation, Claude treats system prompts as persistent instructions that frame every response. Load your real estate Context Card into the system parameter: your role, market expertise, brand voice, and output preferences. The user message then contains only the specific task and data. This separation keeps your prompts clean and your Context Cards reusable across different tasks.
Tip: Claude's system prompt gets cached after the first request in a session. This means subsequent requests with the same system prompt are faster and cheaper. Build your Context Cards once and reuse them across hundreds of API calls.
Claude's 200K token context window is its killer feature for real estate. A typical home inspection report is 5,000-15,000 tokens. A full HOA document package might be 30,000-50,000 tokens. Claude handles these without truncation. Build a document processing script: read the document file, send it to Claude with your summarization prompt, and save the structured output. For inspection reports, ask Claude to extract: major issues, safety concerns, estimated costs, and a client-friendly summary. One API call replaces 30 minutes of manual reading.
Tip: When processing PDFs, convert them to text first using a library like PyPDF2 or pdfplumber. Claude's API accepts text input, not file uploads. The conversion step takes 2 lines of code and ensures clean text extraction.
Combine Claude's API with your existing tools. Example workflows: new MLS listing data arrives in your email, your script extracts property details, Claude generates a listing description and 3 social media posts, output is saved to your content calendar. Another workflow: inspection report PDF saved to a folder, script auto-processes it through Claude, structured summary emailed to you and client-friendly version queued for client communication. Use Zapier, Make, or simple cron jobs to trigger these workflows automatically.
Tip: Start with one workflow, run it manually 10 times to verify quality, then automate the trigger. Premature automation means automated mistakes. Manual verification first, automation second.
# Python example - Claude API for Inspection Report Summary
import os
import anthropic
client = anthropic.Anthropic(api_key=os.environ.get("ANTHROPIC_API_KEY"))
system_prompt = """
You are a real estate transaction specialist who summarizes
inspection reports for agents and their clients. Your summaries
are structured, actionable, and include cost estimates based on
Nashville, TN market rates.
Always produce two outputs:
1. Agent Summary: bullet-point format with categories
2. Client Summary: conversational, under 250 words, plain language
"""
inspection_text = """[Full inspection report text pasted here -
Claude handles up to 200K tokens, so even a 40-page report fits]"""
message = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=2000,
system=system_prompt,
messages=[
{
"role": "user",
"content": f"Summarize this inspection report:\n\n{inspection_text}"
}
]
)
print(message.content[0].text)
AGENT SUMMARY Major Issues (Negotiate/Repair Required): - Roof: Ridge vent separation, north slope. Moisture intrusion risk. Repair: $800-$1,500. Full replacement if decking affected: $9,000-$14,000. - HVAC: 16-year-old Trane unit, refrigerant low, compressor showing wear. Estimated remaining life: 1-3 years. Replacement: $7,000-$10,000. - Electrical: Double-tapped breakers in main panel (2 circuits). Fire hazard. Repair: $200-$400. Moderate Issues (Address Within 12 Months): - Water heater: 11 years old, minor sediment buildup, functional. Replacement: $1,200-$1,800. - Grading: Negative slope toward foundation on east side. Correction: $500-$1,500. - Deck: Ledger board attachment missing flashing. Water intrusion risk. Repair: $300-$600. Minor/Maintenance: - Caulking needed around 3 windows (2nd floor) - Dryer vent needs cleaning - GFCIs in garage not tripping on test Estimated total for major + moderate items: $10,000-$28,300 Recommended negotiation credit: $12,000-$15,000 --- CLIENT SUMMARY Overall, this home is in decent shape for its age. There are a few items worth discussing, but nothing that should stop you from buying if the numbers work. The biggest item is the HVAC system. At 16 years old, it's nearing the end of its useful life. It works now, but budget for replacement within the next couple of years. That's a $7,000-$10,000 expense. The roof has a spot where the ridge vent has separated. It's a repair, not a replacement, and catching it now prevents water damage. Easy fix at $800-$1,500. There's a minor electrical issue—two circuits sharing one breaker—that a licensed electrician can fix in an hour for a few hundred dollars. It's a safety item, so it should be addressed. Everything else is typical maintenance for a home this age. My recommendation: ask the seller for a $12,000-$15,000 credit to cover the HVAC aging and roof repair. That's a reasonable ask given the findings. --- Model: claude-sonnet-4-5-20250929 Input tokens: 8,432 | Output tokens: 847 Estimated cost: $0.04
Claude's prompt caching can reduce costs by up to 90% for repeated system prompts. If you're processing 50 documents with the same system prompt, only the first call pays full price for the system prompt tokens. Subsequent calls use the cached version.
For real estate document processing, Claude Sonnet offers the best quality-to-cost ratio. Opus produces marginally better analysis but costs 5x more. Reserve Opus for complex scenarios like investment analysis or legal document review.
Build a 'document router' script that identifies document type (inspection, appraisal, title, HOA) and applies the appropriate system prompt automatically. One script handles all your document processing needs.
Claude's API supports streaming responses. For long outputs like detailed market reports, streaming shows results as they generate instead of waiting for the full response. Better user experience if you're building tools for your team.
Sending raw PDF files to the API instead of extracted text
Fix: Claude's API accepts text, not files. Use PyPDF2 or pdfplumber to extract text from PDFs before sending. Two lines of code: import the library, extract text, pass to API.
Using Claude Opus for every request, driving up costs unnecessarily
Fix: Match model to task. Haiku for simple formatting and quick tasks ($0.25/M input tokens). Sonnet for quality content and analysis ($3/M input tokens). Opus only for complex, high-stakes analysis ($15/M input tokens).
Not using the system parameter for Context Cards, putting everything in the user message
Fix: Claude's system parameter is specifically designed for persistent instructions like Context Cards. Using it improves response quality, enables prompt caching, and keeps your user messages clean and task-focused.
Learn the Frameworks
Stop guessing with AI. Join The Architect workshop to master the frameworks behind every guide on this site.