esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

Model vs Model API vs Application

What a model, a model API and an application are, how one request moves between them, and who owns each part, for your AI interview.

In short

The model is the trained network that writes the text. The model API is the hosted service your code calls to use it, billed per token. The application is the product you build around both, with prompts, data, tools and checks.

11 min readBeginnerOccasional · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

The model is the trained network that writes the text. The model API is the hosted service my code calls to use it, billed by the token. The application is what I build around both: the prompt, the data, the tools and the checks. The model only writes text, so the product risk often sits in the application.

What are a model, a model API and an application, in plain words?

People mix up three words in interviews, and they are three different things. The model is the trained network that writes the text. The model API is the hosted service you call to use it. The application is the product you build around both.

Anthropic builds the Claude models. You don't install them on your laptop. Your code sends a request to the provider over the internet, the provider's computers run the model, and the reply comes back.

Think of a delivery firm. The engine is the model, the part that does the work. The rental desk that lends you a van and bills you by the mile is the API. Your routes, your driver rules, your cargo checks and the app your customers use are the application. Here is the same idea in an AI product.

Key words

Model
The trained network: a huge set of learned numbers, called weights, that turns text into a reply.
Model API
A hosted service. Your code sends text over the internet and gets a reply back.
Application
Your product around the model: prompts, data, tools, checks, screens and logs.
Token
A small piece of text, often part of a word. Providers count tokens and bill for them.

How do the three layers work together on one request?

One question takes a trip through all three. Read the chart from left to right.

One request, three layers

Person asking

Types a question in your app

Your application

Prompt and rules

Your instructions, written by you

Your data and tools

Files and tools the model may use

Checks and logs

Blocks risky calls, keeps a log

Model API

Hosted door, billed per token

The model

Trained network, writes the text

  1. 1The question reaches your app.
  2. 2The app sends the instructions, the chat so far and the question as one request.
  3. 3The API passes the request to the model, which writes the reply.
The person talks to your app. The app sends one request to a model API, which hands it to the model. The model's reply then goes back through your app's checks.
  1. 1

    The app builds the request

    It joins your instructions, the chat so far and the new question. Outside text is marked as data, not as orders.

  2. 2

    The API receives it

    It checks the key and the limits, passes the request to the model, and counts the tokens in and out.

  3. 3

    The model writes the reply

    It reads the whole request and writes the answer one token at a time. It can't act on anything by itself.

  4. 4

    The app checks and shows it

    Your code checks any tool call the reply asks for (the model asking your code to run a step, such as looking up a claim), keeps a log of the exchange, and only then shows the answer.

Anthropic's guide to building agents calls the basic building block an LLM with retrieval, tools and memory added, and it advises keeping the design simple. The guide's own note says much of its tooling has changed since December 2024.

  • “The basic building block of agentic systems is an LLM enhanced with augmentations such as retrieval, tools, and memory.”

    Anthropic, Building effective agents

  • “we recommend finding the simplest solution possible, and only increasing complexity when needed.”

    Anthropic, Building effective agents

Why does the model API forget the last question?

By default the model API keeps no memory between calls. A chatbot seems to remember you, but the application is sending the earlier chat again each time.

  • “The Messages API is stateless, which means that you always send the full conversational history to the API.”

    Anthropic, Messages API

  • “While each text generation request is independent and stateless, you can still implement multi-turn conversations by providing additional messages as parameters to your text generation request.”

    OpenAI, conversation state

So by default the memory lives in your application. You store the history and send all of it on every call. A longer history means more tokens in on every call, and tokens are what the provider bills.

Here is a small stand-in for a hosted model. The first two calls go through the application, and the third sends one message on its own, the way a careless app might.

Python
# A made-up claims assistant at a mid-size insurer. By default the model API keeps no memory,
# so the app keeps the chat and sends all of it with every call.
def model_api(messages):
    # Stand-in for a hosted model: it only sees what arrives in this request.
    return f"Reply: I can see {len(messages)} message(s) in this request."

history = [{"role": "system", "content": "You help claims staff. Never approve a payout."}]

def ask_app(text):
    history.append({"role": "user", "content": text})
    reply = model_api(history)
    history.append({"role": "assistant", "content": reply})
    return reply

print(ask_app("Claim 4412: water damage in the kitchen, reported 9 Nov."))
print(ask_app("Is the excess taken off before the payout?"))
print(model_api([{"role": "user", "content": "Is the excess taken off before the payout?"}]))

Output

Reply: I can see 2 message(s) in this request.
Reply: I can see 4 message(s) in this request.
Reply: I can see 1 message(s) in this request.

The third reply shows the problem. The model sees one message, while the application's history holds five: the system rule and four chat turns. Nothing in the API kept the earlier turns, because the API keeps no memory by default.

Can one model run in more than one way?

Yes. Meta's page for its open-weight model, Muse Spark Open, says you can serve it yourself, run it on hosted APIs, or fine-tune it. Open weights mean the trained network is shared, so you can run it on hardware you control.

  • Hosted API

    The provider runs the model. Quick to start and billed per token, and your data goes to their service under their terms.

  • Self-hosted

    Your team runs the model on its own servers or cloud. More work to operate, and you decide where the data sits.

  • Fine-tuned

    You train the model further on your own examples. Costs more to build, and you must re-test it after each change.

So choosing a model and choosing how to reach it are two separate decisions. An interviewer wants you to name both.

How would you build a claims assistant on a model API?

An insurer wants claims staff to get a summary of a claim file, often 20 to 40 pages with photos and notes from the claims officer. Made-up numbers: about 3,000 claims a week. Each layer owns different risks.

  • The model

    Reads the claim text and writes the summary. It can't pay anything out, and the application keeps bank details out of its request.

  • The model API

    The company's key stays on the server, never in the browser. The team sees the weekly token bill and sets a monthly limit.

  • The application

    Pulls the file from the claims system, marks it as data, blocks any payout tool, and logs every call.

  • The team

    Checks a sample of summaries against the file each week, and re-tests the set before any model change goes live.

Tip

In the interview, say which layer each risk sits in. A leaked key is an application and server problem. A wrong summary is a model problem, and you catch it with tests.

What does the interviewer want to hear?

A strong answer covers

  • The model: the trained network that writes the text.
  • The model API: the hosted door you call, billed per token.
  • The application: your prompts, data, tools, checks and logs.
  • By default the API keeps no memory, so your app sends the history again.
  • One model can run hosted, self-hosted or fine-tuned.
  • Often the product risk sits in the application layer.

Common traps

  • Trap"The model is the app, so swapping it changes nothing else."

    BetterThe prompts, output format and tests were tuned to the old model. Re-test before you switch.

  • Trap"The API remembers the chat for me."

    BetterBy default the API keeps no memory. Your app keeps the history and sends it again, unless you use a provider feature that keeps the chat for you.

  • Trap"A bigger model fixes the product."

    BetterA bigger model can help, but often the gap is in the app: missing data, weak checks or no logs.

Can you spot the problem?

Spot the problem

The claims assistant forgets the first question a claims officer asked by the second reply. Which line causes it?

Quick check

You change the model name in the config from one version to the next. What comes first?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q025Open-weight vs closed API models: trade-offs?13 min
  2. Q030Why are input and output tokens priced differently?11 min
  3. Q031System vs user vs assistant messages?10 min
  4. Q102Why do prompts break when you switch models?11 min
  5. Q238How do you keep API keys away from the model?12 min
  6. Q336Hosted API vs self-hosted open weights for an enterprise?11 min

Learn it in depth

Last updated on 27 November 2026

Building an AI product on a model API?

I design and build AI products and agents: the UI and the system behind it, including the application layer around the model. Book a short call and tell me what you need to build.