Endpoint
Code Examples
- cURL
- Python
- Node.js
- Go
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID (e.g., gpt-4o, grok-2) |
messages | array | Yes | Array of message objects |
max_tokens | integer | No | Maximum tokens to generate |
temperature | number | No | Sampling temperature (0-2) |
stream | boolean | No | Enable streaming response |
Response Format
Function Calling
Function Calling allows models to generate structured JSON to call functions in your code.- Python
- Node.js
Function Calling Documentation
Complete guide on defining functions and handling responses