Home / Servers / OpenAI API / create_thread_and_run
Create thread and run
An MCP tool from the OpenAI API server, hosted on mcp.hjlabs.in.
Create thread and run Create a thread and run it in one request. [POST /threads/runs]
Name on the gateway: openai_api__create_thread_and_run · may change things.
Parameters
| Name | Type | Description |
|---|---|---|
assistant_id required | string | The ID of the assistant to use to execute this run. |
thread | object | Options to create a new thread. If no thread is provided when running a… |
model | string | The ID of the Model to be used to execute this run. If a value is provided… |
instructions | string | Override the default system message of the assistant. This is useful for… |
tools | array | Override the tools the assistant can use for this run. This is useful for… |
tool_resources | object | A set of resources that are used by the assistant's tools. The resources are… |
metadata | object | Set of 16 key-value pairs that can be attached to an object. This can be… |
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… |
stream | boolean | If true, returns a stream of events that happen during the Run as server-sent… |
max_prompt_tokens | integer | The maximum number of prompt tokens that may be used over the course of the… |
max_completion_tokens | integer | The maximum number of completion tokens that may be used over the course of… |
truncation_strategy | object | Controls for how a thread will be truncated prior to the run. Use this to… |
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. |
response_format | object | Specifies the format that the model must output. Compatible with GPT-4o, GPT-4… |
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_thread_and_run",
"arguments": {
"assistant_id": "…"
}
}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 thread and run tool with assistant_id set to ….