openapi: 3.0.0 info: title: OpenAI Assistants Projects 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: Projects paths: /organization/projects: get: summary: Returns a list of projects. operationId: list-projects security: - AdminApiKeyAuth: [] tags: - Projects parameters: - name: limit in: query description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ' required: false schema: type: integer default: 20 - name: after in: query description: 'A cursor for use in pagination. `after` is 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. ' required: false schema: type: string - name: include_archived in: query schema: type: boolean default: false description: If `true` returns all projects including those that have been `archived`. Archived projects are not included by default. responses: '200': description: Projects listed successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectListResponse' x-oaiMeta: name: List projects group: administration examples: request: curl: "curl https://api.openai.com/v1/organization/projects?after=proj_abc&limit=20&include_archived=false \\\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 project of client.admin.organization.projects.list()) {\n console.log(project.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.projects.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.Projects.List(context.TODO(), openai.AdminOrganizationProjectListParams{})\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.projects.ProjectListPage;\nimport com.openai.models.admin.organization.projects.ProjectListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ProjectListPage page = client.admin().organization().projects().list();\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") page = openai.admin.organization.projects.list puts(page)' response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"proj_abc\",\n \"object\": \"organization.project\",\n \"name\": \"Project example\",\n \"created_at\": 1711471533,\n \"archived_at\": null,\n \"status\": \"active\"\n }\n ],\n \"first_id\": \"proj-abc\",\n \"last_id\": \"proj-xyz\",\n \"has_more\": false\n}\n" post: summary: Create a new project in the organization. Projects can be created and archived, but cannot be deleted. operationId: create-project security: - AdminApiKeyAuth: [] tags: - Projects requestBody: description: The project create request payload. required: true content: application/json: schema: $ref: '#/components/schemas/ProjectCreateRequest' responses: '200': description: Project created successfully. content: application/json: schema: $ref: '#/components/schemas/Project' x-oaiMeta: name: Create project group: administration examples: request: curl: "curl -X POST https://api.openai.com/v1/organization/projects \\\n -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"Project ABC\"\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 project = await client.admin.organization.projects.create({ name: 'name' });\n\nconsole.log(project.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)\nproject = client.admin.organization.projects.create(\n name=\"name\",\n)\nprint(project.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\tproject, err := client.Admin.Organization.Projects.New(context.TODO(), openai.AdminOrganizationProjectNewParams{\n\t\tName: \"name\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", project.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.projects.Project;\nimport com.openai.models.admin.organization.projects.ProjectCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ProjectCreateParams params = ProjectCreateParams.builder()\n .name(\"name\")\n .build();\n Project project = client.admin().organization().projects().create(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") project = openai.admin.organization.projects.create(name: "name") puts(project)' response: "{\n \"id\": \"proj_abc\",\n \"object\": \"organization.project\",\n \"name\": \"Project ABC\",\n \"created_at\": 1711471533,\n \"archived_at\": null,\n \"status\": \"active\"\n}\n" /organization/projects/{project_id}: get: summary: Retrieves a project. operationId: retrieve-project security: - AdminApiKeyAuth: [] tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string responses: '200': description: Project retrieved successfully. content: application/json: schema: $ref: '#/components/schemas/Project' x-oaiMeta: name: Retrieve project group: administration description: Retrieve a project. examples: request: curl: "curl https://api.openai.com/v1/organization/projects/proj_abc \\\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 project = await client.admin.organization.projects.retrieve('project_id');\n\nconsole.log(project.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)\nproject = client.admin.organization.projects.retrieve(\n \"project_id\",\n)\nprint(project.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\tproject, err := client.Admin.Organization.Projects.Get(context.TODO(), \"project_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", project.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.projects.Project;\nimport com.openai.models.admin.organization.projects.ProjectRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Project project = client.admin().organization().projects().retrieve(\"project_id\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") project = openai.admin.organization.projects.retrieve("project_id") puts(project)' response: "{\n \"id\": \"proj_abc\",\n \"object\": \"organization.project\",\n \"name\": \"Project example\",\n \"created_at\": 1711471533,\n \"archived_at\": null,\n \"status\": \"active\"\n}\n" post: summary: Modifies a project in the organization. operationId: modify-project security: - AdminApiKeyAuth: [] tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string requestBody: description: The project update request payload. required: true content: application/json: schema: $ref: '#/components/schemas/ProjectUpdateRequest' responses: '200': description: Project updated successfully. content: application/json: schema: $ref: '#/components/schemas/Project' '400': description: Error response when updating the default project. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-oaiMeta: name: Modify project group: administration examples: request: curl: "curl -X POST https://api.openai.com/v1/organization/projects/proj_abc \\\n -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"Project DEF\"\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 project = await client.admin.organization.projects.update('project_id');\n\nconsole.log(project.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)\nproject = client.admin.organization.projects.update(\n project_id=\"project_id\",\n)\nprint(project.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\tproject, err := client.Admin.Organization.Projects.Update(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\topenai.AdminOrganizationProjectUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", project.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.projects.Project;\nimport com.openai.models.admin.organization.projects.ProjectUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Project project = client.admin().organization().projects().update(\"project_id\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") project = openai.admin.organization.projects.update("project_id") puts(project)' response: '' /organization/projects/{project_id}/api_keys: get: security: - AdminApiKeyAuth: [] summary: Returns a list of API keys in the project. operationId: list-project-api-keys tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: limit in: query description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ' required: false schema: type: integer default: 20 - name: after in: query description: 'A cursor for use in pagination. `after` is 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. ' required: false schema: type: string responses: '200': description: Project API keys listed successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectApiKeyListResponse' x-oaiMeta: name: List project API keys group: administration examples: request: curl: "curl https://api.openai.com/v1/organization/projects/proj_abc/api_keys?after=key_abc&limit=20 \\\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 projectAPIKey of client.admin.organization.projects.apiKeys.list('project_id')) {\n console.log(projectAPIKey.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.projects.api_keys.list(\n project_id=\"project_id\",\n)\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.Projects.APIKeys.List(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\topenai.AdminOrganizationProjectAPIKeyListParams{},\n\t)\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.projects.apikeys.ApiKeyListPage;\nimport com.openai.models.admin.organization.projects.apikeys.ApiKeyListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ApiKeyListPage page = client.admin().organization().projects().apiKeys().list(\"project_id\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") page = openai.admin.organization.projects.api_keys.list("project_id") puts(page)' response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"organization.project.api_key\",\n \"redacted_value\": \"sk-abc...def\",\n \"name\": \"My API Key\",\n \"created_at\": 1711471533,\n \"last_used_at\": 1711471534,\n \"id\": \"key_abc\",\n \"owner\": {\n \"type\": \"user\",\n \"user\": {\n \"id\": \"user_abc\",\n \"name\": \"First Last\",\n \"email\": \"user@example.com\",\n \"role\": \"owner\",\n \"created_at\": 1711471533\n }\n }\n }\n ],\n \"first_id\": \"key_abc\",\n \"last_id\": \"key_xyz\",\n \"has_more\": false\n}\n" /organization/projects/{project_id}/api_keys/{api_key_id}: get: security: - AdminApiKeyAuth: [] summary: Retrieves an API key in the project. operationId: retrieve-project-api-key tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: api_key_id in: path description: The ID of the API key. required: true schema: type: string responses: '200': description: Project API key retrieved successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectApiKey' x-oaiMeta: name: Retrieve project API key group: administration examples: request: curl: "curl https://api.openai.com/v1/organization/projects/proj_abc/api_keys/key_abc \\\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 projectAPIKey = await client.admin.organization.projects.apiKeys.retrieve('api_key_id', {\n project_id: 'project_id',\n});\n\nconsole.log(projectAPIKey.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)\nproject_api_key = client.admin.organization.projects.api_keys.retrieve(\n api_key_id=\"api_key_id\",\n project_id=\"project_id\",\n)\nprint(project_api_key.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\tprojectAPIKey, err := client.Admin.Organization.Projects.APIKeys.Get(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\t\"api_key_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectAPIKey.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.projects.apikeys.ApiKeyRetrieveParams;\nimport com.openai.models.admin.organization.projects.apikeys.ProjectApiKey;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ApiKeyRetrieveParams params = ApiKeyRetrieveParams.builder()\n .projectId(\"project_id\")\n .apiKeyId(\"api_key_id\")\n .build();\n ProjectApiKey projectApiKey = client.admin().organization().projects().apiKeys().retrieve(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") project_api_key = openai.admin.organization.projects.api_keys.retrieve("api_key_id", project_id: "project_id") puts(project_api_key)' response: "{\n \"object\": \"organization.project.api_key\",\n \"redacted_value\": \"sk-abc...def\",\n \"name\": \"My API Key\",\n \"created_at\": 1711471533,\n \"last_used_at\": 1711471534,\n \"id\": \"key_abc\",\n \"owner\": {\n \"type\": \"user\",\n \"user\": {\n \"id\": \"user_abc\",\n \"name\": \"First Last\",\n \"email\": \"user@example.com\",\n \"role\": \"owner\",\n \"created_at\": 1711471533\n }\n }\n}\n" delete: security: - AdminApiKeyAuth: [] summary: 'Deletes an API key from the project. Returns confirmation of the key deletion, or an error if the key belonged to a service account. ' operationId: delete-project-api-key tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: api_key_id in: path description: The ID of the API key. required: true schema: type: string responses: '200': description: Project API key deleted successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectApiKeyDeleteResponse' '400': description: Error response for various conditions. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-oaiMeta: name: Delete project API key group: administration examples: request: curl: "curl -X DELETE https://api.openai.com/v1/organization/projects/proj_abc/api_keys/key_abc \\\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 apiKey = await client.admin.organization.projects.apiKeys.delete('api_key_id', {\n project_id: 'project_id',\n});\n\nconsole.log(apiKey.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)\napi_key = client.admin.organization.projects.api_keys.delete(\n api_key_id=\"api_key_id\",\n project_id=\"project_id\",\n)\nprint(api_key.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\tapiKey, err := client.Admin.Organization.Projects.APIKeys.Delete(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\t\"api_key_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", apiKey.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.projects.apikeys.ApiKeyDeleteParams;\nimport com.openai.models.admin.organization.projects.apikeys.ApiKeyDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ApiKeyDeleteParams params = ApiKeyDeleteParams.builder()\n .projectId(\"project_id\")\n .apiKeyId(\"api_key_id\")\n .build();\n ApiKeyDeleteResponse apiKey = client.admin().organization().projects().apiKeys().delete(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") api_key = openai.admin.organization.projects.api_keys.delete("api_key_id", project_id: "project_id") puts(api_key)' response: "{\n \"object\": \"organization.project.api_key.deleted\",\n \"id\": \"key_abc\",\n \"deleted\": true\n}\n" /organization/projects/{project_id}/archive: post: summary: Archives a project in the organization. Archived projects cannot be used or updated. operationId: archive-project security: - AdminApiKeyAuth: [] tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string responses: '200': description: Project archived successfully. content: application/json: schema: $ref: '#/components/schemas/Project' x-oaiMeta: name: Archive project group: administration examples: request: curl: "curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/archive \\\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 project = await client.admin.organization.projects.archive('project_id');\n\nconsole.log(project.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)\nproject = client.admin.organization.projects.archive(\n \"project_id\",\n)\nprint(project.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\tproject, err := client.Admin.Organization.Projects.Archive(context.TODO(), \"project_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", project.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.projects.Project;\nimport com.openai.models.admin.organization.projects.ProjectArchiveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Project project = client.admin().organization().projects().archive(\"project_id\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") project = openai.admin.organization.projects.archive("project_id") puts(project)' response: "{\n \"id\": \"proj_abc\",\n \"object\": \"organization.project\",\n \"name\": \"Project DEF\",\n \"created_at\": 1711471533,\n \"archived_at\": 1711471533,\n \"status\": \"archived\"\n}\n" /organization/projects/{project_id}/rate_limits: get: security: - AdminApiKeyAuth: [] summary: Returns the rate limits per model for a project. operationId: list-project-rate-limits tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: limit in: query description: 'A limit on the number of objects to be returned. The default is 100. ' required: false schema: type: integer default: 100 - name: after in: query description: 'A cursor for use in pagination. `after` is 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. ' required: false schema: type: string - name: before in: query description: 'A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, beginning with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. ' required: false schema: type: string responses: '200': description: Project rate limits listed successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectRateLimitListResponse' x-oaiMeta: name: List project rate limits group: administration examples: request: curl: "curl https://api.openai.com/v1/organization/projects/proj_abc/rate_limits?after=rl_xxx&limit=20 \\\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 projectRateLimit of client.admin.organization.projects.rateLimits.listRateLimits(\n 'project_id',\n)) {\n console.log(projectRateLimit.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.projects.rate_limits.list_rate_limits(\n project_id=\"project_id\",\n)\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.Projects.RateLimits.ListRateLimits(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\topenai.AdminOrganizationProjectRateLimitListRateLimitsParams{},\n\t)\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.projects.ratelimits.RateLimitListRateLimitsPage;\nimport com.openai.models.admin.organization.projects.ratelimits.RateLimitListRateLimitsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RateLimitListRateLimitsPage page = client.admin().organization().projects().rateLimits().listRateLimits(\"project_id\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") page = openai.admin.organization.projects.rate_limits.list_rate_limits("project_id") puts(page)' response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"project.rate_limit\",\n \"id\": \"rl-ada\",\n \"model\": \"ada\",\n \"max_requests_per_1_minute\": 600,\n \"max_tokens_per_1_minute\": 150000,\n \"max_images_per_1_minute\": 10\n }\n ],\n \"first_id\": \"rl-ada\",\n \"last_id\": \"rl-ada\",\n \"has_more\": false\n}\n" error_response: "{\n \"code\": 404,\n \"message\": \"The project {project_id} was not found\"\n}\n" /organization/projects/{project_id}/rate_limits/{rate_limit_id}: post: security: - AdminApiKeyAuth: [] summary: Updates a project rate limit. operationId: update-project-rate-limits tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: rate_limit_id in: path description: The ID of the rate limit. required: true schema: type: string requestBody: description: The project rate limit update request payload. required: true content: application/json: schema: $ref: '#/components/schemas/ProjectRateLimitUpdateRequest' responses: '200': description: Project rate limit updated successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectRateLimit' '400': description: Error response for various conditions. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-oaiMeta: name: Modify project rate limit group: administration examples: request: curl: "curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/rate_limits/rl_xxx \\\n -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"max_requests_per_1_minute\": 500\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 projectRateLimit = await client.admin.organization.projects.rateLimits.updateRateLimit(\n 'rate_limit_id',\n { project_id: 'project_id' },\n);\n\nconsole.log(projectRateLimit.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)\nproject_rate_limit = client.admin.organization.projects.rate_limits.update_rate_limit(\n rate_limit_id=\"rate_limit_id\",\n project_id=\"project_id\",\n)\nprint(project_rate_limit.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\tprojectRateLimit, err := client.Admin.Organization.Projects.RateLimits.UpdateRateLimit(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\t\"rate_limit_id\",\n\t\topenai.AdminOrganizationProjectRateLimitUpdateRateLimitParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectRateLimit.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.projects.ratelimits.ProjectRateLimit;\nimport com.openai.models.admin.organization.projects.ratelimits.RateLimitUpdateRateLimitParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RateLimitUpdateRateLimitParams params = RateLimitUpdateRateLimitParams.builder()\n .projectId(\"project_id\")\n .rateLimitId(\"rate_limit_id\")\n .build();\n ProjectRateLimit projectRateLimit = client.admin().organization().projects().rateLimits().updateRateLimit(params);\n }\n}" ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(admin_api_key: \"My Admin API Key\")\n\nproject_rate_limit = openai.admin.organization.projects.rate_limits.update_rate_limit(\n \"rate_limit_id\",\n project_id: \"project_id\"\n)\n\nputs(project_rate_limit)" response: "{\n \"object\": \"project.rate_limit\",\n \"id\": \"rl-ada\",\n \"model\": \"ada\",\n \"max_requests_per_1_minute\": 600,\n \"max_tokens_per_1_minute\": 150000,\n \"max_images_per_1_minute\": 10\n }\n" error_response: "{\n \"code\": 404,\n \"message\": \"The project {project_id} was not found\"\n}\n" /organization/projects/{project_id}/service_accounts: get: security: - AdminApiKeyAuth: [] summary: Returns a list of service accounts in the project. operationId: list-project-service-accounts tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: limit in: query description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ' required: false schema: type: integer default: 20 - name: after in: query description: 'A cursor for use in pagination. `after` is 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. ' required: false schema: type: string responses: '200': description: Project service accounts listed successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectServiceAccountListResponse' '400': description: Error response when project is archived. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-oaiMeta: name: List project service accounts group: administration examples: request: curl: "curl https://api.openai.com/v1/organization/projects/proj_abc/service_accounts?after=custom_id&limit=20 \\\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 projectServiceAccount of client.admin.organization.projects.serviceAccounts.list(\n 'project_id',\n)) {\n console.log(projectServiceAccount.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.projects.service_accounts.list(\n project_id=\"project_id\",\n)\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.Projects.ServiceAccounts.List(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\topenai.AdminOrganizationProjectServiceAccountListParams{},\n\t)\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.projects.serviceaccounts.ServiceAccountListPage;\nimport com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ServiceAccountListPage page = client.admin().organization().projects().serviceAccounts().list(\"project_id\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") page = openai.admin.organization.projects.service_accounts.list("project_id") puts(page)' response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"organization.project.service_account\",\n \"id\": \"svc_acct_abc\",\n \"name\": \"Service Account\",\n \"role\": \"owner\",\n \"created_at\": 1711471533\n }\n ],\n \"first_id\": \"svc_acct_abc\",\n \"last_id\": \"svc_acct_xyz\",\n \"has_more\": false\n}\n" post: security: - AdminApiKeyAuth: [] summary: Creates a new service account in the project. This also returns an unredacted API key for the service account. operationId: create-project-service-account tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string requestBody: description: The project service account create request payload. required: true content: application/json: schema: $ref: '#/components/schemas/ProjectServiceAccountCreateRequest' responses: '200': description: Project service account created successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectServiceAccountCreateResponse' '400': description: Error response when project is archived. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-oaiMeta: name: Create project service account group: administration examples: request: curl: "curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/service_accounts \\\n -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"Production App\"\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 serviceAccount = await client.admin.organization.projects.serviceAccounts.create(\n 'project_id',\n { name: 'name' },\n);\n\nconsole.log(serviceAccount.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)\nservice_account = client.admin.organization.projects.service_accounts.create(\n project_id=\"project_id\",\n name=\"name\",\n)\nprint(service_account.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\tserviceAccount, err := client.Admin.Organization.Projects.ServiceAccounts.New(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\topenai.AdminOrganizationProjectServiceAccountNewParams{\n\t\t\tName: \"name\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", serviceAccount.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.projects.serviceaccounts.ServiceAccountCreateParams;\nimport com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ServiceAccountCreateParams params = ServiceAccountCreateParams.builder()\n .projectId(\"project_id\")\n .name(\"name\")\n .build();\n ServiceAccountCreateResponse serviceAccount = client.admin().organization().projects().serviceAccounts().create(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") service_account = openai.admin.organization.projects.service_accounts.create("project_id", name: "name") puts(service_account)' response: "{\n \"object\": \"organization.project.service_account\",\n \"id\": \"svc_acct_abc\",\n \"name\": \"Production App\",\n \"role\": \"member\",\n \"created_at\": 1711471533,\n \"api_key\": {\n \"object\": \"organization.project.service_account.api_key\",\n \"value\": \"sk-abcdefghijklmnop123\",\n \"name\": \"Secret Key\",\n \"created_at\": 1711471533,\n \"id\": \"key_abc\"\n }\n}\n" /organization/projects/{project_id}/service_accounts/{service_account_id}: get: security: - AdminApiKeyAuth: [] summary: Retrieves a service account in the project. operationId: retrieve-project-service-account tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: service_account_id in: path description: The ID of the service account. required: true schema: type: string responses: '200': description: Project service account retrieved successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectServiceAccount' x-oaiMeta: name: Retrieve project service account group: administration examples: request: curl: "curl https://api.openai.com/v1/organization/projects/proj_abc/service_accounts/svc_acct_abc \\\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 projectServiceAccount = await client.admin.organization.projects.serviceAccounts.retrieve(\n 'service_account_id',\n { project_id: 'project_id' },\n);\n\nconsole.log(projectServiceAccount.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)\nproject_service_account = client.admin.organization.projects.service_accounts.retrieve(\n service_account_id=\"service_account_id\",\n project_id=\"project_id\",\n)\nprint(project_service_account.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\tprojectServiceAccount, err := client.Admin.Organization.Projects.ServiceAccounts.Get(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\t\"service_account_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectServiceAccount.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.projects.serviceaccounts.ProjectServiceAccount;\nimport com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ServiceAccountRetrieveParams params = ServiceAccountRetrieveParams.builder()\n .projectId(\"project_id\")\n .serviceAccountId(\"service_account_id\")\n .build();\n ProjectServiceAccount projectServiceAccount = client.admin().organization().projects().serviceAccounts().retrieve(params);\n }\n}" ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(admin_api_key: \"My Admin API Key\")\n\nproject_service_account = openai.admin.organization.projects.service_accounts.retrieve(\n \"service_account_id\",\n project_id: \"project_id\"\n)\n\nputs(project_service_account)" response: "{\n \"object\": \"organization.project.service_account\",\n \"id\": \"svc_acct_abc\",\n \"name\": \"Service Account\",\n \"role\": \"owner\",\n \"created_at\": 1711471533\n}\n" delete: security: - AdminApiKeyAuth: [] summary: 'Deletes a service account from the project. Returns confirmation of service account deletion, or an error if the project is archived (archived projects have no service accounts). ' operationId: delete-project-service-account tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: service_account_id in: path description: The ID of the service account. required: true schema: type: string responses: '200': description: Project service account deleted successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectServiceAccountDeleteResponse' x-oaiMeta: name: Delete project service account group: administration examples: request: curl: "curl -X DELETE https://api.openai.com/v1/organization/projects/proj_abc/service_accounts/svc_acct_abc \\\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 serviceAccount = await client.admin.organization.projects.serviceAccounts.delete(\n 'service_account_id',\n { project_id: 'project_id' },\n);\n\nconsole.log(serviceAccount.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)\nservice_account = client.admin.organization.projects.service_accounts.delete(\n service_account_id=\"service_account_id\",\n project_id=\"project_id\",\n)\nprint(service_account.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\tserviceAccount, err := client.Admin.Organization.Projects.ServiceAccounts.Delete(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\t\"service_account_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", serviceAccount.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.projects.serviceaccounts.ServiceAccountDeleteParams;\nimport com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ServiceAccountDeleteParams params = ServiceAccountDeleteParams.builder()\n .projectId(\"project_id\")\n .serviceAccountId(\"service_account_id\")\n .build();\n ServiceAccountDeleteResponse serviceAccount = client.admin().organization().projects().serviceAccounts().delete(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") service_account = openai.admin.organization.projects.service_accounts.delete("service_account_id", project_id: "project_id") puts(service_account)' response: "{\n \"object\": \"organization.project.service_account.deleted\",\n \"id\": \"svc_acct_abc\",\n \"deleted\": true\n}\n" /organization/projects/{project_id}/users: get: security: - AdminApiKeyAuth: [] summary: Returns a list of users in the project. operationId: list-project-users tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: limit in: query description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ' required: false schema: type: integer default: 20 - name: after in: query description: 'A cursor for use in pagination. `after` is 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. ' required: false schema: type: string responses: '200': description: Project users listed successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectUserListResponse' '400': description: Error response when project is archived. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-oaiMeta: name: List project users group: administration examples: request: curl: "curl https://api.openai.com/v1/organization/projects/proj_abc/users?after=user_abc&limit=20 \\\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 projectUser of client.admin.organization.projects.users.list('project_id')) {\n console.log(projectUser.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.projects.users.list(\n project_id=\"project_id\",\n)\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.Projects.Users.List(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\topenai.AdminOrganizationProjectUserListParams{},\n\t)\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.projects.users.UserListPage;\nimport com.openai.models.admin.organization.projects.users.UserListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n UserListPage page = client.admin().organization().projects().users().list(\"project_id\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") page = openai.admin.organization.projects.users.list("project_id") puts(page)' response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"organization.project.user\",\n \"id\": \"user_abc\",\n \"name\": \"First Last\",\n \"email\": \"user@example.com\",\n \"role\": \"owner\",\n \"added_at\": 1711471533\n }\n ],\n \"first_id\": \"user-abc\",\n \"last_id\": \"user-xyz\",\n \"has_more\": false\n}\n" post: security: - AdminApiKeyAuth: [] summary: Adds a user to the project. Users must already be members of the organization to be added to a project. operationId: create-project-user parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string tags: - Projects requestBody: description: The project user create request payload. required: true content: application/json: schema: $ref: '#/components/schemas/ProjectUserCreateRequest' responses: '200': description: User added to project successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectUser' '400': description: Error response for various conditions. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-oaiMeta: name: Create project user group: administration examples: request: curl: "curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/users \\\n -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"user_id\": \"user_abc\",\n \"role\": \"member\"\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 projectUser = await client.admin.organization.projects.users.create('project_id', {\n role: 'role',\n});\n\nconsole.log(projectUser.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)\nproject_user = client.admin.organization.projects.users.create(\n project_id=\"project_id\",\n role=\"role\",\n)\nprint(project_user.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\tprojectUser, err := client.Admin.Organization.Projects.Users.New(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\topenai.AdminOrganizationProjectUserNewParams{\n\t\t\tRole: \"role\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectUser.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.projects.users.ProjectUser;\nimport com.openai.models.admin.organization.projects.users.UserCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n UserCreateParams params = UserCreateParams.builder()\n .projectId(\"project_id\")\n .role(\"role\")\n .build();\n ProjectUser projectUser = client.admin().organization().projects().users().create(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") project_user = openai.admin.organization.projects.users.create("project_id", role: "role") puts(project_user)' response: "{\n \"object\": \"organization.project.user\",\n \"id\": \"user_abc\",\n \"email\": \"user@example.com\",\n \"role\": \"owner\",\n \"added_at\": 1711471533\n}\n" /organization/projects/{project_id}/users/{user_id}: get: security: - AdminApiKeyAuth: [] summary: Retrieves a user in the project. operationId: retrieve-project-user tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: user_id in: path description: The ID of the user. required: true schema: type: string responses: '200': description: Project user retrieved successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectUser' x-oaiMeta: name: Retrieve project user group: administration examples: request: curl: "curl https://api.openai.com/v1/organization/projects/proj_abc/users/user_abc \\\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 projectUser = await client.admin.organization.projects.users.retrieve('user_id', {\n project_id: 'project_id',\n});\n\nconsole.log(projectUser.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)\nproject_user = client.admin.organization.projects.users.retrieve(\n user_id=\"user_id\",\n project_id=\"project_id\",\n)\nprint(project_user.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\tprojectUser, err := client.Admin.Organization.Projects.Users.Get(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\t\"user_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectUser.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.projects.users.ProjectUser;\nimport com.openai.models.admin.organization.projects.users.UserRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n UserRetrieveParams params = UserRetrieveParams.builder()\n .projectId(\"project_id\")\n .userId(\"user_id\")\n .build();\n ProjectUser projectUser = client.admin().organization().projects().users().retrieve(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") project_user = openai.admin.organization.projects.users.retrieve("user_id", project_id: "project_id") puts(project_user)' response: "{\n \"object\": \"organization.project.user\",\n \"id\": \"user_abc\",\n \"name\": \"First Last\",\n \"email\": \"user@example.com\",\n \"role\": \"owner\",\n \"added_at\": 1711471533\n}\n" post: security: - AdminApiKeyAuth: [] summary: Modifies a user's role in the project. operationId: modify-project-user tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: user_id in: path description: The ID of the user. required: true schema: type: string requestBody: description: The project user update request payload. required: true content: application/json: schema: $ref: '#/components/schemas/ProjectUserUpdateRequest' responses: '200': description: Project user's role updated successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectUser' '400': description: Error response for various conditions. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-oaiMeta: name: Modify project user group: administration examples: request: curl: "curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/users/user_abc \\\n -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"role\": \"owner\"\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 projectUser = await client.admin.organization.projects.users.update('user_id', {\n project_id: 'project_id',\n});\n\nconsole.log(projectUser.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)\nproject_user = client.admin.organization.projects.users.update(\n user_id=\"user_id\",\n project_id=\"project_id\",\n)\nprint(project_user.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\tprojectUser, err := client.Admin.Organization.Projects.Users.Update(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\t\"user_id\",\n\t\topenai.AdminOrganizationProjectUserUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectUser.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.projects.users.ProjectUser;\nimport com.openai.models.admin.organization.projects.users.UserUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n UserUpdateParams params = UserUpdateParams.builder()\n .projectId(\"project_id\")\n .userId(\"user_id\")\n .build();\n ProjectUser projectUser = client.admin().organization().projects().users().update(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") project_user = openai.admin.organization.projects.users.update("user_id", project_id: "project_id") puts(project_user)' response: "{\n \"object\": \"organization.project.user\",\n \"id\": \"user_abc\",\n \"name\": \"First Last\",\n \"email\": \"user@example.com\",\n \"role\": \"owner\",\n \"added_at\": 1711471533\n}\n" delete: security: - AdminApiKeyAuth: [] summary: 'Deletes a user from the project. Returns confirmation of project user deletion, or an error if the project is archived (archived projects have no users). ' operationId: delete-project-user tags: - Projects parameters: - name: project_id in: path description: The ID of the project. required: true schema: type: string - name: user_id in: path description: The ID of the user. required: true schema: type: string responses: '200': description: Project user deleted successfully. content: application/json: schema: $ref: '#/components/schemas/ProjectUserDeleteResponse' '400': description: Error response for various conditions. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-oaiMeta: name: Delete project user group: administration examples: request: curl: "curl -X DELETE https://api.openai.com/v1/organization/projects/proj_abc/users/user_abc \\\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 user = await client.admin.organization.projects.users.delete('user_id', {\n project_id: 'project_id',\n});\n\nconsole.log(user.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)\nuser = client.admin.organization.projects.users.delete(\n user_id=\"user_id\",\n project_id=\"project_id\",\n)\nprint(user.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\tuser, err := client.Admin.Organization.Projects.Users.Delete(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\t\"user_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", user.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.projects.users.UserDeleteParams;\nimport com.openai.models.admin.organization.projects.users.UserDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n UserDeleteParams params = UserDeleteParams.builder()\n .projectId(\"project_id\")\n .userId(\"user_id\")\n .build();\n UserDeleteResponse user = client.admin().organization().projects().users().delete(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") user = openai.admin.organization.projects.users.delete("user_id", project_id: "project_id") puts(user)' response: "{\n \"object\": \"organization.project.user.deleted\",\n \"id\": \"user_abc\",\n \"deleted\": true\n}\n" components: schemas: ProjectUser: type: object description: Represents an individual user in a project. properties: object: type: string enum: - organization.project.user description: The object type, which is always `organization.project.user` x-stainless-const: true id: type: string description: The identifier, which can be referenced in API endpoints name: anyOf: - type: string - type: 'null' description: The name of the user email: anyOf: - type: string - type: 'null' description: The email address of the user role: type: string description: '`owner` or `member`' added_at: type: integer format: unixtime description: The Unix timestamp (in seconds) of when the project was added. required: - object - id - role - added_at x-oaiMeta: name: The project user object example: "{\n \"object\": \"organization.project.user\",\n \"id\": \"user_abc\",\n \"name\": \"First Last\",\n \"email\": \"user@example.com\",\n \"role\": \"owner\",\n \"added_at\": 1711471533\n}\n" Project: type: object description: Represents an individual project. properties: id: type: string description: The identifier, which can be referenced in API endpoints object: type: string enum: - organization.project description: The object type, which is always `organization.project` x-stainless-const: true name: anyOf: - type: string - type: 'null' description: The name of the project. This appears in reporting. created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) of when the project was created. archived_at: anyOf: - type: integer format: unixtime description: The Unix timestamp (in seconds) of when the project was archived or `null`. - type: 'null' status: anyOf: - type: string - type: 'null' description: '`active` or `archived`' external_key_id: anyOf: - type: string - type: 'null' description: The external key associated with the project. required: - id - object - created_at x-oaiMeta: name: The project object example: "{\n \"id\": \"proj_abc\",\n \"object\": \"organization.project\",\n \"name\": \"Project example\",\n \"created_at\": 1711471533,\n \"archived_at\": null,\n \"status\": \"active\",\n \"external_key_id\": null\n}\n" ProjectApiKey: type: object description: Represents an individual API key in a project. properties: object: type: string enum: - organization.project.api_key description: The object type, which is always `organization.project.api_key` x-stainless-const: true redacted_value: type: string description: The redacted value of the API key name: type: string description: The name of the API key created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) of when the API key was created last_used_at: anyOf: - type: integer format: unixtime - type: 'null' description: The Unix timestamp (in seconds) of when the API key was last used. id: type: string description: The identifier, which can be referenced in API endpoints owner: type: object properties: type: type: string enum: - user - service_account description: '`user` or `service_account`' user: $ref: '#/components/schemas/ProjectApiKeyOwnerUser' service_account: $ref: '#/components/schemas/ProjectApiKeyOwnerServiceAccount' required: - object - redacted_value - name - created_at - last_used_at - id - owner x-oaiMeta: name: The project API key object example: "{\n \"object\": \"organization.project.api_key\",\n \"redacted_value\": \"sk-abc...def\",\n \"name\": \"My API Key\",\n \"created_at\": 1711471533,\n \"last_used_at\": 1711471534,\n \"id\": \"key_abc\",\n \"owner\": {\n \"type\": \"user\",\n \"user\": {\n \"id\": \"user_abc\",\n \"name\": \"First Last\",\n \"email\": \"user@example.com\",\n \"role\": \"owner\",\n \"created_at\": 1711471533\n }\n }\n}\n" ProjectUserUpdateRequest: type: object properties: role: anyOf: - type: string - type: 'null' description: '`owner` or `member`' Error: type: object properties: code: anyOf: - type: string - type: 'null' message: type: string param: anyOf: - type: string - type: 'null' type: type: string required: - type - message - param - code ErrorResponse: type: object properties: error: $ref: '#/components/schemas/Error' required: - error ProjectCreateRequest: type: object properties: name: type: string description: The friendly name of the project, this name appears in reports. geography: anyOf: - type: string - type: 'null' description: Create the project with the specified data residency region. Your organization must have access to Data residency functionality in order to use. See [data residency controls](/docs/guides/your-data#data-residency-controls) to review the functionality and limitations of setting this field. external_key_id: anyOf: - type: string - type: 'null' description: External key ID to associate with the project. required: - name ProjectApiKeyOwnerUser: type: object description: The user that owns a project API key. properties: id: type: string description: The identifier, which can be referenced in API endpoints email: type: string description: The email address of the user. name: type: string description: The name of the user. created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) of when the user was created. role: type: string description: The user's project role. required: - id - email - name - created_at - role ProjectServiceAccountApiKey: type: object properties: object: type: string enum: - organization.project.service_account.api_key description: The object type, which is always `organization.project.service_account.api_key` x-stainless-const: true value: type: string name: type: string created_at: type: integer format: unixtime id: type: string required: - object - value - name - created_at - id ProjectServiceAccountCreateRequest: type: object properties: name: type: string description: The name of the service account being created. required: - name ProjectApiKeyListResponse: type: object properties: object: type: string enum: - list x-stainless-const: true data: type: array items: $ref: '#/components/schemas/ProjectApiKey' first_id: anyOf: - type: string - type: 'null' last_id: anyOf: - type: string - type: 'null' has_more: type: boolean required: - object - data - has_more ProjectRateLimit: type: object description: Represents a project rate limit config. properties: object: type: string enum: - project.rate_limit description: The object type, which is always `project.rate_limit` x-stainless-const: true id: type: string description: The identifier, which can be referenced in API endpoints. model: type: string description: The model this rate limit applies to. max_requests_per_1_minute: type: integer description: The maximum requests per minute. max_tokens_per_1_minute: type: integer description: The maximum tokens per minute. max_images_per_1_minute: type: integer description: The maximum images per minute. Only present for relevant models. max_audio_megabytes_per_1_minute: type: integer description: The maximum audio megabytes per minute. Only present for relevant models. max_requests_per_1_day: type: integer description: The maximum requests per day. Only present for relevant models. batch_1_day_max_input_tokens: type: integer description: The maximum batch input tokens per day. Only present for relevant models. required: - object - id - model - max_requests_per_1_minute - max_tokens_per_1_minute x-oaiMeta: name: The project rate limit object example: "{\n \"object\": \"project.rate_limit\",\n \"id\": \"rl_ada\",\n \"model\": \"ada\",\n \"max_requests_per_1_minute\": 600,\n \"max_tokens_per_1_minute\": 150000,\n \"max_images_per_1_minute\": 10\n}\n" ProjectRateLimitListResponse: type: object properties: object: type: string enum: - list x-stainless-const: true data: type: array items: $ref: '#/components/schemas/ProjectRateLimit' first_id: anyOf: - type: string - type: 'null' last_id: anyOf: - type: string - type: 'null' has_more: type: boolean required: - object - data - has_more ProjectUserListResponse: type: object properties: object: type: string data: type: array items: $ref: '#/components/schemas/ProjectUser' first_id: anyOf: - type: string - type: 'null' last_id: anyOf: - type: string - type: 'null' has_more: type: boolean required: - object - data - has_more ProjectServiceAccountListResponse: type: object properties: object: type: string enum: - list x-stainless-const: true data: type: array items: $ref: '#/components/schemas/ProjectServiceAccount' first_id: anyOf: - type: string - type: 'null' last_id: anyOf: - type: string - type: 'null' has_more: type: boolean required: - object - data - has_more ProjectServiceAccountCreateResponse: type: object properties: object: type: string enum: - organization.project.service_account x-stainless-const: true id: type: string name: type: string role: type: string enum: - member description: Service accounts can only have one role of type `member` x-stainless-const: true created_at: type: integer format: unixtime api_key: anyOf: - $ref: '#/components/schemas/ProjectServiceAccountApiKey' - type: 'null' required: - object - id - name - role - created_at - api_key ProjectUpdateRequest: type: object properties: name: anyOf: - type: string - type: 'null' description: The updated name of the project, this name appears in reports. external_key_id: anyOf: - type: string - type: 'null' description: External key ID to associate with the project. geography: anyOf: - type: string - type: 'null' description: Geography for the project. ProjectRateLimitUpdateRequest: type: object properties: max_requests_per_1_minute: type: integer description: The maximum requests per minute. max_tokens_per_1_minute: type: integer description: The maximum tokens per minute. max_images_per_1_minute: type: integer description: The maximum images per minute. Only relevant for certain models. max_audio_megabytes_per_1_minute: type: integer description: The maximum audio megabytes per minute. Only relevant for certain models. max_requests_per_1_day: type: integer description: The maximum requests per day. Only relevant for certain models. batch_1_day_max_input_tokens: type: integer description: The maximum batch input tokens per day. Only relevant for certain models. ProjectUserCreateRequest: type: object properties: user_id: anyOf: - type: string - type: 'null' description: The ID of the user. email: anyOf: - type: string - type: 'null' description: Email of the user to add. role: type: string description: '`owner` or `member`' required: - role ProjectListResponse: type: object properties: object: type: string enum: - list x-stainless-const: true data: type: array items: $ref: '#/components/schemas/Project' first_id: anyOf: - type: string - type: 'null' last_id: anyOf: - type: string - type: 'null' has_more: type: boolean required: - object - data - has_more ProjectServiceAccount: type: object description: Represents an individual service account in a project. properties: object: type: string enum: - organization.project.service_account description: The object type, which is always `organization.project.service_account` x-stainless-const: true id: type: string description: The identifier, which can be referenced in API endpoints name: type: string description: The name of the service account role: type: string enum: - owner - member description: '`owner` or `member`' created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) of when the service account was created required: - object - id - name - role - created_at x-oaiMeta: name: The project service account object example: "{\n \"object\": \"organization.project.service_account\",\n \"id\": \"svc_acct_abc\",\n \"name\": \"Service Account\",\n \"role\": \"owner\",\n \"created_at\": 1711471533\n}\n" ProjectApiKeyOwnerServiceAccount: type: object description: The service account that owns a project API key. properties: id: type: string description: The identifier, which can be referenced in API endpoints name: type: string description: The name of the service account. created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) of when the service account was created. role: type: string description: The service account's project role. required: - id - name - created_at - role ProjectUserDeleteResponse: type: object properties: object: type: string enum: - organization.project.user.deleted x-stainless-const: true id: type: string deleted: type: boolean required: - object - id - deleted ProjectServiceAccountDeleteResponse: type: object properties: object: type: string enum: - organization.project.service_account.deleted x-stainless-const: true id: type: string deleted: type: boolean required: - object - id - deleted ProjectApiKeyDeleteResponse: type: object properties: object: type: string enum: - organization.project.api_key.deleted x-stainless-const: true id: type: string deleted: type: boolean required: - object - id - deleted 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