Build vs Buy vs Wrap: The AI Framework
Every AI conversation hits the same question: build it, buy it, or wrap an existing API? Here's the actual framework with real cost comparisons.
TL;DR
Start with the cheapest option that meets your accuracy bar. API wrap for 80% of use cases (€15-50K). RAG for company-specific knowledge (€50-150K). Custom only when APIs can't meet accuracy needs (€150K+). Upgrade only when you hit a wall.
The question every AI conversation reaches
Should we build it, buy it, or wrap an existing API?
Most consultants give a non-answer: “it depends.” That’s technically true and practically useless. You need a decision, not a shrug.
Here’s the actual framework I use with clients. Three options, clear criteria, real costs. No “it depends.”
Option A: Wrap an API
What it is: You call an existing AI model (OpenAI, Anthropic, Google) via API. You write prompts, add guardrails, wrap it in a workflow, and connect it to your systems. The intelligence is rented - you pay per use.
When to choose:
- Your problem maps to something existing models already do well (text generation, summarization, classification, translation, Q&A)
- Your data doesn’t need heavy processing
- You want to test the waters before committing more
- You need to ship fast (4-8 weeks)
Costs: €15K-€50K to build. €200-€2,000/month in API fees depending on volume.
Limitations:
- The model doesn’t know your business - it has general knowledge, not your specific knowledge
- You’re dependent on the API provider’s pricing and availability
- Data privacy considerations (you’re sending data to a third party)
Reality: This is the right starting point for 80% of use cases. If an API can do it, don’t build a custom model. Start here. Prove value. Upgrade only if needed.
Option B: Buy a platform
What it is: You license an AI platform or SaaS tool that includes AI capabilities. Think Salesforce Einstein, Microsoft Copilot, or specialized AI platforms for your industry. The AI is embedded in a product you already use or buy.
When to choose:
- You’re already using the platform and the AI features are included or affordable
- Your use case is common (sales forecasting, customer service automation, document processing)
- You don’t have the team or budget to build custom
- You need something fast and don’t need deep customization
Costs: Typically €500-€5,000/month in licensing. Minimal build cost - mostly configuration and integration.
Limitations:
- Lock-in. You’re tied to the platform. If they raise prices, you pay. If they discontinue features, you lose them.
- Limited customization. You get what they offer. If you need something they don’t support, you’re stuck.
- Data dependency. Your data lives in their system. Moving it out may be difficult or impossible.
- Generic AI. The model serves all customers. It’s not optimized for your specific use case.
When NOT to choose: If you need deep customization, have unique data requirements, or want to own the IP. Platforms are convenient but create permanent dependencies.
Option C: Build custom
What it is: You build a custom AI system - either RAG (connecting existing models to your data) or a fully custom model (training on your data for a specific task). You own the code, the architecture, and the deployment.
When to choose RAG (€50K-€150K):
- AI needs to reason over your specific knowledge (documents, policies, products, procedures)
- An API alone doesn’t know your business well enough
- You need grounded answers with no hallucination
- You want the AI to cite sources
When to choose custom model (€150K-€500K+):
- APIs don’t meet your accuracy needs for a specific task
- You have enough data to train on (thousands+ of labeled examples)
- The use case justifies the investment (high volume, high value)
- You need to own the model for IP or data privacy reasons
Costs: RAG: €50K-€150K to build, €500-€3,000/month to run. Custom model: €150K-€500K+ to build, €1,000-€10,000/month to run.
Limitations:
- Higher upfront cost
- Longer timeline (8 weeks for RAG, 4-9 months for custom model)
- You need a team to maintain it (even if it’s 3 existing people with training)
- Ongoing maintenance: 15-20% of build cost per year
The decision framework
Here’s the decision tree I walk clients through:
- Can an API do it? If yes → Wrap an API. Ship in 4-8 weeks. €15-50K.
- Does the API need your company’s knowledge? If yes → Add RAG. Ship in 8-16 weeks. €50-150K.
- Is accuracy still not good enough? If yes → Consider custom model. 4-9 months. €150K+.
- Is there a platform that does this out of the box? If yes and you don’t need customization → Buy it. But check lock-in risk.
The progression is always: cheapest first. Prove value. Upgrade only when you hit a wall.
The hybrid approach
You don’t have to pick one and commit forever. The smartest path is phased:
Phase 1: Wrap an API. €15-50K. 4-8 weeks. Prove the concept works on your data. Measure value.
Phase 2: If the API doesn’t know your business well enough, add RAG. €30-80K incremental. 4-8 additional weeks. Now the AI is grounded in your knowledge.
Phase 3: If RAG isn’t accurate enough for your specific use case, consider a custom model. But only after proving Phases 1 and 2 don’t work.
This phased approach means you spend €15K to validate, not €150K to gamble. If Phase 1 delivers enough value, you might never need Phase 2 or 3.
Real cost comparison
Let’s say your use case is “answer customer questions about our products.”
| Approach | Build Cost | Monthly Cost | Timeline | Accuracy | Customization |
|---|---|---|---|---|---|
| API wrap | €15-50K | €200-2K | 4-8 weeks | Good (general) | Low |
| RAG | €50-150K | €500-3K | 8-16 weeks | Very good (your data) | High |
| Custom model | €150-500K+ | €1-10K | 4-9 months | Excellent (optimized) | Maximum |
| Platform | €5-15K config | €500-5K license | 2-6 weeks | Good (generic) | Low-Medium |
For most mid-market companies, RAG is the sweet spot. It’s accurate enough, grounded in your data, and doesn’t require the investment of a custom model.
What I recommend
Start with the cheapest option that meets your accuracy bar. Upgrade only when you hit a wall.
- 80% of use cases: API wrap
- 15% of use cases: RAG
- 5% of use cases: Custom model
- If a platform does what you need and lock-in is acceptable: Buy it
If a vendor recommends custom without proving APIs don’t work, get a second opinion. Custom models are more profitable for vendors. They’re not always better for you.
FAQ
How long until we outgrow an API? If your use case is stable, maybe never. Many companies run on API-based systems for years. You outgrow an API when you need accuracy that general models can’t provide, or when your volume makes API costs higher than running your own infrastructure.
Is building always more expensive? Upfront, yes. Over 3-5 years, it depends. If API costs scale linearly with volume and your volume is high, a custom model may be cheaper at scale. But most mid-market companies don’t have the volume to justify the crossover.
What about open-source models? They’re a variant of “build” - you avoid API fees but pay for infrastructure and talent. Llama, Mistral, and similar models can be self-hosted. Total cost is often similar to API pricing once you factor in infrastructure and maintenance. The real advantage is data privacy and control.
Ready to apply this to your situation?
Book an AI Readiness Call30-min call. No pitch. You leave with one concrete next step - even if it’s not us.
Jacek Trefon
AI engineering leader. 28 years building technology, 4+ years building production AI systems. I help companies assess, architect, build, and deploy AI that actually ships. Based in Spain, working globally.
Keep Reading
All articles →The First 30 Days of an AI Audit
An AI audit replaces incomplete information with a complete picture. Two weeks. You go from 'I think we should do something' to 'here's exactly what to do.'
We Built AI. Nobody Uses It.
The model works. The accuracy is good. Nobody uses it. This is the most common AI failure I see - and it's not a technical problem.
POC to Production - The Valley of Death
80% of AI projects die between POC and production. Here are the 7 things that break when you move from demo to real - and how to prevent each one.