Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
A teammate argues that adopting a framework like LangChain means you never have to care which provider (OpenAI, Anthropic, Google) is underneath. Explain why this 'one API across providers' claim is a leaky abstraction in real production work.
The unified-API pitch holds for slow-moving features but leaks on every fresh release. Feature lag of 4-8 weeks and irreducible semantic divergence between providers force escape hatches that defeat portability.
Picture a universal phone charger that promises to fit every phone. It works for the basic shape, power in, current out, for last year's models. But the moment a phone maker ships a new fast-charge protocol, or a new water-resistance check, or a new low-power negotiation, the universal charger either ignores it (you lose the feature), exposes it through an adapter (which defeats the point of being universal), or pretends every phone has it (which lies to your phone). Real charging engineers know the universal charger is a convenience for the steady-state, not a substitute for caring about each phone's protocol.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 minutes: the two leaks (lag and lossy), three concrete recent examples, why escape hatches defeat the abstraction, and when the wrapper still earns its keep.
| Provider feature | Anthropic shape | OpenAI shape | What the wrapper loses |
|---|---|---|---|
| System prompt | Top-level `system` field | First message with role='system' | Lifecycle differences (caching boundaries, role-precedence) |
| Tool calling | tool_use + tool_result message types | function_call message + role='tool' response | Edge-case shape on concurrent / failed / structured tool I/O |
| Finish reason | stop_reason: end_turn / max_tokens / stop_sequence / tool_use | finish_reason: stop / length / tool_calls / content_filter | Cross-provider taxonomy lossy in either direction |
| Prompt caching | cache_control on message blocks | automatic prefix caching, no API knob | Wrapper either ignores or exposes vendor-specific |
| Reasoning controls | thinking: { type, budget_tokens } | reasoning_effort (o-series) | Different mental models, hard to unify |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Believing the 'one API across providers' pitch literally and getting blindsided when a provider's new feature is unavailable, sandbagged, or modelled wrong in the framework's wrapper.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.