In this lesson
Integrating is just this: the company's system asks, the AI answers.
You will make your first API call and see three integration ideas that solve real problems.
- Make the first API call
- Understand what goes in and what comes out
- Choose a simple integration
The API is a counter
An API is a program's service counter. Another program walks up, makes a request in an agreed format and gets the answer. No screen, no clicks. This is how your order system or your customer service system can use the AI.
Ollama already has that counter open, at the same address you saw before: http://localhost:11434.
The first call
Open the terminal and paste this command:
You get back a text with the answer inside the "response" field. If it shows up, it worked. The "stream": false part asks for the whole answer at once, instead of word by word.
Three simple integrations
| Idea | Goes in | Comes out |
|---|---|---|
| Classify messages | The customer's text | Category: quote, complaint, question |
| Extract data | A handwritten order | Product, quantity, deadline |
| Summarize | Customer service history | Three lines for the next agent |
Picture a repair shop that connects its quoting system to the AI. The agent writes the fault the way the customer described it, and the AI returns a structured work order. A person reviews and approves it.
The golden rule
The AI proposes, the person decides. In any integration, have a human review whatever goes out of the company or touches money. And keep the log of every call.
Ask for predictable answers
A system does not like surprises. If you expect a category, ask for it: "answer with only one of these words". If you expect data, ask for a list with fixed fields. The tighter the request, the easier it is to connect to the rest of the system. And handle the error: if the AI answers something outside what was agreed, the system should send the case back to a person instead of moving on.
Where the integration can fail
Three places. Ollama may be off or busy, so the system needs to wait and try again. The model may take a long time, and the system should have a time limit. And the text that goes in may be huge, bigger than the model's context window. In every case, the plan is the same: notify a person, never fail silently. Log the time of each answer too. If it starts to climb week after week, that is a sign the machine is getting too small for the load.
Before you connect everything
Start with just one low-risk process, and run it in parallel with the manual work for a week. Compare. Only then let the integration work on its own. A mistake in an integration repeats hundreds of times before anyone notices, and that is why the test comes first.
Who looks after the integration
Write down who created it, who maintains it and how to turn it off. If the AI starts giving strange answers, there needs to be an emergency button: a switch that puts the process back in manual mode in one minute. Whoever builds the integration tends to forget this part, and it is the one that saves you most on a bad day.
What the pros know
If you already have a system talking to a cloud AI, you do not need to rewrite anything to test local AI. Ollama accepts requests in the same format as OpenAI, at an address of its own. Just point the address (base_url) to http://localhost:11434/v1 and put any text, such as "ollama", in the key field, because Ollama does not use it. That way a professional compares cloud and local by changing one line of configuration, without touching the rest of the code.
Practice · 10 min
- Run the curl command from this lesson and read the response.
- Choose a process with repetitive text in your company.
- Write three lines: what goes in, what the AI does and what comes out.
Summary
- An API is the counter where one program talks to another.
- Ollama's local API is at localhost:11434.
- Simple integrations: classify, extract and summarize.
- The AI proposes, the person decides.
- You can swap cloud for local by changing only the address.
Sources
Read on October 30, 2026.
- Ollama, OpenAI compatibility: base_url http://localhost:11434/v1, a key must be filled in but is not used.
Lesson quiz
Three situations to apply what you learned.
Isaque Victor free courses