Create a chat completion (OpenAI compatible)

Accepts a list of messages and returns a model-generated response. Supports both single-turn and multi-turn conversations. Authenticate via Bearer token. Responses can be streamed (SSE) or returned as a single JSON object.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
required

ID of the model to use (e.g. gpt-5.2).

messages
array of objects
required

List of messages in the conversation.

messages*
boolean

If true, partial message deltas will be sent as server-sent events. Default false.

integer

Maximum number of tokens that can be generated in the completion.

number

Sampling temperature between 0 and 2. Higher = more random. Default 1.

number

Nucleus sampling: consider tokens with top_p probability mass. Default 1.

Up to 4 sequences where the API will stop generating. String or array of strings.

integer

How many chat completion choices to generate. Default 1.

number

-2.0 to 2.0. Penalize repeated tokens. Default 0.

number

-2.0 to 2.0. Penalize tokens that appear in the text so far. Default 0.

integer

Random seed for deterministic sampling (if supported by model).

response_format
object

Specify output format: { "type": "text" } or { "type": "json_object" } or json_schema.

tools
array of objects

List of tools the model may call. Each has type "function" and function { name, description?, parameters? }.

tools
enum
string

Optional end-user identifier for abuse monitoring.

web_search_options
object

Optional. Enables web search for models that support it (OpenAI Chat Completions). When present, this gateway treats the request as web-search-enabled; model allowlists may apply. Field names align with OpenAI web_search_options.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
text/event-stream