Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
AI Cost Optimization: Cut Token Spend and Measure ROI
New
27 students

AI Cost Optimization: Cut Token Spend and Measure ROI

A crash course on spending fewer tokens in AI coding agents and AI apps, and measuring what that spend produces
Created byCloud Yeti
Last updated 11/2026
English

What you'll learn

  • Explain how AI tools charge you, on a plan with included usage and with a pay-per-token API key
  • Decide when to keep a chat, compact it or start a new one, and read the prompt cache line in /usage
  • Cut input tokens by pointing the agent at the right files and keeping instruction files short
  • Keep prompt caching working in a coding agent and in an app that calls a model
  • Send simple work to cheaper models, including subagents, and limit output length and effort
  • Set step caps, budgets, spend limits and guardrails, and measure cost per outcome with simple evals

Course content

6 sections • 14 lectures • 42m total length
  • Why token efficiency matters now4:25

    Why companies now cap AI spend, what token maxing is, and the map of the course. Keep one question in mind: what would you do differently if you paid for these tokens yourself?

  • How you are charged for AI1:08

    The two ways you pay for AI: a plan with included usage, or an API key that charges for every token.

  • Why a long chat costs more4:54

    Why coming back to an old chat can cost a lot, how to read the prompt cache line in /usage, and when to clear, compact or write a handover note.

Requirements

  • You use an AI chat app or an AI coding agent such as Claude Code, Codex or Cursor, or you are building an app that calls a model
  • No coding needed for most lessons. The API parts are explained in plain words

Description

Is $200 a month on Claude Code worth it? Is your team's AI budget justified? Your company may already cap what each person can spend, and someone is about to ask: we spent this much on AI, what did it produce?

Those questions are hard to answer if you only look at the bill. This course helps you answer them from both sides: spend fewer tokens for the same work, and turn the tokens you do spend into outcomes you can measure, with cost per outcome instead of cost per token.

It's a crash course: short on purpose, and it covers the main ideas fast. You get one idea per lesson, and every lesson ends with one thing you can try today.

I'm Saurav from CloudYeti. I worked at Amazon for 6 years, and I build with Claude Code every day. The course shows the habits and settings that I rely on in my own work.

By the end, you'll be able to:

  • Tell how you're being charged. A plan with included usage and an API key that bills every token are very different, and the right habits depend on which one you have.

  • Stop overpaying for long chats. You'll see why a chat costs more the longer it runs, and when to start a new one or compact the one you have.

  • Send less input. Point the agent at the file it needs, paste only the part that matters, and keep instruction files like the CLAUDE and AGENTS markdown files short.

  • Make prompt caching work for you. Learn what throws the cache away, and how to order a prompt in an app so the cache does its job.

  • Use a cheaper model where it's good enough. Send simple work to a cheaper model, use the advisor and orchestrator patterns, and give subagents a cheaper model.

  • Keep output in check. Ask for short answers, lower the effort on simple tasks, and set max tokens as a safety cap.

  • Stay in control. Use skills for work you repeat, and set caps on agent steps, budgets, spend limits and guardrails.

  • Measure the return on your spend. Track cost per outcome, not just cost per token, and run simple evals that show whether a cheaper model still does the job.

Who this is for: anyone who wants to understand the AI bill, keep it under control, and get more outcomes from every token. That includes developers who use AI coding agents, people building apps that call a model through the API, team leads who have to explain the AI spend, and FinOps and finance teams who pay the bill and set the budgets.

The demos use Claude Code. The same ideas apply to Codex, Cursor, Antigravity and other AI tools. Only the command names change. Where a lesson covers apps, it shows the same idea in code.

The sources I quote, such as Anthropic's docs and price list, are linked in each lesson's resources, so you can check everything yourself.

This course will keep growing. Tell me the cost problems you see at work, and I'll answer them in new lessons.

Who this course is for:

  • Developers who use AI coding agents every day and want to spend less or hit usage limits less often
  • Engineering leads and managers who get asked what the team's AI spend produces
  • Anyone building an app on a model API who wants a fast overview of the main cost levers
  • FinOps and finance teams who pay the AI bill, set budgets, and want more outcomes from every token