ChatClient vs ChatModel: Which Spring AI API Should You Use?
Spring AI gives you two ways to talk to an LLM: ChatClient and ChatModel. Picking the wrong one can cost you time and flexibility. In this video, I break down both APIs so you know exactly when to reach for each one. We'll explore the high-level ChatClient (a fluent, builder-style API similar to RestClient) and the low-level ChatModel interface that it's built on. You'll see both in action with hands-on code demos using OpenAI, including how to get metadata, token usage, and even multiple response generations from a single call. • ChatClient is the high-level fluent API. Start here for almost every Spring AI project • ChatModel is the low-level interface that ChatClient wraps, giving you fine-grained control and raw response metadata • Spring AI lets you write code to an abstraction so you can easily swap LLM providers • ChatModel gives you access to token usage, finish reasons, model info, and multi-generation responses • Both APIs ultimately call the same provider. ChatClient is built on top of ChatModel 0:00 - Intro — Two ways to talk to an LLM 0:30 - Why writing to an abstraction matters 1:15 - ChatClient overview — the high-level API 2:10 - ChatModel overview — the low-level API 3:00 - ChatClient vs ChatModel at a glance 4:00 - When to use which API 4:45 - Spring AI documentation walkthrough 5:30 - Setting up the project on start.spring.io 6:30 - Configuring the OpenAI API key 7:00 - ChatClient code demo — builder, prompt, and response 9:00 - Testing the ChatClient endpoint 9:45 - ChatModel code demo — prompt, response, metadata 12:00 - Accessing token usage and model metadata 13:00 - Multi-generation demo with ChatModel 14:30 - Wrap-up and final thoughts 🔗Resources & Links mentioned in this video: Spring AI Documentation: https://docs.spring.io/spring-ai/refe... 👋🏻Connect with me: Website: https://www.danvega.dev Twitter: / therealdanvega Github: https://github.com/danvega LinkedIn: / danvega Newsletter: https://www.danvega.dev/newsletter SUBSCRIBE TO MY CHANNEL: http://bit.ly/2re4GH0 ❤️

Why Google Just Gave Away Gemma 4 for Free

GraphQL for Java Developers: 07 - Data Integration (GraphQLRepository + AOT Repositories)

Events That Survive Crashes in Spring Modulith

Is RAG Still Needed? Choosing the Best Approach for LLMs

SCANOSS pre-commit hooks: detect undeclared open source before you commit

7 Authentication Concepts Every Developer Should Know

Spring Boot + Kafka in Minutes (Your First Message)

Android 17 sucks. So I put Linux on a phone.

Introduction to Spring Modulith - Modular Monoliths in Spring Boot

Keynote: After the AI Hype – What’s Real, and What’s Next - Richard Campbell - 2026

Don't learn AI Agents without Learning these Fundamentals

Ornith 9B Benchmarked vs Qwen 9B - Local 8GB GPU LLM options

How to Externalize Events in Spring Modulith with Kafka

MiniCPM5 - Just How Good Can a 1B Model Be?

Getting Started with Spring gRPC in Spring Boot 4.1

Ed Zitron on CNBC: Generative AI Doesn't Work, And Big Tech Is Out Of Hypergrowth Ideas

MCP vs API: Why traditional APIs are failing AI agents

Why AI Tokens are so Expensive - Computerphile

The AI data center oversupply crisis is coming | Ed Zitron

