Create an chat message
Bearer Auth (In: header)Authorization: Bearer <YOUR_API_KEY>Bearer <YOUR_API_KEY>. Format: Authorization: Bearer sk-xxxxxx.| Field | Type | Required | Range | Description |
|---|---|---|---|---|
model | string | ✅ | - | The model ID |
input | string | array<object> | ✅ | - | Input content for the model. |
>input.role | string | ✅ | user assistant system developer | The role of the message input. One of user, assistant, system, or developer. |
>input.content | string | array | ✅ | - | A text input to the model when string; a list of one or many input items to the model, containing different content types when array. |
| Field | Type | Required | Range | Description |
|---|---|---|---|---|
type | string | ✅ | - | The type of content block. Supported: input_text, input_image, input_file. |
text | string | - | input_text | The text content of the input. |
image_url | string | - | input_image | The URL of the image to send to the model. |
filename | string | - | input_file | The name of the file being uploaded. |
file_url | string | - | input_file | The URL of the file to send to the model. |
| Field | Type | Required | Range | Description |
|---|---|---|---|---|
instructions | string | - | - | System instructions that the model should follow when generating a response. |
max_output_tokens | integer | - | - | The maximum number of tokens the model can generate in the response. |
temperature | number | - | 0.0 - 2.0 | Controls the randomness of the output. Lower values produce more focused responses, higher values produce more creative outputs. |
top_p | number | - | 0.0 - 1.0 | Nucleus sampling parameter. The model considers tokens with top_p cumulative probability mass. |
stream | boolean | - | - | If true, returns a stream of server-sent events (SSE) as the response is generated. |
tools | array<object> | - | - | A list of tools the model may call. Use this to provide functions the model can generate JSON inputs for. |
tool_choice | string | object | - | - | Controls which tool is called. none: no tool, auto: model decides, required: must call a tool. |
reasoning | object | - | - | Configuration for reasoning effort. Controls how much reasoning the model performs before generating a response. |
previous_response_id | string | - | - | The ID of a previous response to use as context for multi-turn conversations. |
truncation | string | - | auto | disabled | Truncation strategy. auto: automatically truncates input to fit context window; disabled: returns an error if input exceeds context window. |