EN ▾

How Much Does Ollama Cost? Local Setup vs API Fees

How much does Ollama cost? The software is free to download, so the real price is the machine you run it on, the electricity it draws and the time you spend maintaining it. This article puts numbers on each part and compares them with paying per token.

Updated

Scale weighing a graphics card and power plug against a stack of token cubes, comparing local Ollama costs with an API

Key points

  • Ollama itself has no license fee, so your cost is hardware, electricity and upkeep.
  • A hosted API charges only for tokens: $0.15 per 1M input and $0.50 per 1M output here.
  • At low or uneven volume, pay per token is usually cheaper; at steady heavy volume, owned hardware can win.
  • Use the break-even formula below with your own numbers rather than trusting a rule of thumb.

Where the costs actually come from

Ollama is a program that downloads open-weight models and runs them on your computer. Installing it costs nothing. What you pay for is everything around it, in four buckets.

  • Hardware. If your current computer runs the model you want at a speed you accept, this cost is zero. If you need a new GPU, more memory or a dedicated box, it is the biggest number.
  • Electricity. A GPU under load draws a lot more power than an idle desktop. The bill depends on how many hours the model is working, not on how many hours the computer is on.
  • Time. Choosing models, updating, fixing a driver that stops working after an update, and tuning context length all take your hours.
  • Limits. A home machine runs a small number of requests at a time and usually fits a smaller context window than a hosted service offers. Hitting those limits has a cost if your project stalls.

The honest answer to the question in the title is therefore: nothing for the software, and whatever your hardware and power cost for the rest. The remaining sections turn that into numbers you can check.

Electricity: a worked example

The formula is simple: watts divided by 1,000 gives kilowatts, multiplied by hours of load, multiplied by your price per kWh.

Take a hypothetical GPU that draws 300 W while generating. You use it for 2 hours of real generation a day, 30 days a month. That is 0.3 kW x 2 h x 30 = 18 kWh. At an assumed $0.20 per kWh, which you should replace with the rate on your own bill, the month costs 18 x $0.20 = $3.60.

That is a small number, and it is why people sometimes say local models are "free". But the example assumes light use and ignores the rest of the computer's draw. Run a model around the clock for a service and the electricity figure grows to roughly 12 times that, since 24 hours is 12 times the 2 hours in the example.

Hardware, spread over its life

Hardware is a lump sum, so spread it over the months you expect to use it. Suppose you spend $1,000 on parts for a machine that will serve you for 24 months. That is $1,000 / 24 = $41.67 a month. Add the $3.60 of electricity from above and the local setup costs about $45.27 a month, before counting your time.

If you already own a capable computer, you can use only the extra cost of electricity, but be fair about it. If the machine would otherwise be used for something else, or you would upgrade it sooner because of the model, some hardware cost belongs in the sum. If you are building a service, include a spare, a backup power plan and your own time on call.

The numbers are examples. Replace $1,000 with your real figure and 24 months with how long you honestly expect to keep it before it feels too slow.

What the API costs for the same work

This service charges $0.15 per 1M input tokens and $0.50 per 1M output tokens from prepaid credit. There is no subscription and no minimum beyond the first top-up of $20. Failed or refused requests are not charged, and credit never expires. The full table is on the pricing page.

Here are two monthly workloads.

WorkloadInputOutputMonthly cost
Light: a personal assistant and some writing10M tokens2M tokens10 x $0.15 + 2 x $0.50 = $2.50
Heavy: a busy app or a large batch200M tokens40M tokens200 x $0.15 + 40 x $0.50 = $50.00

At the light level, the API costs $2.50 a month against $45.27 for the example hardware, so the API is far cheaper. At the heavy level, it costs $50.00 against $45.27, so the two are close and owned hardware starts to look better, provided it can actually handle that volume at the speed you need.

To see where the lines cross, divide the local cost by the cost of the light workload: $45.27 / $2.50 is about 18. So break-even sits near 18 times the light volume, which is roughly 181M input tokens and 36M output tokens a month. Below that, pay per token wins on cost alone. Above it, a machine you own can be cheaper if it keeps up.

A quick calculator for your own case

Paste your numbers into this script. It works out the monthly API cost from your token volume and compares it with your local cost estimate.

def api_cost(input_m, output_m):
    # token volumes in millions per month
    return input_m * 0.15 + output_m * 0.50

def local_cost(hardware, months, watts, hours_per_day, price_kwh):
    power = watts / 1000 * hours_per_day * 30 * price_kwh
    return hardware / months + power

print("API:", round(api_cost(10, 2), 2))
print("Local:", round(local_cost(1000, 24, 300, 2, 0.20), 2))

# To check the API from your own code later:
# OpenAI(base_url="https://api.ollamauncensored.com/v1", api_key="YOUR_KEY")
# model="uncensored"

To find your token volume, look at your current logs, or run a typical day through the API and read the usage field in each response. Multiply by days in the month. Responses also carry an X-Balance-USD header, which makes it easy to see exactly what a test run cost.

Things the money does not capture

Cost is not the only axis, and it would be unfair to pretend otherwise.

  • Privacy. A model on your own machine never sends data anywhere. The hosted API does not use prompts for training, but your text still travels to a server. If that is unacceptable for some content, keep it local.
  • Offline use. Ollama works without a network connection. The API does not.
  • Model choice. Ollama lets you try many models. This service runs one open-weight model, run by an independent provider and tuned to answer without content refusals for lawful adult use.
  • Context and concurrency. The API offers a 100,000-token window and 8 concurrent requests on a full key (2 on a trial key). A single home GPU may fit less context, and extra users queue behind each other.
  • Features. The API supports streaming, tool calling and JSON mode, but is text only, with no images, embeddings or fine-tuning. Ollama can cover some of those locally if your hardware allows it.

A hybrid is also reasonable: private material stays local, and long-context or high-volume writing goes to the API. The article on Ollama API behaviour covers how the two interfaces differ.

Trying the API without spending

You can test the cost side for free. New users can claim $0.50 of trial credit with one click on the API key page after sign-up. It needs no card, is one per person and is valid for 7 days. Sign-up is with Google, or with email and password. See the API key guide for the steps.

At the light workload above, $2.50 a month is about $0.083 a day, so the trial covers around six days of that usage ($0.50 / $0.083). Run your real prompts, read the usage fields, and scale the numbers up. When you are ready to continue, top up any whole amount from $20 to $500, paying with crypto (USDT on TRC20, USDC on Base). Bonuses of 5%, 10% and 15% apply from $50, $100 and $200. Moving an existing Ollama script over takes a few lines, shown in the quickstart.

FAQs for Developers

  • Is this the official Ollama API? No, we are an independent service. We use the same API standard but run our own uncensored model on our servers.
  • Can I use this with the OpenAI SDK? Yes, it is fully OpenAI-compatible. Just change the base URL and API key.
  • What happens if I get an error? Errors are free. You are only charged for successful token generations.
  • Is my data used for training? No. Prompts sent through our API are not used to train our model.

Questions and answers

Is Ollama free?

The software has no license fee. You still pay for the computer, the electricity it uses and your own time.

Is a hosted API cheaper than running Ollama locally?

At low or uneven volume, usually yes. At steady heavy volume, hardware you own can be cheaper. The break-even depends on your hardware price, electricity rate and token volume.

What does this API charge per token?

$0.15 per 1M input tokens and $0.50 per 1M output tokens, from prepaid credit with no subscription. Failed or refused requests are not charged.

Can I try it before paying?

Yes. Claim $0.50 of trial credit with one click on the API key page after sign-up. It needs no card and is valid for 7 days.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.