Loading topic
model field, the messages array, and the roles that give each message meaning. It assumes you can write basic Python, read JSON, set environment variables, and know what an HTTP POST and a status code are. The examples use the chat-completions 6 min readusage object exists and be comfortable with Python and JSON. Field names below follow the chat-completions shape. Other providers name things differently, so check your p6 min readfinish_reason and usage. It also assumes you know what a token is. Here you will learn the request fields that shape what the model writes: how random it is, how long it can be, and where it stops.6 min readrequests, that you know HTTP status codes, and that you have read the previous chapter on error codes and rate limits. Here you will make calls survive transient failures without hammering the provider or repeating work that already6 min readusage object from the response. It also assumes you know what a token is and how a conversation is resent on each call. You will turn those token counts into money and seconds, before and after a request is sent.6 min readusage and finish_reason, and apply retries and timeouts. You also need to be comfortable with 5 min read