The OpenAI connector lets your AI agent act in each user's OpenAI account. Each user connects their own OpenAI access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 62 tools.
- Tools
- 62
- What they doRead · write · destructive
- 37 · 25 · 037 read25 write0 destructive
- Users sign in with
- Access token
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the OpenAI connection
In AgentKit > Connections, create an OpenAI connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'openai'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize OpenAI:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'openai_batch_list',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "openai"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize OpenAI:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="openai_batch_list",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their OpenAI credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolopenai_batch_getGet one batch job by ID.Read-onlyGet Batch
Get one batch job by ID. Returns the batch's status (validating, in_progress, finalizing, completed, failed, expired, cancelling or cancelled), request_counts, input, output and error file IDs, errors and timestamps. Use this to poll a batch until it completes, then read its results with openai_file_content_get on output_file_id. Use openai_batch_list to find a batch ID.
Inputs
batch_idstringrequired- ID of the batch. Get it from openai_batch_list or openai_batch_create. Example: batch_abc123.
openai_batch_listList batch jobs in the OpenAI project, newest first.Read-onlyList Batches
List batch jobs in the OpenAI project, newest first. Returns a page of batch objects with id, endpoint, status, input_file_id, output_file_id, error_file_id, request_counts and timestamps, plus first_id, last_id and has_more. Use this to find a batch or review batch progress. Use openai_batch_get for one known batch.
Inputs
afterstring- Pagination cursor: the ID of the last batch on the previous page (the last_id value of the previous response). Returns the batchs that come after it. Leave empty to start from the first page. Example: batch_abc123.
limitinteger- Maximum number of batches to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
openai_chat_completion_getGet one stored Chat Completion by ID.Read-onlyGet Stored Chat Completion
Get one stored Chat Completion by ID. Returns the completion with id, model, created, choices (each with the assistant message and finish_reason), usage and metadata. Use this to review a completion's output. Only completions created with store set to true can be fetched; use openai_chat_completion_list to find IDs.
Inputs
completion_idstringrequired- ID of the stored chat completion. Get it from openai_chat_completion_list. Example: chatcmpl-abc123.
openai_chat_completion_listList Chat Completions that were stored with store set to true, optionally only those from one model.Read-onlyList Stored Chat Completions
List Chat Completions that were stored with store set to true, optionally only those from one model. Returns a page of chat completions with id, model, created, choices, usage and metadata, plus first_id, last_id and has_more. Use this to review or audit past completions. Use openai_chat_completion_get for one completion and openai_chat_completion_message_list for its messages.
Inputs
afterstring- Pagination cursor: the ID of the last chat completion on the previous page (the last_id value of the previous response). Returns the chat completions that come after it. Leave empty to start from the first page. Example: chatcmpl-abc123.
limitinteger- Maximum number of chat completions to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
modelstring- Only return completions generated by this model. Example: gpt-4o-mini.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (asc). Example: desc.one of
ascdesc
openai_chat_completion_message_listList the input messages of a stored Chat Completion.Read-onlyList Stored Chat Completion Messages
List the input messages of a stored Chat Completion. Returns a page of messages with id, role and content, plus first_id, last_id and has_more. Use this to see the prompt behind a stored completion. Use openai_chat_completion_get for its output.
Inputs
completion_idstringrequired- ID of the stored chat completion. Get it from openai_chat_completion_list. Example: chatcmpl-abc123.
afterstring- Pagination cursor: the ID of the last message on the previous page (the last_id value of the previous response). Returns the messages that come after it. Leave empty to start from the first page. Example: chatcmpl-abc123-0.
limitinteger- Maximum number of messages to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (asc). Example: desc.one of
ascdesc
openai_container_file_content_getDownload the raw contents of one file in a code interpreter container.Read-onlyGet Container File Content
Download the raw contents of one file in a code interpreter container. Returns the file body as stored, such as CSV, text or image bytes. Use this to retrieve output a code interpreter run wrote, such as a chart or CSV. Use openai_container_file_get for the file's metadata only.
Inputs
container_idstringrequired- ID of the container. Get it from openai_container_list. Example: cntr_682e30645a488191b6363a0cbefc0f0a.
file_idstringrequired- ID of the container file. Get it from openai_container_file_list. Example: cfile_682e0e8a43c88191a7978f477a09bdf5.
openai_container_file_getGet the metadata of one file in a code interpreter container.Read-onlyGet Container File
Get the metadata of one file in a code interpreter container. Returns its id, container_id, path, bytes, source and created_at. Use this to check a file's path and size. Use openai_container_file_content_get to download its contents.
Inputs
container_idstringrequired- ID of the container. Get it from openai_container_list. Example: cntr_682e30645a488191b6363a0cbefc0f0a.
file_idstringrequired- ID of the container file. Get it from openai_container_file_list. Example: cfile_682e0e8a43c88191a7978f477a09bdf5.
openai_container_file_listList the files in a code interpreter container, including files the code created.Read-onlyList Container Files
List the files in a code interpreter container, including files the code created. Returns a page of container files with id, path, bytes, source and created_at, plus first_id, last_id and has_more. Use this to find files a code interpreter run produced. Use openai_container_file_content_get to download one.
Inputs
container_idstringrequired- ID of the container. Get it from openai_container_list. Example: cntr_682e30645a488191b6363a0cbefc0f0a.
afterstring- Pagination cursor: the ID of the last container file on the previous page (the last_id value of the previous response). Returns the container files that come after it. Leave empty to start from the first page. Example: cfile_682e0e8a43c88191a7978f477a09bdf5.
limitinteger- Maximum number of files to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (desc). Example: desc.one of
ascdesc
openai_container_getGet one code interpreter container by ID.Read-onlyGet Container
Get one code interpreter container by ID. Returns its id, name, status, memory_limit, expires_after, last_active_at and created_at. Use this to check whether a container is still running or has expired. Use openai_container_file_list for the files inside it.
Inputs
container_idstringrequired- ID of the container. Get it from openai_container_list. Example: cntr_682e30645a488191b6363a0cbefc0f0a.
openai_container_listList code interpreter containers in the OpenAI project, optionally by name.Read-onlyList Containers
List code interpreter containers in the OpenAI project, optionally by name. Returns a page of containers with id, name, status, memory_limit, expires_after, last_active_at and created_at, plus first_id, last_id and has_more. Use this to find a container ID. Use openai_container_get for one container and openai_container_file_list for its files.
Inputs
afterstring- Pagination cursor: the ID of the last container on the previous page (the last_id value of the previous response). Returns the containers that come after it. Leave empty to start from the first page. Example: cntr_682e30645a488191b6363a0cbefc0f0a.
limitinteger- Maximum number of containers to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
namestring- Only return containers with this name. Example: data-analysis.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (desc). Example: desc.one of
ascdesc
openai_conversation_getGet one conversation by ID.Read-onlyGet Conversation
Get one conversation by ID. Returns the conversation's id, created_at and metadata, without its items. Use this to check that a conversation exists or read its metadata. Use openai_conversation_item_list to read its messages.
Inputs
conversation_idstringrequired- ID of the conversation. Get it from openai_conversation_create or a response's conversation field. Example: conv_123.
openai_conversation_item_getGet one item from a conversation.Read-onlyGet Conversation Item
Get one item from a conversation. Returns the item with its id, type, status and type-specific fields, such as role and content for a message. Use this to read a single message or tool call. Use openai_conversation_item_list to find item IDs.
Inputs
conversation_idstringrequired- ID of the conversation. Get it from openai_conversation_create. Example: conv_123.
item_idstringrequired- ID of the item. Get it from openai_conversation_item_list. Example: msg_abc123.
openai_conversation_item_listList the items in a conversation, such as user and assistant messages, tool calls and tool outputs.Read-onlyList Conversation Items
List the items in a conversation, such as user and assistant messages, tool calls and tool outputs. Returns a page of items with id, type, role, status and content, plus first_id, last_id and has_more. Use this to read a conversation's history. Use openai_conversation_item_get for one item.
Inputs
conversation_idstringrequired- ID of the conversation. Get it from openai_conversation_create. Example: conv_123.
afterstring- Pagination cursor: the ID of the last item on the previous page (the last_id value of the previous response). Returns the items that come after it. Leave empty to start from the first page. Example: msg_abc123.
limitinteger- Maximum number of items to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (desc). Example: desc.one of
ascdesc
openai_eval_getGet one eval by ID.Read-onlyGet Eval
Get one eval by ID. Returns its id, name, data_source_config (the item schema), testing_criteria (graders), metadata and created_at. Use this to read an eval's graders before starting a run with openai_eval_run_create. Use openai_eval_list to find an eval ID.
Inputs
eval_idstringrequired- ID of the eval. Get it from openai_eval_list. Example: eval_67abd54d9b0081909a86353f6fb9317a.
openai_eval_listList evals in the OpenAI project.Read-onlyList Evals
List evals in the OpenAI project. Returns a page of evals with id, name, data_source_config, testing_criteria, metadata and created_at, plus first_id, last_id and has_more. Use this to find an eval ID. Use openai_eval_get for one eval and openai_eval_run_list for its runs.
Inputs
afterstring- Pagination cursor: the ID of the last eval on the previous page (the last_id value of the previous response). Returns the evals that come after it. Leave empty to start from the first page. Example: eval_67abd54d9b0081909a86353f6fb9317a.
limitinteger- Maximum number of evals to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (asc). Example: desc.one of
ascdesc order_bystring- Field to sort by: created_at or updated_at. Leave empty for the default (created_at). Example: updated_at.one of
created_atupdated_at
openai_eval_run_getGet one eval run by ID.Read-onlyGet Eval Run
Get one eval run by ID. Returns its status, model, data_source, result_counts (passed, failed, errored, total), per_model_usage, per_testing_criteria_results, report_url and error. Use this to poll a run and read its scores. Use openai_eval_run_output_item_list for per-item results.
Inputs
eval_idstringrequired- ID of the eval. Get it from openai_eval_list. Example: eval_67abd54d9b0081909a86353f6fb9317a.
run_idstringrequired- ID of the eval run. Get it from openai_eval_run_list. Example: evalrun_67abd54d60ec8190832b46859da808f7.
openai_eval_run_listList the runs of one eval, optionally only those with one status.Read-onlyList Eval Runs
List the runs of one eval, optionally only those with one status. Returns a page of runs with id, name, status, model, data_source, result_counts, per_testing_criteria_results, report_url and created_at, plus first_id, last_id and has_more. Use this to compare runs across models. Use openai_eval_run_get for one run.
Inputs
eval_idstringrequired- ID of the eval. Get it from openai_eval_list. Example: eval_67abd54d9b0081909a86353f6fb9317a.
afterstring- Pagination cursor: the ID of the last run on the previous page (the last_id value of the previous response). Returns the runs that come after it. Leave empty to start from the first page. Example: evalrun_67abd54d60ec8190832b46859da808f7.
limitinteger- Maximum number of runs to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (asc). Example: desc.one of
ascdesc statusstring- Only return runs with this status: queued, in_progress, completed, canceled or failed. Leave empty for all runs. Example: completed.one of
queuedin_progresscompletedcanceledfailed
openai_eval_run_output_item_getGet one graded item from an eval run.Read-onlyGet Eval Run Output Item
Get one graded item from an eval run. Returns the item's datasource_item, sample (model input, output and usage), results per grader and status. Use this to debug a single failing test case. Use openai_eval_run_output_item_list to find item IDs.
Inputs
eval_idstringrequired- ID of the eval. Get it from openai_eval_list. Example: eval_67abd54d9b0081909a86353f6fb9317a.
output_item_idstringrequired- ID of the output item. Get it from openai_eval_run_output_item_list. Example: outputitem_67abd55eb6548190bb580745d5644a33.
run_idstringrequired- ID of the eval run. Get it from openai_eval_run_list. Example: evalrun_67abd54d60ec8190832b46859da808f7.
openai_eval_run_output_item_listList the graded items of an eval run, optionally only passing or failing ones.Read-onlyList Eval Run Output Items
List the graded items of an eval run, optionally only passing or failing ones. Returns a page of output items with id, datasource_item, sample (the model input and output), results per grader and status, plus first_id, last_id and has_more. Use this to inspect which test items failed and why. Use openai_eval_run_get for the run's summary scores.
Inputs
eval_idstringrequired- ID of the eval. Get it from openai_eval_list. Example: eval_67abd54d9b0081909a86353f6fb9317a.
run_idstringrequired- ID of the eval run. Get it from openai_eval_run_list. Example: evalrun_67abd54d60ec8190832b46859da808f7.
afterstring- Pagination cursor: the ID of the last output item on the previous page (the last_id value of the previous response). Returns the output items that come after it. Leave empty to start from the first page. Example: outputitem_67abd55eb6548190bb580745d5644a33.
limitinteger- Maximum number of output items to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (asc). Example: desc.one of
ascdesc statusstring- Only return items that passed (pass) or failed (fail). Leave empty for all items. Example: fail.one of
failpass
openai_file_content_getDownload the raw contents of one uploaded or generated file.Read-onlyGet File Content
Download the raw contents of one uploaded or generated file. Returns the file body as stored: JSONL for batch input, batch output and fine-tuning files, or the original text or bytes for other files. Use this to read batch results (the batch's output_file_id or error_file_id) or fine-tuning result files. Use openai_file_get for the file's metadata only.
Inputs
file_idstringrequired- ID of the file. Get it from openai_file_list, or a batch's output_file_id or error_file_id. Example: file-abc123.
openai_file_getGet the metadata of one uploaded file by ID.Read-onlyGet File
Get the metadata of one uploaded file by ID. Returns the file's id, filename, bytes, purpose, created_at, expires_at and status details. Use this to check a file's purpose or size. Use openai_file_content_get to read its contents and openai_file_list to find a file ID.
Inputs
file_idstringrequired- ID of the file. Get it from openai_file_list. Example: file-abc123.
openai_file_listList files uploaded to the OpenAI project, optionally only those with one purpose.Read-onlyList Files
List files uploaded to the OpenAI project, optionally only those with one purpose. Returns a page of file objects with id, filename, bytes, purpose, created_at and expires_at, plus first_id, last_id and has_more. Use this to find a file ID for a batch, fine-tuning job or vector store. Use openai_file_get for one known file and openai_file_content_get for its contents.
Inputs
afterstring- Pagination cursor: the ID of the last file on the previous page (the last_id value of the previous response). Returns the files that come after it. Leave empty to start from the first page. Example: file-abc123.
limitinteger- Maximum number of files to return in one page, from 1 to 10000. Leave empty to use the OpenAI default of 10,000. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (desc). Example: desc.one of
ascdesc purposestring- Only return files with this purpose, such as assistants, batch, batch_output, fine-tune, fine-tune-results, vision, user_data or evals. Leave empty for all files. Example: batch.
openai_fine_tuning_job_checkpoint_listList the checkpoints saved during a fine-tuning job.Read-onlyList Fine-Tuning Job Checkpoints
List the checkpoints saved during a fine-tuning job. Returns a page of checkpoints with id, fine_tuned_model_checkpoint (a usable model name), step_number, metrics and created_at, plus first_id, last_id and has_more. Use this to pick an earlier checkpoint model when the final model overfits. Use openai_fine_tuning_job_get for the final model.
Inputs
fine_tuning_job_idstringrequired- ID of the fine-tuning job. Get it from openai_fine_tuning_job_list. Example: ftjob-abc123.
afterstring- Pagination cursor: the ID of the last checkpoint on the previous page (the id of the last checkpoint value of the previous response). Returns the checkpoints that come after it. Leave empty to start from the first page. Example: ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB.
limitinteger- Maximum number of checkpoints to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 10. Example: 20.
openai_fine_tuning_job_event_listList the status events of a fine-tuning job, such as validation, step progress, metrics and completion messages.Read-onlyList Fine-Tuning Job Events
List the status events of a fine-tuning job, such as validation, step progress, metrics and completion messages. Returns a page of events with id, created_at, level, message, type and data, plus has_more. Use this to follow training progress or see why a job failed. Use openai_fine_tuning_job_get for the job's overall status.
Inputs
fine_tuning_job_idstringrequired- ID of the fine-tuning job. Get it from openai_fine_tuning_job_list. Example: ftjob-abc123.
afterstring- Pagination cursor: the ID of the last event on the previous page (the id of the last event value of the previous response). Returns the events that come after it. Leave empty to start from the first page. Example: ftevent-abc123.
limitinteger- Maximum number of events to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
openai_fine_tuning_job_getGet one fine-tuning job by ID.Read-onlyGet Fine-Tuning Job
Get one fine-tuning job by ID. Returns its status (validating_files, queued, running, succeeded, failed or cancelled), base model, fine_tuned_model once finished, method and hyperparameters, result_files, trained_tokens, error and estimated_finish. Use this to poll a job and get the resulting model name. Use openai_fine_tuning_job_event_list for its progress log.
Inputs
fine_tuning_job_idstringrequired- ID of the fine-tuning job. Get it from openai_fine_tuning_job_list. Example: ftjob-abc123.
openai_fine_tuning_job_listList fine-tuning jobs in the OpenAI project.Read-onlyList Fine-Tuning Jobs
List fine-tuning jobs in the OpenAI project. Returns a page of jobs with id, model, fine_tuned_model, status, training and validation file IDs, method, trained_tokens and timestamps, plus has_more. Use this to find a job ID or review training history. Use openai_fine_tuning_job_get for one known job.
Inputs
afterstring- Pagination cursor: the ID of the last fine-tuning job on the previous page (the id of the last job value of the previous response). Returns the fine-tuning jobs that come after it. Leave empty to start from the first page. Example: ftjob-abc123.
limitinteger- Maximum number of jobs to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
openai_model_getGet one model by ID, such as a base model or a fine-tuned model.Read-onlyGet Model
Get one model by ID, such as a base model or a fine-tuned model. Returns the model's id, object, created (Unix seconds) and owned_by. Use this to check that a model ID exists and who owns it. Use openai_model_list to browse all available models.
Inputs
modelstringrequired- ID of the model to retrieve, such as a base model name or a fine-tuned model name. Get IDs from openai_model_list. Example: gpt-4o-mini or ft:gpt-4o-mini:my-org:custom-suffix:7p4lURel.
openai_model_listList the models available to this API key, including OpenAI base models and the project's fine-tuned models.Read-onlyList Models
List the models available to this API key, including OpenAI base models and the project's fine-tuned models. Returns a list of model objects with id, object, created (Unix seconds) and owned_by. Use this to find valid model IDs for batches, fine-tuning jobs or evals. Use openai_model_get for one known model.
Inputs
This tool takes no inputs.
openai_response_getGet a stored model response by ID.Read-onlyGet Response
Get a stored model response by ID. Returns the response's status, model, output items (messages, tool calls and reasoning), output_text, usage, error and settings such as instructions and tools. Use this to fetch the result of a background response or review a past one. Use openai_response_input_item_list for the inputs that produced it.
Inputs
response_idstringrequired- ID of the response. Get it from the id of a response created with the Responses API. Example: resp_123.
openai_response_input_item_listList the input items that were sent to produce a stored response.Read-onlyList Response Input Items
List the input items that were sent to produce a stored response. Returns a page of items with id, type, role and content, plus first_id, last_id and has_more. Use this to see the prompt behind a response. Use openai_response_get for the response's output.
Inputs
response_idstringrequired- ID of the response. Get it from the id of a response created with the Responses API. Example: resp_123.
afterstring- Pagination cursor: the ID of the last item on the previous page (the last_id value of the previous response). Returns the items that come after it. Leave empty to start from the first page. Example: msg_abc123.
limitinteger- Maximum number of items to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (desc). Example: desc.one of
ascdesc
openai_vector_store_file_batch_file_listList the files in one vector store file batch, optionally only those with one processing status.Read-onlyList Vector Store File Batch Files
List the files in one vector store file batch, optionally only those with one processing status. Returns a page of vector store files with id, status, usage_bytes and last_error, plus first_id, last_id and has_more. Use this to find which files in a batch failed. Use openai_vector_store_file_list for every file in the store.
Inputs
batch_idstringrequired- ID of the file batch. Get it from openai_vector_store_file_batch_create. Example: vsfb_abc123.
vector_store_idstringrequired- ID of the vector store. Get it from openai_vector_store_list. Example: vs_abc123.
afterstring- Pagination cursor: the ID of the last file on the previous page (the last_id value of the previous response). Returns the files that come after it. Leave empty to start from the first page. Example: file-abc123.
beforestring- Pagination cursor for paging backwards: the ID of the first file on the current page (the first_id value of the response). Returns the files that come before it. Example: file-abc123.
filterstring- Only return files with this processing status: in_progress, completed, failed or cancelled. Leave empty for all files. Example: failed.one of
in_progresscompletedfailedcancelled limitinteger- Maximum number of files to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (desc). Example: desc.one of
ascdesc
openai_vector_store_file_batch_getGet one vector store file batch by ID.Read-onlyGet Vector Store File Batch
Get one vector store file batch by ID. Returns the batch's status (in_progress, completed, cancelled or failed) and file_counts by status. Use this to poll a batch until indexing finishes. Use openai_vector_store_file_batch_file_list to see each file in it.
Inputs
batch_idstringrequired- ID of the file batch. Get it from openai_vector_store_file_batch_create. Example: vsfb_abc123.
vector_store_idstringrequired- ID of the vector store. Get it from openai_vector_store_list. Example: vs_abc123.
openai_vector_store_file_content_getGet the parsed text of a file in a vector store.Read-onlyGet Vector Store File Content
Get the parsed text of a file in a vector store. Returns a list of content parts, each with type text and the extracted text. Use this to read what OpenAI extracted from a file for search. Use openai_vector_store_search to find relevant passages across files.
Inputs
file_idstringrequired- ID of the file in the vector store. Get it from openai_vector_store_file_list. Example: file-abc123.
vector_store_idstringrequired- ID of the vector store. Get it from openai_vector_store_list. Example: vs_abc123.
openai_vector_store_file_getGet one file's processing record in a vector store.Read-onlyGet Vector Store File
Get one file's processing record in a vector store. Returns its id, status (in_progress, completed, cancelled or failed), usage_bytes, last_error, chunking_strategy and attributes. Use this to check whether a file finished indexing and why it failed. Use openai_vector_store_file_content_get for its parsed text.
Inputs
file_idstringrequired- ID of the file in the vector store. Get it from openai_vector_store_file_list. Example: file-abc123.
vector_store_idstringrequired- ID of the vector store. Get it from openai_vector_store_list. Example: vs_abc123.
openai_vector_store_file_listList the files attached to a vector store, optionally only those with one processing status.Read-onlyList Vector Store Files
List the files attached to a vector store, optionally only those with one processing status. Returns a page of vector store files with id (the file ID), status, usage_bytes, last_error, chunking_strategy and attributes, plus first_id, last_id and has_more. Use this to see which files are indexed or failed. Use openai_vector_store_file_get for one file.
Inputs
vector_store_idstringrequired- ID of the vector store. Get it from openai_vector_store_list. Example: vs_abc123.
afterstring- Pagination cursor: the ID of the last file on the previous page (the last_id value of the previous response). Returns the files that come after it. Leave empty to start from the first page. Example: file-abc123.
beforestring- Pagination cursor for paging backwards: the ID of the first file on the current page (the first_id value of the response). Returns the files that come before it. Example: file-abc123.
filterstring- Only return files with this processing status: in_progress, completed, failed or cancelled. Leave empty for all files. Example: failed.one of
in_progresscompletedfailedcancelled limitinteger- Maximum number of files to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (desc). Example: desc.one of
ascdesc
openai_vector_store_getGet one vector store by ID.Read-onlyGet Vector Store
Get one vector store by ID. Returns its id, name, status (expired, in_progress or completed), usage_bytes, file_counts by status, expires_after, expires_at, last_active_at and metadata. Use this to check whether a store has finished indexing its files. Use openai_vector_store_list to find a store ID.
Inputs
vector_store_idstringrequired- ID of the vector store. Get it from openai_vector_store_list. Example: vs_abc123.
openai_vector_store_listList vector stores in the OpenAI project.Read-onlyList Vector Stores
List vector stores in the OpenAI project. Returns a page of vector stores with id, name, status, usage_bytes, file_counts, expiry settings, metadata and timestamps, plus first_id, last_id and has_more. Use this to find a vector store ID. Use openai_vector_store_get for one known store and openai_vector_store_search to search its contents.
Inputs
afterstring- Pagination cursor: the ID of the last vector store on the previous page (the last_id value of the previous response). Returns the vector stores that come after it. Leave empty to start from the first page. Example: vs_abc123.
beforestring- Pagination cursor for paging backwards: the ID of the first vector store on the current page (the first_id value of the response). Returns the vector stores that come before it. Example: vs_abc123.
limitinteger- Maximum number of vector stores to return in one page, from 1 to 100. Leave empty to use the OpenAI default of 20. Example: 20.
orderstring- Sort order by created_at: asc for oldest first, desc for newest first. Leave empty for the OpenAI default (desc). Example: desc.one of
ascdesc
openai_batch_cancelCancel an in-progress batch job.WriteCancel Batch
Cancel an in-progress batch job. Returns the batch with status cancelling; it moves to cancelled within about 10 minutes, and any partial results stay in its output file. Use this to stop a batch that is no longer needed. Use openai_batch_get to watch it reach cancelled.
Inputs
batch_idstringrequired- ID of the batch to cancel. Get it from openai_batch_list. Example: batch_abc123.
openai_batch_createCreate and start a batch job that runs every request in an uploaded JSONL file against one endpoint within 24 hours.WriteCreate Batch
Create and start a batch job that runs every request in an uploaded JSONL file against one endpoint within 24 hours. Returns the new batch with its id, status (validating at first), endpoint, input_file_id and timestamps. Use this for large asynchronous workloads at batch pricing. The input file must already be uploaded with purpose batch; track the job with openai_batch_get.
Inputs
completion_windowstringrequired- Time frame in which the batch must be processed. Only 24h is supported. Example: 24h.one of
24h endpointstringrequired- The API endpoint every request in the batch is sent to. One of /v1/responses, /v1/chat/completions, /v1/embeddings, /v1/completions, /v1/moderations, /v1/images/generations, /v1/images/edits or /v1/videos. Example: /v1/chat/completions.one of
/v1/responses/v1/chat/completions/v1/embeddings/v1/completions/v1/moderations/v1/images/generations/v1/images/edits/v1/videos input_file_idstringrequired- ID of an uploaded JSONL file with purpose batch that holds the requests. Each line is one request with a custom_id, method, url and body, and every line must target the same endpoint. The file can hold up to 50,000 requests and be up to 200 MB. Example: file-abc123.
metadataobject- Up to 16 key-value pairs to attach to the batch, for storing your own structured information. Keys are strings of up to 64 characters and values are strings of up to 512 characters. Example: {"team": "support", "env": "prod"}.
output_expires_after_secondsinteger- How long the generated output and error files are kept, in seconds after they are created, from 3600 (1 hour) to 2592000 (30 days). Leave empty to keep the default retention. Example: 86400.
openai_chat_completion_updateReplace the metadata on a stored Chat Completion; metadata is the only field that can be changed.WriteUpdate Stored Chat Completion
Replace the metadata on a stored Chat Completion; metadata is the only field that can be changed. Returns the updated chat completion. Use this to tag completions for later filtering or review. Only completions created with store set to true can be updated.
- Idempotent
Inputs
completion_idstringrequired- ID of the stored chat completion. Get it from openai_chat_completion_list. Example: chatcmpl-abc123.
metadataobjectrequired- The full set of metadata to store on the completion, replacing the existing metadata: up to 16 key-value pairs, with keys up to 64 characters and string values up to 512 characters. Example: {"reviewed": "true"}.
openai_container_createCreate a code interpreter container, optionally copying uploaded files into it.WriteCreate Container
Create a code interpreter container, optionally copying uploaded files into it. Returns the new container with its id, name, status, memory_limit and expires_after. Use this to prepare a sandbox that the code interpreter tool can use. Use openai_container_file_create to add more files later.
Inputs
namestringrequired- Name of the container. Example: data-analysis.
expires_after_minutesinteger- Expire the container this many minutes after it was last active. Leave empty for OpenAI's default. Example: 20.
file_idsarray- IDs of uploaded files to copy into the container. Get IDs from openai_file_list. Example: ["file-abc123"].
memory_limitstring- Memory limit for the container: 1g, 4g, 16g or 64g. Leave empty for the default (1g). Example: 4g.one of
1g4g16g64g
openai_container_file_createCopy an uploaded file into a code interpreter container.WriteAdd File to Container
Copy an uploaded file into a code interpreter container. Returns the container file with its id, path, bytes and source. Use this to give the code interpreter access to a file after the container exists. Use openai_container_create with file_ids to add files at creation.
Inputs
container_idstringrequired- ID of the container. Get it from openai_container_list. Example: cntr_682e30645a488191b6363a0cbefc0f0a.
file_idstringrequired- ID of an uploaded file to copy into the container. Get IDs from openai_file_list. Example: file-abc123.
openai_conversation_createCreate a conversation that stores Responses API items so later responses can continue from it.WriteCreate Conversation
Create a conversation that stores Responses API items so later responses can continue from it. Returns the conversation with its id, created_at and metadata. Use this to start a persistent thread, optionally seeded with up to 20 items. Use openai_conversation_item_create to add items later.
Inputs
itemsarray- Up to 20 items to put in the conversation when it is created. Each item is usually a message object with a role (user, assistant, system or developer) and content, which can be a plain string or a list of content parts such as {"type": "input_text", "text": "..."}. Other Responses API item types, such as function_call_output, are also accepted. Example: [{"type": "message", "role": "user", "content": "Hello!"}].
metadataobject- Up to 16 key-value pairs to attach to the conversation, for storing your own structured information. Keys are strings of up to 64 characters and values are strings of up to 512 characters. Example: {"team": "support", "env": "prod"}.
openai_conversation_item_createAdd up to 20 items, such as messages, to an existing conversation.WriteAdd Conversation Items
Add up to 20 items, such as messages, to an existing conversation. Returns the list of created items with their ids, plus first_id, last_id and has_more. Use this to append context to a conversation without generating a model response. Use openai_conversation_item_list to read the result.
Inputs
conversation_idstringrequired- ID of the conversation. Get it from openai_conversation_create. Example: conv_123.
itemsarrayrequired- The items to add, at most 20. Each item is usually a message object with a role (user, assistant, system or developer) and content, which can be a plain string or a list of content parts such as {"type": "input_text", "text": "..."}. Other Responses API item types, such as function_call_output, are also accepted. Example: [{"type": "message", "role": "user", "content": [{"type": "input_text", "text": "Hello!"}]}].
openai_conversation_updateReplace the metadata on a conversation.WriteUpdate Conversation
Replace the metadata on a conversation. Returns the updated conversation with its id, created_at and metadata. Use this to relabel a conversation. Use openai_conversation_item_create to add messages instead.
- Idempotent
Inputs
conversation_idstringrequired- ID of the conversation to update. Get it from openai_conversation_create. Example: conv_123.
metadataobjectrequired- The full set of metadata to store on the conversation, replacing the existing metadata: up to 16 key-value pairs, with keys up to 64 characters and string values up to 512 characters. Example: {"topic": "billing"}.
openai_eval_createCreate an eval: a data source configuration that defines the test items, plus the graders that score model output.WriteCreate Eval
Create an eval: a data source configuration that defines the test items, plus the graders that score model output. Returns the new eval with its id, name, data_source_config, testing_criteria and created_at. Use this to set up a reusable test suite, then run it against models with openai_eval_run_create.
Inputs
data_source_configobjectrequired- Describes the data the eval runs on. Use type custom with an item_schema (a JSON Schema for each test item) and optionally include_sample_schema true when graders need the model's output; type logs to use stored Responses or Chat Completions logs; or type stored_completions. Example: {"type": "custom", "item_schema": {"type": "object", "properties": {"input": {"type": "string"}, "label": {"type": "string"}}, "required": ["input", "label"]}, "include_sample_schema": true}.
testing_criteriaarrayrequired- The graders that score each item. Grader types are label_model, string_check, text_similarity, python and score_model. Graders reference item fields as {{item.field}} and the model's output as {{sample.output_text}}. Example: [{"type": "string_check", "name": "Matches label", "input": "{{sample.output_text}}", "reference": "{{item.label}}", "operation": "eq"}].
metadataobject- Up to 16 key-value pairs to attach to the eval, for storing your own structured information. Keys are strings of up to 64 characters and values are strings of up to 512 characters. Example: {"team": "support", "env": "prod"}.
namestring- Name of the eval. Example: Sentiment classification.
openai_eval_run_cancelCancel an eval run that is queued or in progress.WriteCancel Eval Run
Cancel an eval run that is queued or in progress. Returns the run with its updated status. Use this to stop a run that is no longer needed. Use openai_eval_run_get to confirm it was canceled.
Inputs
eval_idstringrequired- ID of the eval. Get it from openai_eval_list. Example: eval_67abd54d9b0081909a86353f6fb9317a.
run_idstringrequired- ID of the eval run to cancel. Get it from openai_eval_run_list. Example: evalrun_67abd54d60ec8190832b46859da808f7.
openai_eval_run_createStart a run of an eval on a data source, optionally generating model outputs to grade.WriteCreate Eval Run
Start a run of an eval on a data source, optionally generating model outputs to grade. Returns the new run with its id, status (queued at first), data_source and report_url. Use this to test a model or prompt against an eval created with openai_eval_create. Track the run with openai_eval_run_get.
Inputs
data_sourceobjectrequired- The run's data and model settings. Use type jsonl with a source of inline content or a file_id to grade existing outputs; type completions to generate outputs with the Chat Completions API from an input_messages template and a model; or type responses to generate them with the Responses API. The data must match the eval's item schema. Example: {"type": "completions", "model": "gpt-4o-mini", "input_messages": {"type": "template", "template": [{"role": "user", "content": "{{item.input}}"}]}, "source": {"type": "file_id", "id": "file-abc123"}}.
eval_idstringrequired- ID of the eval to run. Get it from openai_eval_list. Example: eval_67abd54d9b0081909a86353f6fb9317a.
metadataobject- Up to 16 key-value pairs to attach to the eval run, for storing your own structured information. Keys are strings of up to 64 characters and values are strings of up to 512 characters. Example: {"team": "support", "env": "prod"}.
namestring- Name of the run. Example: gpt-4o-mini baseline.
openai_eval_updateRename an eval or replace its metadata.WriteUpdate Eval
Rename an eval or replace its metadata. Returns the updated eval. Use this to keep evals organized. Graders and data source cannot be changed; create a new eval with openai_eval_create for that.
- Idempotent
Inputs
eval_idstringrequired- ID of the eval to update. Get it from openai_eval_list. Example: eval_67abd54d9b0081909a86353f6fb9317a.
metadataobject- Up to 16 key-value pairs to attach to the eval, for storing your own structured information. Keys are strings of up to 64 characters and values are strings of up to 512 characters. Example: {"team": "support", "env": "prod"}.
namestring- New name for the eval. Leave empty to keep the current name. Example: Sentiment classification v2.
openai_fine_tuning_job_cancelCancel a fine-tuning job.WriteCancel Fine-Tuning Job
Cancel a fine-tuning job. Returns the job with status cancelled. Use this to stop a job that is queued or running. A cancelled job cannot be resumed; use openai_fine_tuning_job_pause to stop temporarily.
Inputs
fine_tuning_job_idstringrequired- ID of the fine-tuning job to cancel. Get it from openai_fine_tuning_job_list. Example: ftjob-abc123.
openai_fine_tuning_job_createStart a fine-tuning job that trains a new model from a base model and an uploaded JSONL training file.WriteCreate Fine-Tuning Job
Start a fine-tuning job that trains a new model from a base model and an uploaded JSONL training file. Returns the enqueued job with its id, status, model, training_file and method; the fine-tuned model name appears on the job once it succeeds. Use this to customize a model. The training file must already be uploaded with purpose fine-tune; track the job with openai_fine_tuning_job_get.
Inputs
modelstringrequired- Name of the model to fine-tune. It must be a model that supports fine-tuning for the chosen method, or an existing fine-tuned model to continue training. Example: gpt-4o-mini-2024-07-18.
training_filestringrequired- ID of an uploaded JSONL file with purpose fine-tune that holds the training examples, formatted for the chosen method (chat, preference or reinforcement format). Example: file-abc123.
integrationsarray- Integrations to enable for the job. Only Weights and Biases is supported: an object with type wandb and a wandb object holding the project name and optional entity, name and tags. Example: [{"type": "wandb", "wandb": {"project": "my-wandb-project"}}].
metadataobject- Up to 16 key-value pairs to attach to the fine-tuning job, for storing your own structured information. Keys are strings of up to 64 characters and values are strings of up to 512 characters. Example: {"team": "support", "env": "prod"}.
methodobject- Fine-tuning method and its hyperparameters. Set type to supervised, dpo or reinforcement, and put the hyperparameters (such as n_epochs, batch_size and learning_rate_multiplier) in the object named after that type; reinforcement also needs a grader. Leave empty for supervised fine-tuning with automatic hyperparameters. Example: {"type": "supervised", "supervised": {"hyperparameters": {"n_epochs": 3}}}.
seedinteger- Seed for reproducibility. The same seed and job parameters should give the same results, though they may differ in rare cases. Leave empty to have one generated. Example: 42.
suffixstring- Up to 64 characters added to the fine-tuned model's name. For example, the suffix custom-model-name gives a model name like ft:gpt-4o-mini:openai:custom-model-name:7p4lURel. Example: support-bot.
validation_filestring- ID of an uploaded JSONL file with purpose fine-tune used to compute validation metrics during training. It must not overlap the training file. Example: file-def456.
openai_fine_tuning_job_pausePause a fine-tuning job.WritePause Fine-Tuning Job
Pause a fine-tuning job. Returns the job with its updated status. Use this to stop a running job temporarily, for example to inspect checkpoints. Use openai_fine_tuning_job_resume to continue it.
Inputs
fine_tuning_job_idstringrequired- ID of the fine-tuning job to pause. Get it from openai_fine_tuning_job_list. Example: ftjob-abc123.
openai_fine_tuning_job_resumeResume a fine-tuning job.WriteResume Fine-Tuning Job
Resume a fine-tuning job. Returns the job with its updated status. Use this to continue a job paused with openai_fine_tuning_job_pause. Use openai_fine_tuning_job_get to follow its progress.
Inputs
fine_tuning_job_idstringrequired- ID of the fine-tuning job to resume. Get it from openai_fine_tuning_job_list. Example: ftjob-abc123.
openai_response_cancelCancel a model response that is still running in the background.WriteCancel Response
Cancel a model response that is still running in the background. Returns the response with status cancelled. Use this only for responses created with background set to true; other responses cannot be cancelled. Use openai_response_get to check a response's status first.
Inputs
response_idstringrequired- ID of the background response to cancel. Get it from the id of a background response. Example: resp_123.
openai_response_input_token_countCount the input tokens a Responses API request would use, without generating a response.WriteCount Response Input Tokens
Count the input tokens a Responses API request would use, without generating a response. Returns an object of type response.input_tokens with the input_tokens count. Use this to check a prompt against a model's context window or estimate cost before sending it. Provide input or input_items, or a previous_response_id or conversation_id to count existing context.
- Idempotent
Inputs
conversation_idstring- ID of a conversation whose items would be prepended to the input. Cannot be combined with previous_response_id. Example: conv_123.
inputstring- Plain-text input, counted as a single user message. Use input_items instead for structured input. Example: Summarize the attached report in three bullet points.
input_itemsarray- Structured input as a list of Responses API input items, used instead of input when set. Each item is usually a message object with a role (user, assistant, system or developer) and content, which can be a plain string or a list of content parts such as {"type": "input_text", "text": "..."}. Other Responses API item types, such as function_call_output, are also accepted. Example: [{"role": "system", "content": "You are terse."}, {"role": "user", "content": "Hi"}].
instructionsstring- System or developer instructions that would be inserted into the model's context. Example: You are a helpful support assistant.
modelstring- Model the request would use, which decides how text is tokenized. Example: gpt-4o.
previous_response_idstring- ID of a previous response whose context would be carried over. Cannot be combined with conversation_id. Example: resp_123.
toolsarray- Tool definitions the request would include, since tool schemas also use input tokens. Example: [{"type": "function", "name": "get_weather", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}}}].
truncationstring- Truncation strategy: auto drops items from the start of the conversation to fit the context window; disabled fails if the input is too long. Example: auto.one of
autodisabled
openai_vector_store_createCreate a vector store for file search, optionally adding uploaded files to it straight away.WriteCreate Vector Store
Create a vector store for file search, optionally adding uploaded files to it straight away. Returns the new vector store with its id, name, status, file_counts and expiry settings. Use this to set up a searchable knowledge base. Use openai_vector_store_file_create or openai_vector_store_file_batch_create to add files later.
Inputs
chunking_strategyobject- How files are split into chunks before embedding. Use {"type": "auto"} (the default when left empty), or a static strategy that sets the maximum chunk size (100 to 4096 tokens) and the overlap between chunks (no more than half the chunk size). Example: {"type": "static", "static": {"max_chunk_size_tokens": 800, "chunk_overlap_tokens": 400}}.
descriptionstring- Description of the vector store's purpose. Example: Help-center articles used by the support agent.
expires_after_daysinteger- Expire the vector store this many days after it was last active, from 1 to 365. Leave empty so it never expires. Example: 7.
file_idsarray- IDs of uploaded files to add to the vector store. Get IDs from openai_file_list. Example: ["file-abc123", "file-def456"].
metadataobject- Up to 16 key-value pairs to attach to the vector store, for storing your own structured information. Keys are strings of up to 64 characters and values are strings of up to 512 characters. Example: {"team": "support", "env": "prod"}.
namestring- Name of the vector store. Example: Support knowledge base.
openai_vector_store_file_batch_cancelCancel a vector store file batch, stopping the processing of its remaining files as soon as possible.WriteCancel Vector Store File Batch
Cancel a vector store file batch, stopping the processing of its remaining files as soon as possible. Returns the file batch with its updated status and file_counts. Use this to stop indexing files that are no longer wanted. Files already processed stay in the vector store.
Inputs
batch_idstringrequired- ID of the file batch to cancel. Get it from openai_vector_store_file_batch_create. Example: vsfb_abc123.
vector_store_idstringrequired- ID of the vector store. Get it from openai_vector_store_list. Example: vs_abc123.
openai_vector_store_file_batch_createAdd many uploaded files to a vector store in one batch.WriteCreate Vector Store File Batch
Add many uploaded files to a vector store in one batch. Returns the file batch with its id, status (in_progress at first) and file_counts. Use this to index several files at once. Use openai_vector_store_file_batch_get to track the batch, or openai_vector_store_file_create for a single file. Provide either file_ids or files, not both.
Inputs
vector_store_idstringrequired- ID of the vector store. Get it from openai_vector_store_list. Example: vs_abc123.
attributesobject- Up to 16 key-value pairs attached to the files, which file search can filter on. Keys are strings of up to 64 characters; values are strings (up to 512 characters), numbers or booleans. Example: {"author": "Jane Doe", "year": 2024, "public": true}.
chunking_strategyobject- How files are split into chunks before embedding. Use {"type": "auto"} (the default when left empty), or a static strategy that sets the maximum chunk size (100 to 4096 tokens) and the overlap between chunks (no more than half the chunk size). Example: {"type": "static", "static": {"max_chunk_size_tokens": 800, "chunk_overlap_tokens": 400}}.
file_idsarray- IDs of uploaded files to add, all sharing the chunking_strategy and attributes below. Provide this or files, not both. Example: ["file-abc123", "file-def456"].
filesarray- Files to add when each needs its own settings: a list of objects, each with a file_id and optional attributes and chunking_strategy. When this is used, the batch-level attributes and chunking_strategy are ignored. Provide this or file_ids, not both. Example: [{"file_id": "file-abc123", "attributes": {"author": "Jane Doe"}}].
openai_vector_store_file_createAttach one uploaded file to a vector store so it is chunked, embedded and searchable.WriteAdd File to Vector Store
Attach one uploaded file to a vector store so it is chunked, embedded and searchable. Returns the vector store file with its id, status (usually in_progress at first), chunking_strategy and attributes. Use this to add a single file. Use openai_vector_store_file_batch_create to add many files at once, and openai_vector_store_file_get to watch indexing.
Inputs
file_idstringrequired- ID of an uploaded file to add to the vector store. Get IDs from openai_file_list. Example: file-abc123.
vector_store_idstringrequired- ID of the vector store. Get it from openai_vector_store_list. Example: vs_abc123.
attributesobject- Up to 16 key-value pairs attached to the file, which file search can filter on. Keys are strings of up to 64 characters; values are strings (up to 512 characters), numbers or booleans. Example: {"author": "Jane Doe", "year": 2024, "public": true}.
chunking_strategyobject- How files are split into chunks before embedding. Use {"type": "auto"} (the default when left empty), or a static strategy that sets the maximum chunk size (100 to 4096 tokens) and the overlap between chunks (no more than half the chunk size). Example: {"type": "static", "static": {"max_chunk_size_tokens": 800, "chunk_overlap_tokens": 400}}.
openai_vector_store_file_updateReplace the attributes on a file in a vector store.WriteUpdate Vector Store File Attributes
Replace the attributes on a file in a vector store. Returns the updated vector store file with its new attributes. Use this to change the labels that openai_vector_store_search filters on. The file's contents and chunks are not changed.
- Idempotent
Inputs
attributesobjectrequired- The full set of attributes to store on the file, replacing the existing ones: up to 16 key-value pairs that file search can filter on. Keys are strings of up to 64 characters; values are strings (up to 512 characters), numbers or booleans. Example: {"author": "Jane Doe", "year": 2024}.
file_idstringrequired- ID of the file in the vector store. Get it from openai_vector_store_file_list. Example: file-abc123.
vector_store_idstringrequired- ID of the vector store. Get it from openai_vector_store_list. Example: vs_abc123.
openai_vector_store_searchSearch a vector store for the chunks most relevant to a text query, optionally filtered by file attributes.WriteSearch Vector Store
Search a vector store for the chunks most relevant to a text query, optionally filtered by file attributes. Returns a page of results, each with file_id, filename, score, attributes and the matching content chunks, plus the search_query used. Use this to retrieve grounding passages from a knowledge base. Use openai_vector_store_file_content_get to read a whole file's parsed text.
- Idempotent
Inputs
querystringrequired- Natural-language search query. Example: How do I reset my password?
vector_store_idstringrequired- ID of the vector store to search. Get it from openai_vector_store_list. Example: vs_abc123.
filtersobject- Filter on file attributes. A comparison filter has a key, a type (eq, ne, gt, gte, lt, lte, in or nin) and a value. A compound filter has type and or or plus a list of filters. Example: {"type": "and", "filters": [{"type": "eq", "key": "author", "value": "Jane Doe"}, {"type": "gte", "key": "year", "value": 2024}]}.
max_num_resultsinteger- Maximum number of results to return, from 1 to 50. Leave empty for the default of 10. Example: 5.
rankerstring- Ranker to use for the search: auto, default-2024-11-15 or none. Leave empty for the default (auto). Example: auto.one of
noneautodefault-2024-11-15 rewrite_queryboolean- Set to true to let OpenAI rewrite the natural-language query for better vector search. Leave empty for the default (false). Example: true.
score_thresholdnumber- Minimum relevance score from 0 to 1. Results scoring lower are dropped; values near 1 return fewer, more relevant results. Leave empty for the default (0). Example: 0.5.
openai_vector_store_updateUpdate a vector store's name, expiry policy or metadata.WriteUpdate Vector Store
Update a vector store's name, expiry policy or metadata. Returns the updated vector store. Use this to rename a store, change when it expires, or relabel it. Use openai_vector_store_file_create to change its files.
- Idempotent
Inputs
vector_store_idstringrequired- ID of the vector store to update. Get it from openai_vector_store_list. Example: vs_abc123.
expires_after_daysinteger- Expire the vector store this many days after it was last active, from 1 to 365. Leave empty to keep the current expiry policy. Example: 30.
metadataobject- Up to 16 key-value pairs to attach to the vector store, for storing your own structured information. Keys are strings of up to 64 characters and values are strings of up to 512 characters. Example: {"team": "support", "env": "prod"}.
namestring- New name for the vector store. Leave empty to keep the current name. Example: Support knowledge base v2.
No tools match.