Home / Servers / OpenAI API / create_completion
Create completion
An MCP tool from the OpenAI API server, hosted on mcp.hjlabs.in.
Create completion Creates a completion for the provided prompt and parameters. Returns a completion object, or a sequence of completion objects if the request is streamed. [POST /completions]
Name on the gateway: openai_api__create_completion · may change things.
Parameters
| Name | Type | Description |
|---|---|---|
model required | string | ID of the model to use. You can use the List models API to see all of your… |
prompt required | string | The prompt(s) to generate completions for, encoded as a string, array of… |
best_of | integer | Generates best_of completions server-side and returns the "best" (the one with… |
echo | boolean | Echo back the prompt in addition to the completion |
frequency_penalty | number | Number between -2.0 and 2.0. Positive values penalize new tokens based on… |
logit_bias | object | Modify the likelihood of specified tokens appearing in the completion. Accepts… |
logprobs | integer | Include the log probabilities on the logprobs most likely output tokens, as… |
max_tokens | integer | The maximum number of tokens that can be generated in the completion. The… |
n | integer | How many completions to generate for each prompt. **Note:** Because this… |
presence_penalty | number | Number between -2.0 and 2.0. Positive values penalize new tokens based on… |
seed | integer | If specified, our system will make a best effort to sample deterministically… |
stop | string | Not supported with latest reasoning models o3 and o4-mini. Up to 4 sequences… |
stream | boolean | Whether to stream back partial progress. If set, tokens will be sent as… |
stream_options | object | Options for streaming response. Only set this when you set stream: true. |
suffix | string | The suffix that comes after a completion of inserted text. This parameter is… |
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 | A unique identifier representing your end-user, which can help OpenAI to… |
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_completion",
"arguments": {
"model": "…",
"prompt": "…"
}
}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 completion tool with model set to ….