<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hansel Carter</title>
    <description>The latest articles on DEV Community by Hansel Carter (@hanselcarter).</description>
    <link>https://dev.to/hanselcarter</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F215732%2Fc412f077-ca18-4eca-91eb-5ae12dce6c84.jpeg</url>
      <title>DEV Community: Hansel Carter</title>
      <link>https://dev.to/hanselcarter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hanselcarter"/>
    <language>en</language>
    <item>
      <title>How to Use Anthropic's Opus &amp; Sonnet-4 in Windsurf with Your Own API Key</title>
      <dc:creator>Hansel Carter</dc:creator>
      <pubDate>Sat, 31 May 2025 21:46:06 +0000</pubDate>
      <link>https://dev.to/hanselcarter/how-to-use-anthropics-opus-sonnet-4-in-windsurf-with-your-own-api-key-22kp</link>
      <guid>https://dev.to/hanselcarter/how-to-use-anthropics-opus-sonnet-4-in-windsurf-with-your-own-api-key-22kp</guid>
      <description>&lt;p&gt;Here’s a &lt;strong&gt;DEV.to-style&lt;/strong&gt; blog post draft written in a friendly, developer-focused tone, explaining how to bring your own keys (BYOK) for using &lt;strong&gt;Anthropic’s Opus and Sonnet-4&lt;/strong&gt; models in &lt;strong&gt;Windsurf&lt;/strong&gt;:&lt;/p&gt;




&lt;h1&gt;
  
  
  🔑 How to Use Anthropic's Opus &amp;amp; Sonnet-4 in Windsurf with Your Own API Key
&lt;/h1&gt;

&lt;p&gt;So you've been hearing a lot about Claude Opus and Sonnet-4, huh? Maybe you’re curious to see how they compare to GPT-4o, or just want to try them out in a lightweight playground like &lt;a href="https://windsurf.com" rel="noopener noreferrer"&gt;Windsurf&lt;/a&gt;. Good news: it's totally possible to hook them up yourself—no waiting, no credits required from Windsurf—just &lt;strong&gt;bring your own API key&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here’s how I did it.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠 Step-by-Step: Bring Your Own Key (BYOK) to Windsurf
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Get Your Anthropic Key
&lt;/h3&gt;

&lt;p&gt;First, head over to the &lt;a href="https://console.anthropic.com/" rel="noopener noreferrer"&gt;Anthropic Console&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log in (or sign up).&lt;/li&gt;
&lt;li&gt;Go to the &lt;strong&gt;API Keys&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;If you haven't already, &lt;strong&gt;add a credit card&lt;/strong&gt; and load some credits.&lt;/li&gt;
&lt;li&gt;You'll be prompted to &lt;strong&gt;create a new API key&lt;/strong&gt;. Copy that key somewhere safe.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Add It to Windsurf
&lt;/h3&gt;

&lt;p&gt;Now go to &lt;a href="https://windsurf.com/subscription/provider-api-keys" rel="noopener noreferrer"&gt;Windsurf's API Key Settings&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;“Add Provider API Key”&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Anthropic&lt;/strong&gt; from the list.&lt;/li&gt;
&lt;li&gt;Paste your API key in the input field.&lt;/li&gt;
&lt;li&gt;Save.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Refresh Windsurf
&lt;/h3&gt;

&lt;p&gt;At this point, &lt;strong&gt;restart Windsurf&lt;/strong&gt; to make sure it registers the new provider.&lt;/p&gt;

&lt;p&gt;But here's the catch…&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 Finding Opus and Sonnet-4 in the Search
&lt;/h2&gt;

&lt;p&gt;By default, Windsurf doesn’t surface &lt;strong&gt;Opus&lt;/strong&gt; or &lt;strong&gt;Sonnet-4&lt;/strong&gt; unless you search for them explicitly.&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the model selector.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;"opus"&lt;/code&gt; or &lt;code&gt;"sonnet-4"&lt;/code&gt; in the search bar.&lt;/li&gt;
&lt;li&gt;Voilà — you should see them pop up.&lt;/li&gt;
&lt;li&gt;Select and start chatting!&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🤔 Why BYOK? And Why This Matters
&lt;/h2&gt;

&lt;p&gt;Let’s be honest—BYOK isn’t just about flexibility. It’s mostly about pricing and platform costs.&lt;/p&gt;

&lt;p&gt;Running large language models like Opus and Sonnet-4 isn’t cheap. Platforms like Windsurf would lose money giving everyone unlimited access to the most powerful models. That’s why they let you connect your own API key: you cover the cost directly, and they avoid having to eat the bill.&lt;/p&gt;

&lt;p&gt;This setup also:&lt;/p&gt;

&lt;p&gt;Keeps Windsurf lightweight and affordable, without jacking up subscription fees for everyone.&lt;/p&gt;

&lt;p&gt;Gives you access to top-tier models as soon as they’re available, even if the platform itself hasn’t “officially” added them.&lt;/p&gt;

&lt;p&gt;Let's developers and enthusiasts test things out in a neutral playground, without vendor lock-in or rate limits from middlemen.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✅ Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Setting up Claude Opus and Sonnet-4 in Windsurf with your own key is simple once you follow the steps. It’s a nice way to try out these powerful models without waiting on full platform support.&lt;/p&gt;

&lt;p&gt;Let’s be real though: we don’t even know how expensive these models really are at scale. Opus and Sonnet-4 are still new, and pricing could shift as usage grows. But one thing is clear—platforms like Windsurf can’t afford to eat those costs for everyone. That’s why BYOK exists.&lt;/p&gt;

&lt;p&gt;It might feel like an extra step, but it’s quickly becoming the norm. You get direct access, pay only for what you use, and stay in control. And in this fast-moving AI space, that flexibility is kind of essential.&lt;/p&gt;

&lt;p&gt;Happy prompt engineering! 🙌&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
