Parameter | Type | Description | Required |
---|---|---|---|
model | String | The ID of the selected model to query. | Yes |
messages | Array of objects | A list of messages forming the conversation. Each message can include both text and image inputs. See the Image Input Format below for details. | Yes |
max_tokens | Integer | Maximum number of tokens to generate. The total length of input and generated tokens is limited by the model’s context length. Default is 1000. | No |
temperature | Float | Controls randomness in responses. Value can be between 0 and 1. Default is 0. | No |
top_p | Float | Adjusts the number of choices for each predicted token based on cumulative probabilities. Value can be between 0 and 1. Default is 0.9. | No |
top_k | Integer | Limits the number of choices for the next predicted word or token. Value can be between 1 and 100. Default is 50. | No |
stop | String or Array | Up to 4 sequences where the API will stop generating further tokens. Default is null. | No |
stream | Boolean | If true, partial message deltas will be sent. Default is false. | No |
stream_options | Object | Options for streaming response. Only set this when stream: true. Available option: include_usage (boolean). Default is null. | No |
Parameter | Type | Description | Required |
---|---|---|---|
type | String | Indicates the type of content. For images, set this to image_url. | Yes |
image_url.url | String | The base64-encoded image string. Must follow the format: data:<image_format>;base64,<data>. | Yes |