<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/spring-ai-tutorial-04---chat-with-anthropic-claude-models-rhojqeqgz" -->

---
title: Spring AI Tutorial : 04 - Chat with Anthropic Claude Models
description: A walkthrough tutorial demonstrates how to connect a Spring AI application to Anthropic's Claude models instead of OpenAI. It covers creating an Anthropic...
canonical: https://daily.dev/posts/spring-ai-tutorial-04---chat-with-anthropic-claude-models-rhojqeqgz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Spring AI Tutorial : 04 - Chat with Anthropic Claude Models | daily.dev
og:description: A walkthrough tutorial demonstrates how to connect a Spring AI application to Anthropic's Claude models instead of OpenAI. It covers creating an Anthropic...
og:url: https://daily.dev/posts/spring-ai-tutorial-04---chat-with-anthropic-claude-models-rhojqeqgz
og:image: https://api.daily.dev/og/posts/RhOjqEQGz.png
og:image:alt: Spring AI Tutorial : 04 - Chat with Anthropic Claude Models
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Spring AI Tutorial : 04 - Chat with Anthropic Claude Models

**[SivaLabs \(YouTube\)](https://daily.dev/sources/sivalabs-youtube)** · 3 min read · 0 upvotes · 0 comments

## Summary

A walkthrough tutorial demonstrates how to connect a Spring AI application to Anthropic's Claude models instead of OpenAI. It covers creating an Anthropic account and API key, switching the Spring AI starter dependency to the Anthropic one, configuring the base URL and API key properties, and selecting a Claude model (Claude Opus 4) via model aliases from Anthropic's documentation. The rest of the chat controller code remains unchanged, illustrating Spring AI's higher-level abstraction across model providers. A test asking Claude to explain Docker confirms the integration works, and the video previews upcoming coverage of prompt templates.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=v_MmSCsdnpo>

## Questions this post answers

### How do I configure Spring AI to use Anthropic Claude instead of OpenAI?

Swap the OpenAI starter dependency for the Anthropic starter, then set the anthropic base URL (default is usually fine) and API key properties instead of the OpenAI ones. Create an API key from the Anthropic console, store it as an environment variable, and select a model such as claude-opus-4 using the model alias names documented on Anthropic's models page. The rest of the chat controller code, including the higher-level Spring AI abstraction, stays the same.

_Developers wiring multiple LLM providers into Spring AI compare setup steps like this on daily.dev._

## Similar posts on daily.dev

- [Anthropic Agent Skills Support in Spring AI](https://daily.dev/posts/anthropic-agent-skills-support-in-spring-ai-ikaytx5vt) · Spring · 0 upvotes · 0 comments
- [Spring AI Series](https://daily.dev/posts/spring-ai-series-j7w3rmryb) · Baeldung · 4 upvotes · 0 comments
- [Run Claude Managed Agents with Chat SDK](https://daily.dev/posts/run-claude-managed-agents-with-chat-sdk-oszljvd8k) · Vercel · 1 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#java](https://daily.dev/tags/java), [#spring-boot](https://daily.dev/tags/spring-boot), [#spring-ai](https://daily.dev/tags/spring-ai)

[View this post on daily.dev](https://daily.dev/posts/spring-ai-tutorial-04---chat-with-anthropic-claude-models-rhojqeqgz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Spring AI Tutorial : 04 - Chat with Anthropic Claude Models","url":"https://daily.dev/posts/spring-ai-tutorial-04---chat-with-anthropic-claude-models-rhojqeqgz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/spring-ai-tutorial-04---chat-with-anthropic-claude-models-rhojqeqgz"},"datePublished":"2026-09-27T07:26:40.323Z","dateModified":"2026-09-27T07:32:20.018Z","description":"A walkthrough tutorial demonstrates how to connect a Spring AI application to Anthropic's Claude models instead of OpenAI. It covers creating an Anthropic...","image":"https://i.ytimg.com/vi/v_MmSCsdnpo/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/v_MmSCsdnpo/sddefault.jpg","isAccessibleForFree":true,"articleSection":"SivaLabs (YouTube)","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"SivaLabs (YouTube)","logo":"https://media.daily.dev/image/upload/s--8ATVo4an--/f_auto,q_auto/v1790493987/logos/sivalabs-youtube?_a=BAMAMicg0","url":"https://daily.dev/sources/sivalabs-youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/spring-ai-tutorial-04---chat-with-anthropic-claude-models-rhojqeqgz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,java,spring-boot,spring-ai","timeRequired":"PT3M","video":{"@type":"VideoObject","name":"Spring AI Tutorial : 04 - Chat with Anthropic Claude Models","description":"A walkthrough tutorial demonstrates how to connect a Spring AI application to Anthropic's Claude models instead of OpenAI. It covers creating an Anthropic...","thumbnailUrl":"https://i.ytimg.com/vi/v_MmSCsdnpo/sddefault.jpg","uploadDate":"2026-09-27T07:26:40.323Z","duration":"PT3M","url":"https://api.daily.dev/r/RhOjqEQGz","embedUrl":"https://www.youtube.com/embed/v_MmSCsdnpo"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"SivaLabs (YouTube)","item":"https://daily.dev/sources/sivalabs-youtube"},{"@type":"ListItem","position":3,"name":"Spring AI Tutorial : 04 - Chat with Anthropic Claude Models"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/spring-ai-tutorial-04---chat-with-anthropic-claude-models-rhojqeqgz#faq","mainEntity":[{"@type":"Question","name":"How do I configure Spring AI to use Anthropic Claude instead of OpenAI?","acceptedAnswer":{"@type":"Answer","text":"Swap the OpenAI starter dependency for the Anthropic starter, then set the anthropic base URL (default is usually fine) and API key properties instead of the OpenAI ones. Create an API key from the Anthropic console, store it as an environment variable, and select a model such as claude-opus-4 using the model alias names documented on Anthropic's models page. The rest of the chat controller code, including the higher-level Spring AI abstraction, stays the same. Developers wiring multiple LLM providers into Spring AI compare setup steps like this on daily.dev."}}]}
```

