Chat Completions
Endpoints
Chat Completions
Create chat completions with any supported model
POST
Chat Completions
Request
Create a chat completion using any supported model.Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer YOUR_API_KEY | Yes |
Content-Type | application/json | Yes |
Body Parameters
The model to use (e.g.,
gpt-5.1, claude-sonnet-4.5, gpt-4.2, o3)Array of message objects with
role and contentSampling temperature between 0 and 2
Maximum number of tokens to generate
Whether to stream responses
Nucleus sampling parameter
Penalize frequent tokens (-2.0 to 2.0)
Penalize new tokens (-2.0 to 2.0)
Stop sequences
Function definitions for function calling
Controls function calling behavior
Response
Response Fields
Unique completion ID
Object type (always
chat.completion)Unix timestamp
Model used for completion
Array of completion choices
Token usage information