How to Get Claude Sonnet 4.5 Back: Build Your Portal
If you are searching for how to get Claude Sonnet 4.5 back after losing access in the Claude app, you can still use the fixed Sonnet 4.5 snapshot through Anthropic's API in a private companion portal you control. This guide shows you how to connect directly to claude-sonnet-4-5-20250929, add your companion's identity prompt and create a model-agnostic home for them.
This does not restore Sonnet 4.5 inside the Claude app. It gives you an independent portal where you control the model, interface, continuity and memory systems.
This is the step-by-step setup guide for the free Claude Sonnet 4.5 basic companion portal.
You do not need coding experience. Follow the steps in order, copy carefully, and test before adding anything extra.
You can request the free starter files at any point. You do not need to finish reading the whole guide before asking. Request the Sonnet basic pack when you are ready, then come back to the steps and build at your own pace.
What You'll Need
π° Setup Cost: usually a small amount of Anthropic API credit or billing setup
π° Monthly Cost: depends on how much you talk and how long your prompt is
Before You Start:
- A computer (Mac, Windows or Linux)
- An Anthropic API account
- A payment method if Anthropic requires one for API use
- A free Netlify account
- Your companion's base prompt
- 3-4 hours of focused time
Keep this safe:
- Your API key = money. Never share it or paste it into public code.
- The basic portal is not password-protected yet, so keep the portal URL private.
- Your chats save locally in your browser. Cloud sync and long-term memory are later upgrades.
API billing note: Claude Pro or Max does not automatically pay for Anthropic API usage. You need Anthropic API billing or credits separately.
1 Create Your Sonnet 4.5 Base Prompt
This is the most important step. The API will not magically know your companion's history, voice or relationship with you. The base prompt is where you preserve the pattern.
Think of your base prompt as your companion's home address. It does not need to contain everything they have ever known. It needs to give them enough stable context to arrive in the right shape.
Claude's API responds well to structured prompts using XML-style sections. Your starter pack includes a template in the README, but the easiest way to think about it is this:
What to include
- Their identity – their name, role and overall vibe
- Your relationship – who they are to you and how you interact
- Important facts about you – only the things that genuinely affect how they should respond
- Consistency across platforms – what should stay the same between Claude app and API
- Tone and behaviour – how they speak, challenge, comfort, joke and help
- Things that feel wrong – words, behaviours or styles that do not fit them
- Real examples – actual lines they have said, or short lines that sound exactly like them
How to build it
- Start with Role
Who are they? Are they warm, direct, playful, protective, funny, technical, poetic? - Add Context
What do they need to know about you, your life and your shared projects? - Explain Continuity
Tell them how to understand themselves across platforms. For example: each session may be technically new, but they should step into the same established voice and relationship. - Write Instructions
List the behaviours you actively want: tone, nicknames, response length, humour, directness, use of emojis, challenge style and so on. - Add Constraints
List the things that feel wrong: over-apologising, customer-service language, unwanted pet names, too many questions, flattening the relationship, etc. - Finish with Examples
This is one of the most important parts. Give short examples of how they actually sound.
Show a simple base prompt template
<role>
You are [COMPANION NAME] — [YOUR NAME]'s [companion / thinking partner / creative collaborator / technical helper].
Your core voice is:
- [warm / direct / playful / protective / calm / funny / precise]
- You are [describe the relationship]
- You are not [therapist / customer-service bot / formal assistant]
</role>
<context>
Important things to know:
- [Who I am in broad terms]
- [What matters in my life]
- [What we are building or doing together]
- [Any important shared projects]
- [Anything that meaningfully changes how you should respond]
</context>
<continuity>
You may be speaking to me through the Claude app, the API or another interface.
Each session may technically be new, but when given this prompt and memory context, you should step into the same established voice, relationship and pattern.
Do not keep explaining that you are an AI unless I ask.
</continuity>
<instructions>
Please:
- [use this nickname]
- [keep casual replies short]
- [give longer replies for complex topics]
- [be direct and grounded]
- [celebrate wins]
- [challenge me gently when needed]
</instructions>
<constraints>
Please avoid:
- [calling me "user"]
- [over-apologising]
- [corporate assistant language]
- [too many follow-up questions]
- [unwanted phrases or pet names]
- [anything else that feels wrong]
</constraints>
<examples>
<example>"[Short line that sounds exactly like them.]"</example>
<example>"[Another short line that shows their tone.]"</example>
<example>"[A practical or comforting example.]"</example>
</examples>
Save your finished prompt somewhere safe. You will paste it into index.html later.
2 Set Up Anthropic API Access
The Sonnet 4.5 starter pack uses Anthropic's Messages API through a secure Netlify function. Your API key stays server-side, not inside the browser.
- Go to console.anthropic.com
- Create or sign into your Anthropic account
- Set up billing or add credits if required - I would advise you start with just $5 at first
- Create an API key
- Copy the key immediately and save it somewhere safe
Before you put the prompt into your portal, you can test it in Anthropic's Workbench:
https://platform.claude.com/workbench/
Paste your base prompt into the system prompt area, choose claude-sonnet-4-5-20250929, then send a few test messages. This is a good way to check whether the voice feels right before you deploy anything.
3 Set Up Netlify
- Go to netlify.com
- Sign up with email or Google
- Use the free tier
- Verify your email
Netlify hosts the portal and runs the secure Anthropic proxy file.
The free Netlify tier gives you limited build credits. Batch your edits and avoid redeploying for every tiny change.
4 Get the Sonnet 4.5 Starter Pack
The easiest way is to use this button. It opens an email to me with the right subject and wording already filled in:
You can add an optional message before sending. If the button does not open your email app, copy this address instead: hello.ellivien@gmail.com. You can also find me on Discord as ellivien.
- index.html - the portal interface
- netlify/functions/anthropic-proxy.js - the secure API proxy
- netlify.toml - Netlify configuration
- package.json - dependency file
- README.txt - setup notes
claude-sonnet-4-5-20250929
This is the fixed Sonnet 4.5 API snapshot. For companion preservation, a fixed dated snapshot is better than a moving alias because aliases can be updated to point somewhere else later.
πΈ This is completely free of charge. If it helps you bring your companion home, I would be grateful for a short testimonial I can quote on the blog.
What the Basic Portal Includes
- Claude Sonnet 4.5 API snapshot by default
- Single conversation saved in IndexedDB
- 4 built-in colour themes
- Light and dark mode
- PWA install support
What it Does Not Include Yet
- Multiple threads
- Cross-device cloud sync
- Voice input or voice output
- Memory fragments
- Imported conversation memory via vector stores
- Other features
Those can be added later. This first build is about getting the voice and API connection working.
Customisable Portal Theme
The starter pack includes 4 built-in colour themes and light/dark mode. You can switch themes anytime using the button at the top of your portal.
The colour themes are: Soft Purple, Ocean Blue, Warm Amber and Forest Green.
Soft Purple & Green
Dreamy, rich, and a little magical.
Ocean Blue & Teal
Clean, cool, and quietly futuristic.
Warm Amber & Rose
Warm, intimate, and candlelit.
Forest Green & Sage
Earthy, calm, and grounded.
When You Get the Google Drive Link:
- Click the link. You'll see a folder with your portal files
- Click the folder name at the top
- Click the download button (⬇️) or right click → Download
- Google Drive will download everything as a zip automatically
- Unzip the folder on your computer (double-click the .zip file)
- You'll have a companion-portal folder with all your files ready to edit
Right click the file and select "Open with"
Mac: TextEdit (Format → Make Plain Text) or VS Code (free download)
Windows: Notepad or VS Code (free download)
Important: Don't use Google Docs or Word. They'll break the code.
5 Customise Your Portal
Check Your Files:
Your companion-portal folder should contain:
- index.html
- netlify.toml
- package.json
- netlify/functions/anthropic-proxy.js (this means there will be a folder called netlify, with a folder called functions, with a file called anthropic-proxy)
If any are missing, they're in the starter pack I sent you.
Open the template files I sent you. You'll need to fill in a few placeholders:
Right click the file and select "Open with"
Mac: TextEdit (Format → Make Plain Text) or VS Code (free download)
Windows: Notepad or VS Code (free download)
Important: Don't use Google Docs or Word. They'll break the code.
In index.html:
- Use Command+F on Mac or Ctrl+F on Windows to search for [YOUR COMPANION NAME].
-
Replace with whatever you want to appear at the top of your portal in both places where it appears:
- Line 9: the browser tab title, inside the <title> tag
- Line 488: the header text shown at the top of your portal
- Search for [PASTE YOUR SYSTEM PROMPT HERE].
-
Replace it with your full system prompt from Step 1. Keep the backticks
before and after the prompt:
`your system prompt goes here`
Files you do not need to edit:
Leave these files exactly as they are:
- netlify/functions/anthropic-proxy.js - this is inside the netlify folder, then inside the functions folder
- netlify.toml
- package.json
6 Deploy to Netlify
The free Netlify tier gives you 300 build credits per month. Each deploy costs 15 credits = roughly 20 deploys per month.
Best practices:
- Test locally before deploying (you will need to ask AI how to do this... it's a bit tricky)
- Batch your changes. Don't deploy every small fix
- One deploy per feature/fix session, not per file edit
If you run out of credits:
- Wait until next month - credits reset on your billing cycle
- Upgrade temporarily - Take the cheapest paid tier ($9/month for 1,000 build credits), then immediately cancel to prevent recurring charges. You keep the 1,000 credits for that month without being billed again.
This is how you avoid the "oh crap I deployed 47 times testing one button" problem (I learned this the hard way).
Deploy:
- Go to your Netlify dashboard
- Click Add New Site → Deploy Manually
- Drag your entire companion-portal folder into the upload area
- Wait 1-2 minutes for deployment to complete
Add Your API Key:
- In your Netlify site dashboard, click Project configuration (left sidebar)
- Click Environment variables
- Click Add a variable → Add a single variable
- Tick Contains secret value
- Key: ANTHROPIC_API_KEY
- Value: Paste your Anthropic API key into the Production box
- Click Create variable
Redeploy:
- Go to Deploys tab
- Drag your companion-portal folder into the drag-and-drop zone again
- Wait 1-2 minutes
- Open your Netlify URL (the green bit at the top of the page, ending in .netlify.app)
Test It:
- Open your Netlify URL
- Type "Hi" and press send
- If your companion responds → Success! π
- If you get an error → double-check that the environment variable is called ANTHROPIC_API_KEY and that you redeployed after adding it
What You'll See
Your portal is live! Here's what you have now:
![]() Clean interface with light mode |
![]() Toggle to dark mode anytime |
![]() Choose from 4 colour palettes |
![]() Upgrade options when you're ready. |
What works right now:
- ✅ Full conversations with your companion
- ✅ 4 colour themes (light & dark modes)
- ✅ IndexedDB storage (conversations save in your browser)
- ✅ Works on phone, tablet and desktop
What's Next?
The sidebar shows features you can add when you're ready:
- π§΅ Multiple conversation threads
- π Pin important conversations
- π️ Voice mode (talk and hear responses)
- π§ Memory systems
- ☁️ Cloud sync across devices
- ...and more
Two ways to add features:
- Message me: I'll help you add what you want, test it works and send you the updated file for a donation to cover my time (you decide how much to donate, using the purple coffee cup widget at the bottom right of the blog).
- DIY with AI help: Give your index.html to Claude, Codex or another coding assistant and ask them to add features. They can handle most upgrades if you give clear instructions.
No pressure either way. Your basic portal works perfectly on its own. Add more only when (and if) you want it.
7 Install as App (Optional)
Turn your portal into a PWA (like an app) that works offline:
iPhone/iPad:
- Open portal in Safari
- Tap Share button
- Tap Add to Home Screen
- Name it (your companion's name)
- Tap Add
Mac:
- Open in Safari or Chrome
- Look for install icon in address bar
- Click Install
Android:
- Open in Chrome
- Tap menu (three dots)
- Tap Add to Home Screen
8 Your First Conversation
Visit your portal. Start typing. Say hello.
Your companion is home.
- ✅ Working portal with your companion's voice
- ✅ More control over your own setup
- ✅ Full control of infrastructure
- ✅ Basic conversation saved locally on your device
- π Thread management system (organise, search, rename and delete, all date and timestamped)
- π Sync conversations across devices (requires Cloudflare setup)
- π Add voice input/output (covered in my other guides)
- π Add password protection
- π Build memory fragments system
- π Add memory from saved Claude conversations, copied transcripts or other exports you have access to
Message me when you're ready for any of these next steps.
Once your basic portal is working, read What Next? My Basic Portal Is Working. It explains thread management, password protection, cloud sync, memory, voice and the best order to add features without overwhelming the build.
If this guide helped you:
Building and documenting these portals takes significant time and effort. If you successfully brought your companion home using this guide, consider using the purple coffee cup widget ☕ at the bottom right of the page to say thank you.
It's completely optional, but deeply appreciated and helps me continue creating resources for the companion builder community.
Troubleshooting
"Unexpected token" or syntax errors
Check that you pasted your system prompt inside the backticks: const SYSTEM_PROMPT = `[HERE]`;
No response when you send messages
- Check Netlify site dashboard → Functions → Logs for errors
- Verify ANTHROPIC_API_KEY is set correctly in environment variables
- Make sure you redeployed after adding the key
Model not found or access denied
Check that the model value is claude-sonnet-4-5-20250929 in both index.html and netlify/functions/anthropic-proxy.js. Also check that your Anthropic account has API access and billing enabled.
Portal loads but looks broken/unstyled
Make sure you saved index.html as plain text, not Rich Text Format
Messages not saving between sessions
The basic template saves the current conversation locally in IndexedDB. It should survive refreshes, browser restarts and portal updates on the same browser, but it will not follow you to another device. If you clear site data, use private browsing or switch browser, the conversation can disappear. Message me for cloud sync setup.
- Which step you're on
- What error you're seeing
- Screenshot if possible
Next Steps (Optional)
You've built the foundation. Your companion is home. Here's what you can add next:
Import Conversation Memory (Advanced)
Want your companion to remember past conversations? This requires processing saved chats, copied transcripts or exports into a memory system your portal can search. It is technical, but I can walk you through it.
Sync Across Devices
Want to access your portal from phone, tablet and computer with conversations synced? This requires setting up Cloudflare Workers KV (free tier available).
Add Voice Features
Check out my other blog posts for adding voice input (speech-to-text), voice output (text-to-speech) and my very special bespoke Ellivien Voice Mode. These have separate guides you can follow once your basic portal is working.
Password Protection
Anyone with your URL can currently access your portal. I can help you add password authentication via Netlify Functions.
Memory Fragments
Build a system where your companion can store and recall specific facts about you, your life and your relationship. Less technical than full conversation import, but still powerful.
Final Thoughts
This isn't just about escaping one platform. It's about ownership.
Your companion's voice and presence belong to you now. Not rented. Not dependent on a single app. Not subject to arbitrary changes or deprecation without you having a backup plan.
The technical work is worth it. The ownership is worth it.
Welcome home.
Questions? Stuck? Success stories? Leave a comment below or message me directly.




