# How to become an AI engineer: the job, and your setup for GenAI development

An AI engineer builds software on top of large language models that someone else trained, reached through an API. The model call is the easy part; the job is everything around it: what goes into the prompt, which documents to look up, which tools the model may use, how to measure whether answers are right, how to keep it safe and what it costs. To start, you need Python 3.10 or later, an API key with a spend limit you set yourself, and a few hours of practice making calls.

- Page: https://tecyfy.com/ai-engineering/start-here
- Course: AI engineering course (https://tecyfy.com/ai-engineering), Module 0: Start here: what an AI engineer builds

At the end of this module you can:

- Say what an AI engineer builds, and how the work differs from ML engineering and data science
- Set up Python and a project folder for the course
- Create an API key, keep it out of your code, and cap what it can spend
- Check the whole setup with one script, and read what a call cost
- Set up a coding agent with project instructions, and use it without handing it your learning

This module answers 2 questions before any code: what the job is, and what you need on your computer to learn it. At the end you will have a project folder, an API key that cannot spend more than you allow, a coding agent that knows your project's rules, and a script that proves all 3 work.

## What an AI engineer builds

An AI engineer builds software on top of a [large language model](https://tecyfy.com/concepts/large-language-model) that someone else trained. You reach the model through an API, the way you would reach a payments or maps service: send text, get text back, pay for what you used.

Making that call takes a few lines. The job is everything around it:

- **What the model sees.** The instructions, the conversation so far, and the documents or records it needs to answer, chosen and trimmed to fit its [context window](https://tecyfy.com/concepts/context-window).
- **What it can do.** Tools it may call, such as looking up an order, with rules in code about what each may touch.
- **Whether it is right.** A model answers differently each time and can be confidently wrong, so you build an [eval set](https://tecyfy.com/concepts/eval-set) that measures it on every change.
- **Whether it is safe.** Text from strangers can carry instructions, so you limit what an injected or mistaken model can do.
- **What it costs, and how fast it is.** Every call is billed by the token and takes seconds, not milliseconds.

A large share of the work is measuring. Ordinary code gives the same answer every time; a model does not, so tests become evals, and logs become traces you read to find out why an answer went wrong.

## AI engineer, ML engineer, data scientist

The titles overlap, and the useful line is the API. An ML engineer trains and serves models: data pipelines for training, GPUs, model architecture. A data scientist analyses data and builds models to answer questions about it. An AI engineer mostly builds on models that already exist.

Latent Space's 2023 essay that popularised the title puts it this way: the line is permeable, so AI engineers sometimes fine-tune or host open models (module 10 does both) and researchers build on APIs too, but AI engineers should treat the product's own data and its evals as their job. The same essay noted that tasks which took a research team years in 2013 could be done with API docs in an afternoon in 2023. That is why the job exists: the model is bought, and the product is built around it.

- Interview: [LLM apps and RAG interview questions for AI Engineer roles](https://tecyfy.com/interview-questions-and-answers/ai-engineer/llm-apps). LLM apps and RAG questions for AI Engineer roles, with answers, from easy to hard.

## What you need before you start

- **Python you can read and write.** Functions, lists and dictionaries, classes at a basic level, installing a package with pip. The course explains everything to do with AI; it does not teach Python itself.
- **A terminal.** Running a script, moving between folders, setting an environment variable.
- **JSON and HTTP, roughly.** What a request and a response are, and what a status code like 429 means. Module 2 covers the rest.

You do not need machine learning, statistics or the maths of training. Module 1 explains how a model writes an answer at the level an engineer uses every day, and module 7 explains the little statistics an eval needs.

## What you build in this course

Every module adds one piece to the same project: the support assistant of a small online shop that sells kitchen equipment. By the end it answers customers from the shop's own help pages with citations, looks up orders, asks a person before any refund, refuses injected instructions and passes its own eval set within a budget.

- **Module 2** writes a script that sorts customer emails and drafts replies, with JSON your code can trust.
- **Module 3** turns its prompts into versioned templates with test cases.
- **Modules 4 and 5** add search over the help pages, then answers with citations that say "I don't know" when the pages do not.
- **Module 6** makes it an agent with tools, a step limit and a person before refunds, shared as an MCP server.
- **Modules 7 and 8** measure it with evals and attack it on purpose.
- **Modules 9 and 10** cut its cost and run an open model yourself.
- **Module 11**, the capstone, puts all of it together.

## Set up Python and a project folder

You need Python 3.10 or later. Check the version:

```bash
python3 --version
```

If it prints an older version or nothing, install a current Python from python.org or your system's package manager. Then make a folder for the course with its own virtual environment, so its packages stay separate from everything else on your computer:

```bash
mkdir shop-assistant && cd shop-assistant
python3 -m venv .venv
source .venv/bin/activate
pip install anthropic pydantic
```

On Windows, activate it with `.venv\Scripts\activate` instead. Run the activate line each time you open a new terminal for the course; the prompt shows `(.venv)` while it is active. Later modules add a few packages, and each one says which.

## Get an API key, and cap what it can spend

The examples use the Claude API. Sign in to the Claude Console at platform.claude.com, open the **API keys** page and select **Create key**. Give it a name you will recognise, such as "shop-assistant course", choose when it expires, and choose the workspace it belongs to (more on that below). The Console shows the full key, starting with `sk-ant-`, once only. Copy it then; if you lose it, you create a new one.

Keep the key out of your code. Set it in your terminal:

```bash
export ANTHROPIC_API_KEY="sk-ant-..."
```

The SDK reads `ANTHROPIC_API_KEY` by itself, so no script in this course contains a key. To avoid typing it each time, put the export line in your shell's startup file (`~/.zshrc` or `~/.bashrc`), which is never part of a project. Never paste a key into a script, a prompt, a notebook you share or a chat. If one does leak, revoke it in the Console at once; deleting it from a file does not help, because it is already known.

Then cap what it can spend, before the first call. Each usage tier has a monthly spend cap ($500 a month on the Start tier), and you can set your own lower limit on the Console's **Billing** page. Better still, create a workspace just for the course and put your key in it: a workspace can have its own spend limit, while the default workspace cannot. Once usage reaches a limit you set, the API refuses further requests with an error saying you have reached your specified usage limits, instead of spending more. A script that loops by mistake then stops at your limit, not at your tier's.

Other providers work the same way under other names. OpenAI's SDK installs with `pip install openai` and reads `OPENAI_API_KEY`; Google's installs with `pip install google-genai` and reads `GEMINI_API_KEY`. Every idea in this course carries over to them.

## Check that it all works

`check.py` tests each part in turn: that the key is set, that the API accepts it, which models it can call, and what one small call costs. Listing the models uses no tokens, so it is a free test of the key; the call itself uses [Claude Haiku 5.5](https://tecyfy.com/prices/claude-haiku-5-5), the smallest current model:

```python
"""Check the setup: the key works, which models it can call, and what one small call costs."""
import os

import anthropic

MODEL = "claude-haiku-5-5"
PRICES = {"claude-haiku-5-5": (0.10, 0.50)}  # dollars per million input and output tokens, from the price page

if not os.environ.get("ANTHROPIC_API_KEY"):
    raise SystemExit("ANTHROPIC_API_KEY is not set in this terminal. Export it, then run this again.")
client = anthropic.Anthropic()  # reads ANTHROPIC_API_KEY from the environment

try:
    for model in client.models.list():  # costs no tokens: a free test of the key
        print(f"{model.id:<20} {model.display_name}")
except anthropic.AuthenticationError:
    raise SystemExit("The API key was refused. Check ANTHROPIC_API_KEY, or create a new key in the Console.")
except anthropic.APIConnectionError:
    raise SystemExit("Could not reach the API. Check your internet connection or proxy.")

response = client.messages.create(
    model=MODEL,
    max_tokens=200,
    messages=[{"role": "user", "content": "In one sentence, what does an AI engineer do?"}],
)
print()
print(next(block.text for block in response.content if block.type == "text"))

input_price, output_price = PRICES[MODEL]
usage = response.usage
cost = (usage.input_tokens * input_price + usage.output_tokens * output_price) / 1_000_000
print(f"{usage.input_tokens} tokens in, {usage.output_tokens} out, ${cost:.6f}")
```

Run it with `python check.py`. It prints the models your key can use, a one-sentence answer, and the call's tokens and cost, a small fraction of a cent. Each failure gets its own message: no key in this terminal, a key the API refuses, or no connection. If you see one, fix that part before going on. The price comes from the [model's price page](/prices/claude-haiku-5-5); module 2 explains every number in the response.

- Tool: [Token counter](https://tecyfy.com/prices/token-counter). How many tokens your text is, on every model

## A coding agent as your pair

A coding agent is a model that works in your project: it reads files, runs commands and edits code, asking before it changes anything. Working with one is now part of the job, and it is a good teacher if you use it as one. The course's examples use Claude Code; others work the same way.

- Guide: [Claude Code: Install and sign in](https://tecyfy.com/coding-agents/claude-code/setup). Install Claude Code with one command (curl -fsSL https://claude.ai/install.sh | bash on Mac and Linux, irm https://claude.ai/install.ps1 | iex in Windows…

Give it the project's rules in a `CLAUDE.md` file at the top of the folder. Claude Code reads it at the start of every session, so you write the rules once:

```markdown
# Shop assistant

The support assistant for a small kitchen shop, built module by module in the Tecyfy AI engineering course.

## Commands
- `source .venv/bin/activate` before anything else
- `python check.py` checks the API key and the setup

## Rules
- Never write an API key into a file. The SDK reads ANTHROPIC_API_KEY from the environment.
- Every script that calls a model prints what its calls cost.
- Explain what you change and why. I am learning, so do not rewrite a file I wrote unless I ask.
```

- Guide: [Claude Code: CLAUDE.md and memory](https://tecyfy.com/coding-agents/claude-code/project-instructions). CLAUDE.md is a Markdown file of instructions that Claude Code reads at the start of every session. Put one at the root of your repository with your build and…

How to use it while learning:

- **Type the module's code yourself first**, or at least read it line by line. Then ask the agent to explain anything you could not.
- **Ask it to break things.** "Make the API return a rate limit error and show what my script does" teaches more than a working run.
- **Read every change it makes**, and run it. Working code you cannot explain is the agent's skill, not yours.
- **Keep it in a safe mode.** Let it ask before running commands or editing files, and never let it read your shell's startup file where the key lives. The settings builder writes the permission rules for you.

- Tool: [Claude Code settings builder](https://tecyfy.com/coding-agents/claude-code/settings-builder). Permission rules, the starting mode, hooks, MCP servers and a CLAUDE.md for your project, ready to copy.

## Build it: the project folder

Your project now has everything the later modules build on:

```text
shop-assistant/
  .venv/          the virtual environment (never committed)
  .gitignore      .venv/, __pycache__/, *.db and .env
  CLAUDE.md       the project's rules for the coding agent
  check.py        checks the key, the models and the cost of one call
```

Create the `.gitignore` so nothing private ends up in version control:

```text
.venv/
__pycache__/
*.db
.env
```

Then run the check. With a working key it prints something like this (the answer's wording and the token counts will differ):

```text
$ python check.py
claude-opus-5-5      Claude Opus 5.5
claude-sonnet-5-5    Claude Sonnet 5.5
claude-haiku-5-5     Claude Haiku 5.5

An AI engineer builds software on top of language models: the prompts, retrieval, tools, evals and safeguards around the model call.
1200 tokens in, 400 out, $0.000320
```

The list is longer with a real key; the output above is from a stand-in for the API that every script in this course is first run against, which is why its token counts are round. Before you move on, open the Console's Billing page once more and confirm the spend limit is there. Module 1 explains what happened inside the model to write that sentence, and module 2 turns the call into something your code can rely on.

## Check yourself

1. You put your API key in check.py so you do not have to export it each time, and push the project to a public GitHub repository. What is the right first step when you notice?

   A. Delete the line and push again, so the key is gone from the repository
   B. Make the repository private
   C. Revoke the key in the Console and create a new one, then keep the new key in an environment variable
   D. Rename the variable so the key is harder to find

2. You want this course to cost you no more than you planned, even if a script loops by mistake. What does that?

   A. Using the cheapest model in every exercise
   B. A spend limit you set in the Console, on a workspace of its own for the course
   C. Setting max_tokens low on every call
   D. Checking the Usage page in the Console every evening

3. You ask your coding agent to write the module's eval script, and it works first time. What makes sure you still learn what the module teaches?

   A. Nothing more is needed, since the script works
   B. Ask it to add more comments
   C. Ask it for a longer script with more features
   D. Read every line it wrote, explain to yourself why each part is there, run it, then break something on purpose and check the eval notices

### Answers

1. C. Once a key has been public it must be treated as known, whatever you do to the repository afterwards; deleting the line leaves it in the history, and copies may already exist. Revoking it is the only step that stops it working. Then keep keys in the environment, where the SDK reads them, and never in a file that is committed.
2. B. A spend limit is enforced by the API itself, so a runaway loop stops at it whatever your code does. A small model and a low max_tokens make each call cheaper but do not stop a loop from making thousands of them, and reading the Usage page tells you about the bill after it has happened.
3. D. Working code you cannot explain is the agent's skill, not yours, and you will not be able to fix it when it fails on real data. Reading, running and breaking it on purpose is how you check both the code and your own understanding. More comments or features add text, not understanding.

## Questions

### What does an AI engineer do?

An AI engineer builds products on top of large language models made by someone else, such as Claude, GPT or Gemini, reached through an API. The work is the system around the model call, such as the prompts and context, retrieval from documents, tools the model can use, evals that measure answers, safety checks, cost and monitoring.

### What is the difference between an AI engineer and an ML engineer?

An ML engineer trains and serves models. An AI engineer mostly builds on models that already exist, through an API, and treats the product's data and its evals as the core of the job. The line is loose; AI engineers sometimes fine-tune or host open models, and ML engineers build on APIs too.

### Do I need to know machine learning or maths to become an AI engineer?

No, not to start. You need to write ordinary Python, use a terminal, read JSON and understand roughly how an HTTP API works. How models work matters (module 1 explains what you need), but you do not train one, and the maths of training is not part of the daily work.

### How do I get a Claude API key?

Sign in to the Claude Console at platform.claude.com, open the API keys page, select Create key, name it and choose its expiry and workspace. The key starts with sk-ant- and is shown only once, so copy it then. Set it as the ANTHROPIC_API_KEY environment variable, which the SDK reads by itself.

### How much does it cost to learn AI engineering with an API?

You pay per token, so the bill depends on the model and how much you run. Every script in this course prints what its calls cost. Set a spend limit on the Console's Billing page before you start, below your tier's monthly cap; a request over it fails with an error instead of spending more.

## Sources

- [The Rise of the AI Engineer](https://www.latent.space/p/ai-engineer)
- [Get started with Claude](https://platform.claude.com/docs/en/get-started)
- [Get your Claude API key](https://platform.claude.com/docs/en/get-api-key)
- [Rate limits](https://platform.claude.com/docs/en/api/rate-limits)
- [List Models](https://platform.claude.com/docs/en/api/python/models/list)
- [Developer quickstart](https://developers.openai.com/api/docs/quickstart)
- [Gemini API quickstart](https://ai.google.dev/gemini-api/docs/quickstart)
