When I ask to draw a cricle, the playground displays the generated python code that gets executed to draw the circle.
When I use the API asking the same prompt, I get text and image messages but I don’t find where the python code is.
(not in annotations, not in attachment not in a sepcific type content)
You’ll need to get run steps. Then parse the step details, looking for code interpreter types and their details. Here, from the expanded API reference: