1. Prepare an API key

Create or select an API key in the console and send it in the Authorization header:

2. List available models

Call the model list first so you do not hard-code a model that is unavailable to the current key.
Use the returned id as the model name in later requests.

3. Send your first text request

For a non-streaming response, read the text from choices[0].message.content.

4. Send your first image request

Image results may contain a URL or base64 data. Clients should support both forms.

5. Check usage

Preserve the precision returned by the API when displaying charges.