Skip to content
AgenticAIWiki
  1. Learn
  2. Part 0. Start here
  3. Chapter 1

Engineering prerequisites for AI apps

7 lessons · 46 min

One request, three ways

Full screen
POST /v1/messages200 + JSONanswerYour codeblocking callModel APIabout 2 s per replyUserwaiting…Blocking: the program does nothing while it waits.

Swipe to change step

Step 1 of 8. A blocking call sends one request and waits. For about 2 seconds the model generates tokens and your program sits idle. Your code (blocking call), highlighted. Model API (about 2 s per reply), highlighted. User (waiting…). arrow from Your code to Model API, labelled POST /v1/messages. arrow from Model API to Your code, labelled 200 + JSON. arrow from Your code to User, labelled answer. a request moving along POST /v1/messages.

In this chapter

  1. 1.1Python async and await for concurrent calls7 min read
  2. 1.2Pydantic models and runtime validation7 min read
  3. 1.3Environments and packages: venv, uv and poetry6 min read
  4. 1.4HTTP APIs: methods, status codes and JSON Schema7 min read
  5. 1.5Authentication: API keys and bearer tokens6 min read
  6. 1.6Streaming with server-sent events7 min read
  7. 1.7Retries with exponential backoff and jitter6 min read

Chapter check

Already know this? Score 80% or more and you can skip ahead. Each attempt draws 4 questions from 12.

Loading check…