Home / Servers / OpenAI API / create_chat_completion
Create chat completion
An MCP tool from the OpenAI API server, hosted on mcp.hjlabs.in.
Create chat completion **Starting a new project?** We recommend trying Responses to take advantage of the latest OpenAI platform features. Compare Chat Completions with Responses. --- Creates a model response for the… [POST /chat/completions]
Name on the gateway: openai_api__create_chat_completion · may change things.
Parameters
| Name | Type | Description |
|---|---|---|
metadata | object | Set of 16 key-value pairs that can be attached to an object. This can be… |
top_logprobs | integer | An integer between 0 and 20 specifying the maximum number of most likely… |
temperature | number | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will… |
top_p | number | An alternative to sampling with temperature, called nucleus sampling, where… |
user | string | This field is being replaced by safety_identifier and prompt_cache_key. Use… |
safety_identifier | string | A stable identifier used to help detect users of your application that may be… |
prompt_cache_key | string | Used by OpenAI to cache responses for similar requests to optimize your cache… |
prompt_cache_retention | in_memory | 24h | Deprecated. Use prompt_cache_options.ttl instead. The retention policy for the… |
prompt_cache_options | object | Options for prompt caching. Supported for gpt-5.6 and later models. By… |
messages required | array | A list of messages comprising the conversation so far. Depending on the model… |
model required | string | Model ID used to generate the response, like gpt-6-astra or o3. OpenAI offers… |
service_tier | auto | default | flex | scale | priority | fast | Specifies the processing type used for serving the request. - If set to… |
modalities | array | Output types that you would like the model to generate. Most models are… |
verbosity | low | medium | high | Constrains the verbosity of the model's response. Lower values will result in… |
reasoning_effort | none | minimal | low | medium | high | xhigh | max | Constrains effort on reasoning for reasoning models. Currently supported… |
max_completion_tokens | integer | An upper bound for the number of tokens that can be generated for a… |
frequency_penalty | number | Number between -2.0 and 2.0. Positive values penalize new tokens based on… |
presence_penalty | number | Number between -2.0 and 2.0. Positive values penalize new tokens based on… |
web_search_options | object | This tool searches the web for relevant results to use in a response. Learn… |
response_format | object | An object specifying the format that the model must output. Setting to {… |
audio | object | Parameters for audio output. Required when audio output is requested with… |
store | boolean | Whether or not to store the output of this chat completion request for use in… |
moderation | object | Configuration for running moderation on the request input and generated output. |
stream | boolean | If set to true, the model response data will be streamed to the client as it… |
stop | string | Not supported with latest reasoning models o3 and o4-mini. Up to 4 sequences… |
logit_bias | object | Modify the likelihood of specified tokens appearing in the completion. Accepts… |
logprobs | boolean | Whether to return log probabilities of the output tokens or not. If true… |
max_tokens | integer | The maximum number of tokens that can be generated in the chat completion.… |
n | integer | How many chat completion choices to generate for each input message. Note that… |
prediction | object | Configuration for a Predicted Output, which can greatly improve response times… |
seed | integer | This feature is in Beta. If specified, our system will make a best effort to… |
stream_options | object | Options for streaming response. Only set this when you set stream: true. |
tools | array | A list of tools the model may call. You can provide either custom tools or… |
tool_choice | object | Controls which (if any) tool is called by the model. none means the model will… |
parallel_tool_calls | boolean | Whether to enable parallel function calling during tool use. |
function_call | object | Deprecated in favor of tool_choice. Controls which (if any) function is called… |
functions | array | Deprecated in favor of tools. A list of functions the model may generate JSON… |
How to call it
Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:
{
"name": "openai_api__create_chat_completion",
"arguments": {
"messages": [],
"model": "…"
}
}Or connect the OpenAI API server directly, which lists 371 tools including this one:
claude mcp add --transport http hj-openai-api https://mcp.hjlabs.in/mcp/openai-api \
--header "Authorization: Bearer YOUR_API_KEY"Try asking
Use the create chat completion tool with metadata set to ….