Skip to content

Chapter 4 of 5

API request and response fields

One call to a hosted model, accounted for field by field: the model name, the messages array, the ceiling on how much may be generated, and on the way back the content blocks, the reason generation stopped and the usage counts you are billed on. This chapter reads a real request and a real response line by line, prices a single call, shows the four lines of client code worth writing on your first call rather than your hundredth, and separates a truncated answer from an error that never reached the model.

What a language model is — read the current version at https://daviddominguez.dev/learn/en/what-a-language-model-is/llm-api-request-response

Back to top