LLM Engineering Basics · Lesson 1 of 6

From chatting to building: the API view

See a language model as a component you call from code, make your first API call, and understand what changes when users are not you.

Data This lesson: 123KB

The chatgpt-for-beginners and prompt-engineering courses taught you to USE language models. This course changes the seat: you are now the BUILDER, calling a model from code so that OTHER people get its answers through your product — a support bot on an academy website, a document summariser, a report writer. Everything important about this course follows from that seat change: your users did not write the prompt, cannot judge the answer, and will trust what your system says. That trust is now your engineering problem.

The mechanics are honestly small. Every major provider exposes the same shape: an HTTPS API (your apis-for-automation knowledge applies unchanged) where you POST messages and receive a completion:

response = client.chat.completions.create(

model="...",
messages=[
    {"role": "system", "content": "You are a fee-desk assistant for an academy. Answer only from the provided fee table."},
    {"role": "user", "content": "CCNA ki fees kitni hai?"}
]

)

Two roles matter immediately. The SYSTEM message is the builder's channel — instructions the user never sees, where your product's rules live. The USER message is whatever your visitor typed. The model continues the conversation; your code extracts the text and shows it. That is the whole loop — and note the model has no memory between calls: every request must carry whatever history matters, assembled by YOUR code. 'The model remembers our chat' is an illusion the chat apps build exactly this way, and building it yourself in lesson 3 will demystify it permanently.

Provider choice is deliberately generic in this course: OpenAI, Anthropic, Google — same concepts, slightly different names (and this academy's own chatbot runs on one of them through exactly this pattern). What you need today: an API key from any provider's free tier, Python's requests or the provider's library, and the .env discipline from python-automation-basics — the key never enters code, never enters git, because a leaked LLM key becomes someone else's free usage within minutes, billed to you.

One honest warning carried from the paid course's own description: this field dates faster than anything else we teach. Model names and prices in any lesson will age; the CONCEPTS — tokens, context, retrieval, injection, evaluation — are the stable layer, and they are what this course teaches.

Try it yourself

Get a free-tier API key from any major provider, store it in .env (verify .gitignore covers it), and make your first scripted call: a system message defining a narrow assistant (fee desk, library helper — your choice) and three different user messages, printing each answer. Then change ONLY the system message to alter behaviour (tone, language, refusals) and observe: the builder's power lives in the channel the user never sees.

Check what you learned

Create your free BvLogic ID to take the quiz and record your score.

Create your BvLogic ID
Continue to lesson 2 All lessons