Self-hosting an AI model means running the model on infrastructure the company manages, whether a server on its premises, a rented dedicated server or a graphics card (GPU) rented by the hour in a cloud account in its name. The alternative is an API: the company sends each request over the internet to a provider that runs the model and charges for the volume of text processed, measured in tokens, pieces of words that the model reads and writes. The difference shows up in the bill and in the team's routine. With an API, you pay per request and the provider looks after the hardware. With self-hosting, you pay for the machine every hour, busy or idle, and someone in the organization has to run it.
This article is about where the model runs. If your question is which model to choose, see the article on open or proprietary AI models. If the decision to run the model on company servers has already been made and you need to size memory and hardware, see the article on running a local LLM in your company. Here you will find the possible setups, the published cost figures, a calculation to run with your company's usage records and a test for deciding before you sign up for anything.
What changes between hosting an AI model and using an API?
Between hosting an AI model and using an API, what changes is how you are billed, who runs the hardware, where the data goes and which models are available. The choice is rarely between two extremes. There are at least four setups, and each one splits these responsibilities differently.
| Criterion | Model maker's API | Third-party API for an open model | GPU rented in the company's cloud | Own or dedicated server |
|---|---|---|---|---|
| How you pay | Per token processed | Per token, at a price set by each provider | Per hour of running machine | Hardware purchase or fixed monthly fee |
| Who runs the model | The maker | The chosen provider | The company's team or a contractor | The company's team or a contractor |
| Where the request is processed | On the maker's hardware | On the provider's hardware | In the company's cloud account | On hardware under the company's control |
| Models available | The maker's models, including the most advanced | Open-weight models | Open-weight models or models fine-tuned by the company | Open-weight models or models fine-tuned by the company |
| Usage peaks | Absorbed by the provider, within contracted limits | Absorbed by the provider | Require more running machines | Limited by the installed hardware |
The model maker's API is the usual route for prototypes: you create an account, get a key and start sending requests the same day. A third-party API offers open models run by another company. A rented GPU and a dedicated server are the two forms of self-hosting, and in both the cost per token depends on how busy the machine is.
What does the data show about the cost of hosting an AI model or using an API?
The data published in 2026 shows that self-hosting only costs less than an API above a high, steady monthly volume, and that this volume changes with the model that self-hosting would replace. MassiveGRID, a company that sells GPU servers, calculated that a 96 GB dedicated server at US$ 1,656.15 a month only becomes cheaper than an API at US$ 2 per million input tokens and US$ 10 per million output tokens above about 414 million tokens a month, assuming three input tokens for every output token. Against a frontier model at US$ 10 and US$ 50, the same server breaks even at about 83 million tokens.
The comparison changes when the alternative is buying, through an API, the same open model you would run yourself. Developer MD Rakibul Islam, who sells installation services, calculated that an H100 GPU rented at US$ 2.89 an hour, about US$ 2,110 a month, only breaks even with Llama 3.3 70B bought through an API at US$ 1.04 per million tokens above about 2 billion tokens a month. Against Claude Sonnet 5.5, break-even drops to about 530 million, provided the open model does the job with the same quality.
Machine utilization matters more than the GPU price. LeanOps, an infrastructure consultancy, showed that the same H100 GPU, producing 2,000 tokens per second, costs US$ 1.06 per million output tokens at 90% utilization and US$ 9.56 at 10%. OpenRouter, a company that resells model access through an API, points out that usage concentrated in business hours, 40 of the week's 168 hours, keeps the GPU busy at most 24% of the time.
| Published reference | Value | Date and source |
|---|---|---|
| On-demand L40S GPU on AWS, running all month | US$ 1.861 an hour, US$ 1,358.53 a month | September 2026, LeanOps |
| List price of gpt-6.1-sol and Claude Sonnet 5.5 | US$ 2 per million input tokens and US$ 10 per million output tokens | 16 November 2026, MassiveGRID |
| Price spread between providers for the same open model | The most expensive charged 3.5 times the cheapest for Qwen3.8 27B output | 8 October 2026, OpenRouter |
| 96 GB server against an API at US$ 2 and US$ 10 | Break-even at about 414 million tokens a month | 16 November 2026, MassiveGRID |
| H100 GPU against the same open model through an API | Break-even at about 2 billion tokens a month | October 2026, MD Rakibul Islam |
All four analyses come from companies with a commercial interest in one side, and the prices are in dollars, on specific dates. Prices also move in both directions. LeanOps recorded that the arrival of a cheaper small model made the API cost, in its example, US$ 1,935 a month against US$ 4,076 for three L40S GPUs, reversing the result it had published weeks earlier. MassiveGRID recorded the opposite movement: a Google model doubles in price on 1 January 2027. Use these figures to understand the order of magnitude, and redo the calculation with current prices.
How do you calculate the volume at which self-hosting costs less than an API?
To calculate the volume at which self-hosting costs less than an API, divide the monthly infrastructure cost by the average price the API charges per million tokens at your input-to-output ratio. The result is the monthly break-even volume. Below it, the API costs less.
Before you start, have at hand the usage dashboard of the API used in the prototype, with at least one month of records, the provider's current price list and the hourly price of the GPU you would rent.
- Export from the API dashboard the input tokens, the output tokens and the number of requests in the busiest hour. Check that the exported month covers a normal working period.
- Calculate the ratio between input and output. An assistant that reads long documents and answers in a few lines can have three or more input tokens for each output token.
- Calculate the average price per million tokens with the formula used by MassiveGRID: (ratio × input price + output price) ÷ (ratio + 1). At three to one, with prices of US$ 2 and US$ 10, the result is US$ 4.
- Add up the monthly cost of self-hosting: a GPU running all month (730 hours), a second machine or a backup API for failures, and the hours of whoever will run the environment.
- Divide the monthly hosting cost by the average price and multiply by one million. Compare the result with the actual volume from step 1.
- Check utilization. If usage is concentrated in business hours or has peaks, the machine sits idle part of the time, and the real cost per token rises.
Hypothetical example: a customer service team uses an assistant that drafts answers for 1,000 conversations a day, each with 3,000 input tokens and 1,000 output tokens. Over 30 days, that is 90 million input tokens and 30 million output tokens, 120 million in total. On an API at US$ 2 and US$ 10, the bill comes to US$ 180 plus US$ 300, US$ 480 a month. An L40S GPU running all month on AWS costs US$ 1,358.53, which gives a break-even of about 340 million tokens a month, almost three times the team's volume, before counting the backup machine and the operating hours.
The most common mistake in this calculation is comparing the GPU price with a frontier model's price and assuming that a smaller open model will do the same work. If the test shows that the open model needs two attempts to get it right, the saving disappears. That is why the result of the calculation only holds after the quality test.
To check the calculation, ask someone else to redo it with the same records. They should reach the same break-even volume and be able to identify where each number came from.
When does self-hosting an AI model make sense?
Self-hosting an AI model makes sense when volume is high and steady, when an open model handles the task, when there are people to run the environment or when the data cannot leave the company's infrastructure. The last condition alone justifies the choice even without savings. The others need to appear together.
- Volume: usage stays above the calculated break-even throughout the day, or there is batch work to fill the idle hours, such as classifying documents overnight.
- Quality: an open model meets the approval criterion on the task's real requests.
- Operation: someone is responsible for updating the serving software, monitoring, swapping models and recovering when the service stops. LeanOps points out that a few weekly hours of an experienced person can cost more than the GPUs themselves.
- Data: a client contract, an industry rule or an internal policy forbids documents from being processed by third parties.
- Version control: the task depends on a model that cannot change without notice, or on a model fine-tuned with company data.
When is using an API better than hosting the AI model?
Using an API is better when volume is low or irregular, when the task requires a frontier model, when no one in the company can run a machine or when peaks are unpredictable. On an API, an idle month costs nothing, and a usage peak is absorbed by the provider within contracted limits.
- Volume: usage stays below break-even, as in a pilot, an internal tool with few users or seasonal demand.
- Quality: the task needs a frontier model. The largest proprietary models are not available for download and can only be used through the provider.
- Operation: the team has no one to maintain drivers, updates and monitoring.
- Data: the provider's contract meets the company's requirements on retention, use and processing location.
- Version control: the team follows the provider's change notices and tests the task when a model is replaced.
Does using an API meet the company's data requirements?
Using an API meets the company's data requirements when the provider's contract and configuration cover retention, use for training and processing location, and internal policy accepts processing outside the company. The requirement is often about retention, not about the hardware. OpenRouter documents a zero data retention option, which limits each request to providers that do not store prompts or responses, and, on business plans, endpoints that keep processing in Europe or the United States.
The same documentation records the limit: with zero data retention, the request is still processed on the provider's hardware. If the company's rule requires documents never to leave machines it operates, no API configuration complies, and self-hosting becomes a condition of the project.
To decide, write down the exact requirement and who set it. "Do not store the content" and "do not process outside the company" lead to different architectures. Then check the provider's contract for information retention, use for training, location and support access. The article on LGPD when contracting AI tools details that check. If the model is open, the model's license for commercial use has to be read separately, because hosting the model does not guarantee the right to use it in your business.
How do you combine self-hosting and an API in the same solution?
To combine self-hosting and an API in the same solution, size your own machine for steady usage and send peaks and requests that need a more capable model to the API. OpenRouter explains that serving software such as vLLM and SGLang offers the same call format used by the most common APIs, so the application switches destination by changing the address, the key and the model name.
The combined setup needs three precautions. The same model, running at different precisions, can give different answers to the same question. A conversation that switches destination midway loses its prompt cache. And if the company's rule requires data to stay on its hardware, requests containing that data cannot be sent to the API, not even during a peak. Record, for each type of request, which destination it may go to.
How do you test the alternatives before deciding where the model runs?
To test the alternatives before deciding where the model runs, run the same real requests from the task on the current API and on an open model installed on a GPU rented by the hour, and compare quality, response time and cost. The test takes a few days and avoids buying or contracting a monthly machine for a model that does not meet the need.
- Set aside 50 to 100 real requests from the task, as recommended by MD Rakibul Islam, with the answer considered correct for each. Remove or replace personal data that cannot be used in the test.
- Agree with the person who reviews the answers on the approval criterion, for example an answer usable without correction, before seeing the results.
- Run the requests on the current API and record correct answers, response time and cost.
- Rent a GPU by the hour, install the candidate open model and run the same requests, with the same number of simultaneous requests as in the busiest hour.
- Compare the results on the same criteria. If the open model does not meet the approval criterion, the cost decision does not apply. Go back to step 4 with a larger model or stay on the API.
- Redo the break-even calculation with the throughput measured in the test and the estimated operating hours.
The test is complete when someone else can read the record and identify the model, the version, the criterion, the accuracy rate, the response time and the cost of each alternative. The final decision on the data requirement and on who runs the environment remains with management.
If your team already uses an AI prototype and needs to decide where it will run once it becomes part of daily work, bring the usage record, the task and the rules on the documents involved to the conversation. We build the break-even calculation and the test with your requests, and, when the solution is built with us, we define who runs each part. See how we work on AI solutions or Arrange a conversation.
Common questions
What is self-hosting an AI model?
Self-hosting an AI model means running the model on infrastructure the company manages, such as a server on its premises, a rented dedicated server or a GPU rented by the hour in a cloud account in its name. The company pays for the machine every hour, busy or idle, and someone in the organization runs it. The alternative is an API, where the company pays the provider for each token processed.
At what volume does hosting an AI model cost less than using an API?
Hosting an AI model costs less than using an API only at high, steady monthly volumes, which vary with the model being replaced. MassiveGRID calculated about 414 million tokens a month for a US$ 1,656.15 server against an API at US$ 2 and US$ 10 per million tokens, in November 2026. When the alternative is the same open model bought through an API, MD Rakibul Islam calculated about 2 billion tokens a month for a rented H100 GPU.
What is the difference between using the model maker's API and renting a GPU to run the AI model?
With the model maker's API, the company pays per token, the maker runs the hardware and the most advanced models are available. With a rented GPU, the company pays per hour of running machine, its team or a contractor runs the environment and only open-weight or fine-tuned models can be used. Usage peaks are absorbed by the provider on an API and require more running machines on a rented GPU.
What are the risks of self-hosting an AI model?
The main risk of self-hosting an AI model is paying for a machine that sits idle much of the time, because a GPU costs the same busy or idle. There is also the risk of choosing an open model that does not reach the quality the task needs, and of having no one to update, monitor and recover the environment. LeanOps notes that a few weekly hours of an experienced person can cost more than the GPUs themselves.
How do you calculate whether to self-host the AI model or stay on the API?
To calculate whether to self-host the AI model, export a month of API usage, calculate the average price per million tokens at your input-to-output ratio and divide the monthly hosting cost by it, including a backup machine and operating hours. The result is the break-even volume, which you compare with your actual volume. Before deciding, test the open model with 50 to 100 real requests from the task.
Does using an AI API prevent a company from meeting its privacy requirements?
Using an AI API does not prevent a company from meeting privacy requirements when the requirement concerns retention and processing location, as long as the provider's contract and configuration cover those points. OpenRouter, for example, documents a zero data retention option that limits each request to providers that do not store prompts or responses. If the rule requires documents never to be processed by third parties, an API does not comply, and self-hosting becomes a condition.
Sources
- Self-Hosted LLM vs API Cost: Where the Break-Even Really Is MassiveGRID
API list prices on 16 November 2026, formula for the average price by input-to-output ratio and break-even volumes for dedicated servers. The company sells GPU servers and states its interest; it compares an open model on the server with a proprietary model on the API.
- Self-Hosted LLM vs API: When Does Self-Hosting Pay Off OpenRouter
Break-even utilization formula, the 24% ceiling for business-hours usage, price spread between providers of the same model on 8 October 2026, zero data retention option and combined setup. The company resells model access through an API; the zero data retention option applies to this intermediary.
- Self-Hosted LLM vs API Cost: vLLM per Million Tokens LeanOps
On-demand AWS GPU prices (US East, September 2026), effect of utilization on cost per token, hidden costs and an updated example in which the API became cheaper. Throughput figures in the examples are hypothetical.
- Is Self-Hosting an LLM Cheaper Than an API? MD Rakibul Islam
Break-even of a rented H100 GPU against the same open model through an API and against Claude Sonnet 5.5, at October 2026 prices, and a recommendation to test with 50 to 100 real requests. The author sells an installation service.
A conversation about your organization.
Before recommending any tool, we talk with your teams and map how the work really happens.
Arrange a conversation



