Create Chat Completion
POST /chat/completions
Generate responses for conversational AI applications.
Request Body
Model to use for completion (e.g., “gpt-4o”, “gpt-3.5-turbo”, “claude-sonnet-4-20250514”)
Array of message objects forming the conversation
Maximum number of tokens to generate
Sampling temperature between 0 and 2
Enable streaming responses
Example
Streaming
Enable real-time responses with streaming:Function Calling
Use function calling for tool integration:Authorizations
Enter your API key (starts with 'ek-')
Body
application/json
Model to use for completion
Example:
"gpt-4o"
List of messages
Enable streaming
Maximum tokens to generate
Sampling temperature
Required range:
0 <= x <= 2Nucleus sampling
Required range:
0 <= x <= 1Top-k sampling
Required range:
-2 <= x <= 2Required range:
-2 <= x <= 2List of tools
Available options:
none, auto Enable web search
Reasoning effort level
Available options:
low, medium, high 