NAME
OpenAPI::Client::OpenAI::Path::assistants - Documentation for the /assistants path.
OPERATIONS
GET /assistants
listAssistants
$client->list_assistants({
body => { ... },
});
Returns a list of assistants.
Path/query parameters
limit(in query, optional, integer) - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.Default: 20
order(in query, optional, string) - Sort order by thecreated_attimestamp of the objects.ascfor ascending order anddescfor descending order.Allowed values: asc, desc
Default: desc
after(in query, optional, string) - A cursor for use in pagination.afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before(in query, optional, string) - A cursor for use in pagination.beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
Responses
200 - OK
Content-Type: application/json
Example:
{
"data" : [
{
"created_at" : 1698982736,
"description" : null,
"id" : "asst_abc123",
"instructions" : "You are a helpful assistant designed to make me better at coding!",
"metadata" : {},
"model" : "gpt-4o",
"name" : "Coding Tutor",
"object" : "assistant",
"response_format" : "auto",
"temperature" : 1,
"tool_resources" : {},
"tools" : [],
"top_p" : 1
},
{
"created_at" : 1698982718,
"description" : null,
"id" : "asst_abc456",
"instructions" : "You are a helpful assistant designed to make me better at coding!",
"metadata" : {},
"model" : "gpt-4o",
"name" : "My Assistant",
"object" : "assistant",
"response_format" : "auto",
"temperature" : 1,
"tool_resources" : {},
"tools" : [],
"top_p" : 1
},
{
"created_at" : 1698982643,
"description" : null,
"id" : "asst_abc789",
"instructions" : null,
"metadata" : {},
"model" : "gpt-4o",
"name" : null,
"object" : "assistant",
"response_format" : "auto",
"temperature" : 1,
"tool_resources" : {},
"tools" : [],
"top_p" : 1
}
],
"first_id" : "asst_abc123",
"has_more" : false,
"last_id" : "asst_abc789",
"object" : "list"
}
POST /assistants
createAssistant
$client->create_assistant({
body => { ... },
});
Create an assistant with a model and instructions.
Request body
Content-Type: application/json
Example:
{
"created_at" : 1698984975,
"description" : null,
"id" : "asst_abc123",
"instructions" : "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
"metadata" : {},
"model" : "gpt-4o",
"name" : "Math Tutor",
"object" : "assistant",
"response_format" : "auto",
"temperature" : 1,
"tools" : [
{
"type" : "code_interpreter"
}
],
"top_p" : 1
}
Responses
200 - OK
Content-Type: application/json
Example:
{
"created_at" : 1698984975,
"description" : null,
"id" : "asst_abc123",
"instructions" : "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
"metadata" : {},
"model" : "gpt-4o",
"name" : "Math Tutor",
"object" : "assistant",
"response_format" : "auto",
"temperature" : 1,
"tools" : [
{
"type" : "code_interpreter"
}
],
"top_p" : 1
}
SCHEMAS
AssistantObject
Properties:
created_at(integer, required) - The Unix timestamp (in seconds) for when the assistant was created.description(anyOf, required)id(string, required) - The identifier, which can be referenced in API endpoints.instructions(anyOf, required)metadata(Metadata, required)See "Metadata" below for shape.
model(string, required) - ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.name(anyOf, required)object(string, required) - The object type, which is alwaysassistant.Allowed values: assistant
response_format(anyOf)temperature(anyOf)tool_resources(anyOf)tools(array of object, required) - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of typescode_interpreter,file_search, orfunction.Default: []
top_p(anyOf)
CreateAssistantRequest
Properties:
description(anyOf)instructions(anyOf)metadata(Metadata)See "Metadata" below for shape.
model(anyOf, required) - ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.name(anyOf)reasoning_effort(ReasoningEffort)See "ReasoningEffort" below for shape.
response_format(anyOf)temperature(anyOf)tool_resources(anyOf)tools(array of object) - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of typescode_interpreter,file_search, orfunction.Default: []
top_p(anyOf)
ListAssistantsResponse
Properties:
data(array of AssistantObject, required)first_id(string, required)has_more(boolean, required)last_id(string, required)object(string, required)
Metadata
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
ReasoningEffort
Constrains effort on reasoning for reasoning models . Currently supported values are none , minimal , low , medium , high , and xhigh . Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
- gpt-5.1 defaults to none , which does not perform reasoning. The supported reasoning values for gpt-5.1 are none , low , medium , and high . Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none . - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is supported for all models after gpt-5.1-codex-max .
SEE ALSO
COPYRIGHT AND LICENSE
Copyright (C) 2023-2026 by Nelson Ferraz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.