Mistral Made Crystal Clear · chapter 3: Your First API Request

The request and response shape, annotated, showing where the answer lands in the JSON

2026-10-24

Below: the paragraph from the book that builds this idea, then the diagram itself (Figure 3.2), and a recap. About a minute of reading.

The token counts specifically are worth reading even on your very first call, because Chapter 4's entire pricing chapter is built on exactly this number. Every response carries a usage record of how many input tokens your prompt consumed and how many output tokens the reply consumed; multiply those against the rate table in Chapter 4 for the model you called, and you have the exact cost of that one call. Getting into the habit of glancing at that usage field now, before you have written any production code at all, makes the cost estimation recipe in Chapter 4 far less abstract when you get there.

Figure 3.2: The request and response shape, annotated, showing where the answer lands in the JSON.
Figure 3.2: The request and response shape, annotated, showing where the answer lands in the JSON.

Recap

  • The idea: The request and response shape, annotated, showing where the answer lands in the JSON.
  • The picture: Figure 3.2, from chapter 3 ("Your First API Request") of Mistral Made Crystal Clear.
  • Go deeper: the chapter builds this step by step, with recipes and sources at the end.

This diagram is one of many in Mistral Made Crystal Clear.

Every chapter opens with the gist, draws the hard ideas, and ends with recipes and sources.

Get the book

All diagrams