openapi: 3.0.0
info:
title: OpenAI Assistants Groups API
description: The Assistants API allows you to build AI assistants within your own applications. An Assistant has instructions and can leverage models, tools, and knowledge to respond to user queries. The Assistants API currently supports three types of tools - Code Interpreter, Retrieval, and Function calling. In the future, we plan to release more OpenAI-built tools, and allow you to provide your own tools on our platform.
version: 2.0.0
termsOfService: https://openai.com/policies/terms-of-use
contact:
name: OpenAI Support
url: https://help.openai.com/
license:
name: MIT
url: https://github.com/openai/openai-openapi/blob/master/LICENSE
servers:
- url: https://api.openai.com/v1
security:
- ApiKeyAuth: []
tags:
- name: Groups
paths:
/organization/groups:
get:
security:
- AdminApiKeyAuth: []
summary: Lists all groups in the organization.
operationId: list-groups
tags:
- Groups
parameters:
- name: limit
in: query
description: 'A limit on the number of groups to be returned. Limit can range between 0 and 1000, and the default is 100.
'
required: false
schema:
type: integer
minimum: 0
maximum: 1000
default: 100
- name: after
in: query
description: 'A cursor for use in pagination. `after` is a group ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with group_abc, your subsequent call can include `after=group_abc` in order to fetch the next page of the list.
'
required: false
schema:
type: string
- name: order
in: query
description: Specifies the sort order of the returned groups.
required: false
schema:
type: string
enum:
- asc
- desc
default: asc
responses:
'200':
description: Groups listed successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/GroupListResource'
x-oaiMeta:
name: List groups
group: administration
examples:
request:
curl: "curl https://api.openai.com/v1/organization/groups?limit=20&order=asc \\\n -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n -H \"Content-Type: application/json\"\n"
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const group of client.admin.organization.groups.list()) {\n console.log(group.id);\n}"
python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n admin_api_key=os.environ.get(\"OPENAI_ADMIN_KEY\"), # This is the default and can be omitted\n)\npage = client.admin.organization.groups.list()\npage = page.data[0]\nprint(page.id)"
go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tpage, err := client.Admin.Organization.Groups.List(context.TODO(), openai.AdminOrganizationGroupListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.admin.organization.groups.GroupListPage;\nimport com.openai.models.admin.organization.groups.GroupListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GroupListPage page = client.admin().organization().groups().list();\n }\n}"
ruby: 'require "openai"
openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")
page = openai.admin.organization.groups.list
puts(page)'
response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"group\",\n \"id\": \"group_01J1F8ABCDXYZ\",\n \"name\": \"Support Team\",\n \"created_at\": 1711471533,\n \"is_scim_managed\": false\n }\n ],\n \"has_more\": false,\n \"next\": null\n}\n"
post:
security:
- AdminApiKeyAuth: []
summary: Creates a new group in the organization.
operationId: create-group
tags:
- Groups
requestBody:
description: Parameters for the group you want to create.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateGroupBody'
responses:
'200':
description: Group created successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/GroupResponse'
x-oaiMeta:
name: Create group
group: administration
examples:
request:
curl: "curl -X POST https://api.openai.com/v1/organization/groups \\\n -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"Support Team\"\n }'\n"
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted\n});\n\nconst group = await client.admin.organization.groups.create({ name: 'x' });\n\nconsole.log(group.id);"
python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n admin_api_key=os.environ.get(\"OPENAI_ADMIN_KEY\"), # This is the default and can be omitted\n)\ngroup = client.admin.organization.groups.create(\n name=\"x\",\n)\nprint(group.id)"
go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tgroup, err := client.Admin.Organization.Groups.New(context.TODO(), openai.AdminOrganizationGroupNewParams{\n\t\tName: \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", group.ID)\n}\n"
java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.admin.organization.groups.Group;\nimport com.openai.models.admin.organization.groups.GroupCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GroupCreateParams params = GroupCreateParams.builder()\n .name(\"x\")\n .build();\n Group group = client.admin().organization().groups().create(params);\n }\n}"
ruby: 'require "openai"
openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")
group = openai.admin.organization.groups.create(name: "x")
puts(group)'
response: "{\n \"object\": \"group\",\n \"id\": \"group_01J1F8ABCDXYZ\",\n \"name\": \"Support Team\",\n \"created_at\": 1711471533,\n \"is_scim_managed\": false\n}\n"
/organization/groups/{group_id}:
post:
security:
- AdminApiKeyAuth: []
summary: Updates a group's information.
operationId: update-group
tags:
- Groups
parameters:
- name: group_id
in: path
description: The ID of the group to update.
required: true
schema:
type: string
requestBody:
description: New attributes to set on the group.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateGroupBody'
responses:
'200':
description: Group updated successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/GroupResourceWithSuccess'
x-oaiMeta:
name: Update group
group: administration
examples:
request:
curl: "curl -X POST https://api.openai.com/v1/organization/groups/group_01J1F8ABCDXYZ \\\n -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"Escalations\"\n }'\n"
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted\n});\n\nconst group = await client.admin.organization.groups.update('group_id', { name: 'x' });\n\nconsole.log(group.id);"
python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n admin_api_key=os.environ.get(\"OPENAI_ADMIN_KEY\"), # This is the default and can be omitted\n)\ngroup = client.admin.organization.groups.update(\n group_id=\"group_id\",\n name=\"x\",\n)\nprint(group.id)"
go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tgroup, err := client.Admin.Organization.Groups.Update(\n\t\tcontext.TODO(),\n\t\t\"group_id\",\n\t\topenai.AdminOrganizationGroupUpdateParams{\n\t\t\tName: \"x\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", group.ID)\n}\n"
java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.admin.organization.groups.GroupUpdateParams;\nimport com.openai.models.admin.organization.groups.GroupUpdateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GroupUpdateParams params = GroupUpdateParams.builder()\n .groupId(\"group_id\")\n .name(\"x\")\n .build();\n GroupUpdateResponse group = client.admin().organization().groups().update(params);\n }\n}"
ruby: 'require "openai"
openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")
group = openai.admin.organization.groups.update("group_id", name: "x")
puts(group)'
response: "{\n \"id\": \"group_01J1F8ABCDXYZ\",\n \"name\": \"Escalations\",\n \"created_at\": 1711471533,\n \"is_scim_managed\": false\n}\n"
delete:
security:
- AdminApiKeyAuth: []
summary: Deletes a group from the organization.
operationId: delete-group
tags:
- Groups
parameters:
- name: group_id
in: path
description: The ID of the group to delete.
required: true
schema:
type: string
responses:
'200':
description: Group deleted successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/GroupDeletedResource'
x-oaiMeta:
name: Delete group
group: administration
examples:
request:
curl: "curl -X DELETE https://api.openai.com/v1/organization/groups/group_01J1F8ABCDXYZ \\\n -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n -H \"Content-Type: application/json\"\n"
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted\n});\n\nconst group = await client.admin.organization.groups.delete('group_id');\n\nconsole.log(group.id);"
python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n admin_api_key=os.environ.get(\"OPENAI_ADMIN_KEY\"), # This is the default and can be omitted\n)\ngroup = client.admin.organization.groups.delete(\n \"group_id\",\n)\nprint(group.id)"
go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tgroup, err := client.Admin.Organization.Groups.Delete(context.TODO(), \"group_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", group.ID)\n}\n"
java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.admin.organization.groups.GroupDeleteParams;\nimport com.openai.models.admin.organization.groups.GroupDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GroupDeleteResponse group = client.admin().organization().groups().delete(\"group_id\");\n }\n}"
ruby: 'require "openai"
openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")
group = openai.admin.organization.groups.delete("group_id")
puts(group)'
response: "{\n \"object\": \"group.deleted\",\n \"id\": \"group_01J1F8ABCDXYZ\",\n \"deleted\": true\n}\n"
components:
schemas:
UpdateGroupBody:
type: object
description: Request payload for updating the details of an existing group.
properties:
name:
type: string
description: New display name for the group.
minLength: 1
maxLength: 255
required:
- name
x-oaiMeta:
example: "{\n \"name\": \"Escalations\"\n}\n"
CreateGroupBody:
type: object
description: Request payload for creating a new group in the organization.
properties:
name:
type: string
description: Human readable name for the group.
minLength: 1
maxLength: 255
required:
- name
x-oaiMeta:
example: "{\n \"name\": \"Support Team\"\n}\n"
GroupDeletedResource:
type: object
description: Confirmation payload returned after deleting a group.
properties:
object:
type: string
enum:
- group.deleted
description: Always `group.deleted`.
x-stainless-const: true
id:
type: string
description: Identifier of the deleted group.
deleted:
type: boolean
description: Whether the group was deleted.
required:
- object
- id
- deleted
x-oaiMeta:
example: "{\n \"object\": \"group.deleted\",\n \"id\": \"group_01J1F8ABCDXYZ\",\n \"deleted\": true\n}\n"
GroupResourceWithSuccess:
type: object
description: Response returned after updating a group.
properties:
id:
type: string
description: Identifier for the group.
name:
type: string
description: Updated display name for the group.
created_at:
type: integer
format: unixtime
description: Unix timestamp (in seconds) when the group was created.
is_scim_managed:
type: boolean
description: Whether the group is managed through SCIM and controlled by your identity provider.
required:
- id
- name
- created_at
- is_scim_managed
x-oaiMeta:
example: "{\n \"id\": \"group_01J1F8ABCDXYZ\",\n \"name\": \"Escalations\",\n \"created_at\": 1711471533,\n \"is_scim_managed\": false\n}\n"
GroupResponse:
type: object
description: Details about an organization group.
properties:
id:
type: string
description: Identifier for the group.
name:
type: string
description: Display name of the group.
created_at:
type: integer
format: unixtime
description: Unix timestamp (in seconds) when the group was created.
is_scim_managed:
type: boolean
description: Whether the group is managed through SCIM and controlled by your identity provider.
group_type:
type: string
description: The type of the group.
required:
- id
- name
- created_at
- is_scim_managed
- group_type
x-oaiMeta:
name: Group
example: "{\n \"id\": \"group_01J1F8ABCDXYZ\",\n \"name\": \"Support Team\",\n \"created_at\": 1711471533,\n \"is_scim_managed\": false,\n \"group_type\": \"group\"\n}\n"
GroupListResource:
type: object
description: Paginated list of organization groups.
properties:
object:
type: string
enum:
- list
description: Always `list`.
x-stainless-const: true
data:
type: array
description: Groups returned in the current page.
items:
$ref: '#/components/schemas/GroupResponse'
has_more:
type: boolean
description: Whether additional groups are available when paginating.
next:
description: Cursor to fetch the next page of results, or `null` if there are no more results.
anyOf:
- type: string
- type: 'null'
required:
- object
- data
- has_more
- next
x-oaiMeta:
name: Group list
example: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"group_01J1F8ABCDXYZ\",\n \"name\": \"Support Team\",\n \"created_at\": 1711471533,\n \"is_scim_managed\": false\n },\n {\n \"id\": \"group_01J1F8PQRMNO\",\n \"name\": \"Sales\",\n \"created_at\": 1711472599,\n \"is_scim_managed\": true\n }\n ],\n \"has_more\": false,\n \"next\": null\n}\n"
securitySchemes:
ApiKeyAuth:
type: http
scheme: bearer
x-oaiMeta:
groups:
- id: audio
title: Audio
description: 'Learn how to turn audio into text or text into audio.
Related guide: [Speech to text](/docs/guides/speech-to-text)
'
sections:
- type: endpoint
key: createSpeech
path: createSpeech
- type: endpoint
key: createTranscription
path: createTranscription
- type: endpoint
key: createTranslation
path: createTranslation
- id: chat
title: Chat
description: 'Given a list of messages comprising a conversation, the model will return a response.
Related guide: [Chat Completions](/docs/guides/text-generation)
'
sections:
- type: endpoint
key: createChatCompletion
path: create
- type: object
key: CreateChatCompletionResponse
path: object
- type: object
key: CreateChatCompletionStreamResponse
path: streaming
- id: embeddings
title: Embeddings
description: 'Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
Related guide: [Embeddings](/docs/guides/embeddings)
'
sections:
- type: endpoint
key: createEmbedding
path: create
- type: object
key: Embedding
path: object
- id: fine-tuning
title: Fine-tuning
description: 'Manage fine-tuning jobs to tailor a model to your specific training data.
Related guide: [Fine-tune models](/docs/guides/fine-tuning)
'
sections:
- type: endpoint
key: createFineTuningJob
path: create
- type: endpoint
key: listPaginatedFineTuningJobs
path: list
- type: endpoint
key: listFineTuningEvents
path: list-events
- type: endpoint
key: retrieveFineTuningJob
path: retrieve
- type: endpoint
key: cancelFineTuningJob
path: cancel
- type: object
key: FineTuningJob
path: object
- type: object
key: FineTuningJobEvent
path: event-object
- id: files
title: Files
description: 'Files are used to upload documents that can be used with features like [Assistants](/docs/api-reference/assistants) and [Fine-tuning](/docs/api-reference/fine-tuning).
'
sections:
- type: endpoint
key: createFile
path: create
- type: endpoint
key: listFiles
path: list
- type: endpoint
key: retrieveFile
path: retrieve
- type: endpoint
key: deleteFile
path: delete
- type: endpoint
key: downloadFile
path: retrieve-contents
- type: object
key: OpenAIFile
path: object
- id: images
title: Images
description: 'Given a prompt and/or an input image, the model will generate a new image.
Related guide: [Image generation](/docs/guides/images)
'
sections:
- type: endpoint
key: createImage
path: create
- type: endpoint
key: createImageEdit
path: createEdit
- type: endpoint
key: createImageVariation
path: createVariation
- type: object
key: Image
path: object
- id: models
title: Models
description: 'List and describe the various models available in the API. You can refer to the [Models](/docs/models) documentation to understand what models are available and the differences between them.
'
sections:
- type: endpoint
key: listModels
path: list
- type: endpoint
key: retrieveModel
path: retrieve
- type: endpoint
key: deleteModel
path: delete
- type: object
key: Model
path: object
- id: moderations
title: Moderations
description: 'Given a input text, outputs if the model classifies it as violating OpenAI''s content policy.
Related guide: [Moderations](/docs/guides/moderation)
'
sections:
- type: endpoint
key: createModeration
path: create
- type: object
key: CreateModerationResponse
path: object
- id: assistants
title: Assistants
beta: true
description: 'Build assistants that can call models and use tools to perform tasks.
[Get started with the Assistants API](/docs/assistants)
'
sections:
- type: endpoint
key: createAssistant
path: createAssistant
- type: endpoint
key: createAssistantFile
path: createAssistantFile
- type: endpoint
key: listAssistants
path: listAssistants
- type: endpoint
key: listAssistantFiles
path: listAssistantFiles
- type: endpoint
key: getAssistant
path: getAssistant
- type: endpoint
key: getAssistantFile
path: getAssistantFile
- type: endpoint
key: modifyAssistant
path: modifyAssistant
- type: endpoint
key: deleteAssistant
path: deleteAssistant
- type: endpoint
key: deleteAssistantFile
path: deleteAssistantFile
- type: object
key: AssistantObject
path: object
- type: object
key: AssistantFileObject
path: file-object
- id: threads
title: Threads
beta: true
description: 'Create threads that assistants can interact with.
Related guide: [Assistants](/docs/assistants/overview)
'
sections:
- type: endpoint
key: createThread
path: createThread
- type: endpoint
key: getThread
path: getThread
- type: endpoint
key: modifyThread
path: modifyThread
- type: endpoint
key: deleteThread
path: deleteThread
- type: object
key: ThreadObject
path: object
- id: messages
title: Messages
beta: true
description: 'Create messages within threads
Related guide: [Assistants](/docs/assistants/overview)
'
sections:
- type: endpoint
key: createMessage
path: createMessage
- type: endpoint
key: listMessages
path: listMessages
- type: endpoint
key: listMessageFiles
path: listMessageFiles
- type: endpoint
key: getMessage
path: getMessage
- type: endpoint
key: getMessageFile
path: getMessageFile
- type: endpoint
key: modifyMessage
path: modifyMessage
- type: object
key: MessageObject
path: object
- type: object
key: MessageFileObject
path: file-object
- id: runs
title: Runs
beta: true
description: 'Represents an execution run on a thread.
Related guide: [Assistants](/docs/assistants/overview)
'
sections:
- type: endpoint
key: createRun
path: createRun
- type: endpoint
key: createThreadAndRun
path: createThreadAndRun
- type: endpoint
key: listRuns
path: listRuns
- type: endpoint
key: listRunSteps
path: listRunSteps
- type: endpoint
key: getRun
path: getRun
- type: endpoint
key: getRunStep
path: getRunStep
- type: endpoint
key: modifyRun
path: modifyRun
- type: endpoint
key: submitToolOuputsToRun
path: submitToolOutputs
- type: endpoint
key: cancelRun
path: cancelRun
- type: object
key: RunObject
path: object
- type: object
key: RunStepObject
path: step-object
- id: completions
title: Completions
legacy: true
description: 'Given a prompt, the model will return one or more predicted completions along with the probabilities of alternative tokens at each position. Most developer should use our [Chat Completions API](/docs/guides/text-generation/text-generation-models) to leverage our best and newest models. Most models that support the legacy Completions endpoint [will be shut off on January 4th, 2024](/docs/deprecations/2023-07-06-gpt-and-embeddings).
'
sections:
- type: endpoint
key: createCompletion
path: create
- type: object
key: CreateCompletionResponse
path: object