How to Reduce Your AI API Costs

A beginner's guide. No experience required.

1. Why your AI costs might be too high

Most tutorials and quickstart guides default to the most expensive model available. If you followed an OpenAI tutorial, you're probably calling GPT-4o. If you followed an Anthropic tutorial, you're probably calling Claude Sonnet. These are great models, but they're also the priciest.

Here's the thing: for many tasks like classification, data extraction, and simple Q&A, a model that costs 10 to 20x less produces identical results. You're paying flagship prices for work that a smaller model handles just as well.

You won't know which calls are overpaying until you measure them. That's what Clawback does. It watches your API calls, replays them against cheaper models, and tells you exactly where you can save.

2. What you need

That's it. No Docker, no databases, no extra tools. If you have a project that calls an AI API, you're ready.

3. Setup (step by step)

Step 1: Open your terminal

The terminal is the command line interface on your computer. In VS Code, press Ctrl+` to open it. On Mac, open the Terminal app. On Windows, open PowerShell.

Step 2: Navigate to your project folder

Use the cd command to move into your project directory. Replace my-project with your actual folder name.

cd my-project

Step 3: Run the setup command

curl clawback.run | bash

This adds one line to your .env file. It tells your AI SDK to route calls through Clawback's proxy. Your API key stays on your machine.

Step 4: Enter your email when prompted

This is where your savings report will be sent. You'll get one email with results, nothing else.

Step 5: That's it. Keep using your app normally.

Clawback watches your API calls in the background. After enough calls, it replays each one against cheaper models, scores the quality, and emails you a report.

Windows users If you're on Windows and not using WSL, run this in PowerShell instead:
irm clawback.run | iex
Prefer a visual interface? If you're not comfortable with the terminal, use the Browser Setup on our homepage. It does the same thing with a point and click interface.

4. What happens next

5. Understanding your report

Your savings report breaks down the opportunities it found. Here's what each line means:

Quality matters. If quality drops below 95%, the report won't recommend that substitution. Clawback only suggests changes where the output is effectively the same.

6. Automatic optimization with Clawback Pro

The free audit shows you the problem. Clawback Pro fixes it.

Zero risk. If Clawback doesn't save you at least $500/mo, Pro is completely free. You only pay when the savings are real and meaningful.

7. Frequently asked questions

Will this break my app?

No. If you remove the env var, your app goes back to exactly how it was before. Clawback creates a backup of your .env file during setup, so you can always revert.

Can Clawback see my API key?

Your API key stays in your .env file on your machine. Clawback never stores or transmits it. The proxy forwards your requests using the key already on your machine, but the key itself never leaves.

How much does it cost?

The audit is free forever. If you upgrade to Pro and it saves you less than $500/mo, you still pay nothing. There is no credit card required to start.

What if I only make a few API calls?

Clawback needs enough calls to produce a meaningful analysis. Keep building and using your app normally, and the audit will run automatically when there's enough data to work with.