diff --git a/en/resources/organization/index.md b/en/resources/admin/subresources/organization/index.md similarity index 93% rename from en/resources/organization/index.md rename to en/resources/admin/subresources/organization/index.md index 8b7d052..02f38c4 100644 --- a/en/resources/organization/index.md +++ b/en/resources/admin/subresources/organization/index.md @@ -1068,7 +1068,7 @@ List user actions and configuration changes within this organization. ```http curl https://api.openai.com/v1/organization/audit_logs \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -1448,1330 +1448,1531 @@ curl https://api.openai.com/v1/organization/audit_logs \ } ``` -## Costs +## Domain Types -**get** `/organization/costs` +### Audit Log List Response -Get costs details for the organization. +- `AuditLogListResponse object { id, actor, effective_at, 49 more }` -### Query Parameters + A log of a user action or configuration change within this organization. -- `start_time: number` + - `id: string` - Start time (Unix seconds) of the query time range, inclusive. + The ID of this log. -- `bucket_width: optional "1d"` + - `actor: object { api_key, session, type }` - Width of each time bucket in response. Currently only `1d` is supported, default to `1d`. + The actor who performed the audit logged action. - - `"1d"` + - `api_key: optional object { id, service_account, type, user }` -- `end_time: optional number` + The API Key used to perform the audit logged action. - End time (Unix seconds) of the query time range, exclusive. + - `id: optional string` -- `group_by: optional array of "project_id" or "line_item"` + The tracking id of the API key. - Group the costs by the specified fields. Support fields include `project_id`, `line_item` and any combination of them. + - `service_account: optional object { id }` - - `"project_id"` + The service account that performed the audit logged action. - - `"line_item"` + - `id: optional string` -- `limit: optional number` + The service account id. - A limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7. + - `type: optional "user" or "service_account"` -- `page: optional string` + The type of API key. Can be either `user` or `service_account`. - A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + - `"user"` -- `project_ids: optional array of string` + - `"service_account"` - Return only costs for these projects. + - `user: optional object { id, email }` -### Returns + The user who performed the audit logged action. -- `data: array of object { end_time, object, result, start_time }` + - `id: optional string` - - `end_time: number` + The user id. - - `object: "bucket"` + - `email: optional string` - - `"bucket"` + The user email. - - `result: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 6 more` + - `session: optional object { ip_address, user }` - - `UsageCompletionsResult object { input_tokens, num_model_requests, object, 10 more }` + The session in which the audit logged action was performed. - The aggregated completions usage details of the specific time bucket. + - `ip_address: optional string` - - `input_tokens: number` + The IP address from which the action was performed. - The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens. + - `user: optional object { id, email }` - - `num_model_requests: number` + The user who performed the audit logged action. - The count of requests made to the model. + - `id: optional string` - - `object: "organization.usage.completions.result"` + The user id. - - `"organization.usage.completions.result"` + - `email: optional string` - - `output_tokens: number` + The user email. - The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens. + - `type: optional "session" or "api_key"` - - `api_key_id: optional string` + The type of actor. Is either `session` or `api_key`. - When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + - `"session"` - - `batch: optional boolean` + - `"api_key"` - When `group_by=batch`, this field tells whether the grouped usage result is batch or not. + - `effective_at: number` - - `input_audio_tokens: optional number` + The Unix timestamp (in seconds) of the event. - The aggregated number of audio input tokens used, including cached tokens. + - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 48 more` - - `input_cached_tokens: optional number` + The event type. - The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens. + - `"api_key.created"` - - `model: optional string` + - `"api_key.updated"` - When `group_by=model`, this field provides the model name of the grouped usage result. + - `"api_key.deleted"` - - `output_audio_tokens: optional number` + - `"certificate.created"` - The aggregated number of audio output tokens used. + - `"certificate.updated"` - - `project_id: optional string` + - `"certificate.deleted"` - When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `"certificates.activated"` - - `service_tier: optional string` + - `"certificates.deactivated"` - When `group_by=service_tier`, this field provides the service tier of the grouped usage result. + - `"checkpoint.permission.created"` - - `user_id: optional string` + - `"checkpoint.permission.deleted"` - When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `"external_key.registered"` - - `UsageEmbeddingsResult object { input_tokens, num_model_requests, object, 4 more }` + - `"external_key.removed"` - The aggregated embeddings usage details of the specific time bucket. + - `"group.created"` - - `input_tokens: number` + - `"group.updated"` - The aggregated number of input tokens used. + - `"group.deleted"` - - `num_model_requests: number` + - `"invite.sent"` - The count of requests made to the model. + - `"invite.accepted"` - - `object: "organization.usage.embeddings.result"` + - `"invite.deleted"` - - `"organization.usage.embeddings.result"` + - `"ip_allowlist.created"` - - `api_key_id: optional string` + - `"ip_allowlist.updated"` - When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + - `"ip_allowlist.deleted"` - - `model: optional string` + - `"ip_allowlist.config.activated"` - When `group_by=model`, this field provides the model name of the grouped usage result. + - `"ip_allowlist.config.deactivated"` - - `project_id: optional string` + - `"login.succeeded"` - When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `"login.failed"` - - `user_id: optional string` + - `"logout.succeeded"` - When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `"logout.failed"` - - `UsageModerationsResult object { input_tokens, num_model_requests, object, 4 more }` + - `"organization.updated"` - The aggregated moderations usage details of the specific time bucket. + - `"project.created"` - - `input_tokens: number` + - `"project.updated"` - The aggregated number of input tokens used. + - `"project.archived"` - - `num_model_requests: number` + - `"project.deleted"` - The count of requests made to the model. + - `"rate_limit.updated"` - - `object: "organization.usage.moderations.result"` + - `"rate_limit.deleted"` - - `"organization.usage.moderations.result"` + - `"resource.deleted"` - - `api_key_id: optional string` + - `"tunnel.created"` - When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + - `"tunnel.updated"` - - `model: optional string` + - `"tunnel.deleted"` - When `group_by=model`, this field provides the model name of the grouped usage result. + - `"role.created"` - - `project_id: optional string` + - `"role.updated"` - When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `"role.deleted"` - - `user_id: optional string` + - `"role.assignment.created"` - When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `"role.assignment.deleted"` - - `UsageImagesResult object { images, num_model_requests, object, 6 more }` + - `"scim.enabled"` - The aggregated images usage details of the specific time bucket. + - `"scim.disabled"` - - `images: number` + - `"service_account.created"` - The number of images processed. + - `"service_account.updated"` - - `num_model_requests: number` + - `"service_account.deleted"` - The count of requests made to the model. + - `"user.added"` - - `object: "organization.usage.images.result"` + - `"user.updated"` - - `"organization.usage.images.result"` + - `"user.deleted"` - - `api_key_id: optional string` + - `"api_key.created": optional object { id, data }` - When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + The details for events with this `type`. - - `model: optional string` + - `id: optional string` - When `group_by=model`, this field provides the model name of the grouped usage result. + The tracking ID of the API key. - - `project_id: optional string` + - `data: optional object { scopes }` - When `group_by=project_id`, this field provides the project ID of the grouped usage result. + The payload used to create the API key. - - `size: optional string` + - `scopes: optional array of string` - When `group_by=size`, this field provides the image size of the grouped usage result. + A list of scopes allowed for the API key, e.g. `["api.model.request"]` - - `source: optional string` + - `"api_key.deleted": optional object { id }` - When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`. + The details for events with this `type`. - - `user_id: optional string` + - `id: optional string` - When `group_by=user_id`, this field provides the user ID of the grouped usage result. + The tracking ID of the API key. - - `UsageAudioSpeechesResult object { characters, num_model_requests, object, 4 more }` + - `"api_key.updated": optional object { id, changes_requested }` - The aggregated audio speeches usage details of the specific time bucket. + The details for events with this `type`. - - `characters: number` + - `id: optional string` - The number of characters processed. + The tracking ID of the API key. - - `num_model_requests: number` + - `changes_requested: optional object { scopes }` - The count of requests made to the model. + The payload used to update the API key. - - `object: "organization.usage.audio_speeches.result"` + - `scopes: optional array of string` - - `"organization.usage.audio_speeches.result"` + A list of scopes allowed for the API key, e.g. `["api.model.request"]` - - `api_key_id: optional string` + - `"certificate.created": optional object { id, name }` - When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + The details for events with this `type`. - - `model: optional string` + - `id: optional string` - When `group_by=model`, this field provides the model name of the grouped usage result. + The certificate ID. - - `project_id: optional string` + - `name: optional string` - When `group_by=project_id`, this field provides the project ID of the grouped usage result. + The name of the certificate. - - `user_id: optional string` + - `"certificate.deleted": optional object { id, certificate, name }` - When `group_by=user_id`, this field provides the user ID of the grouped usage result. + The details for events with this `type`. - - `UsageAudioTranscriptionsResult object { num_model_requests, object, seconds, 4 more }` + - `id: optional string` - The aggregated audio transcriptions usage details of the specific time bucket. + The certificate ID. - - `num_model_requests: number` + - `certificate: optional string` - The count of requests made to the model. + The certificate content in PEM format. - - `object: "organization.usage.audio_transcriptions.result"` + - `name: optional string` - - `"organization.usage.audio_transcriptions.result"` + The name of the certificate. - - `seconds: number` - - The number of seconds processed. + - `"certificate.updated": optional object { id, name }` - - `api_key_id: optional string` + The details for events with this `type`. - When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + - `id: optional string` - - `model: optional string` + The certificate ID. - When `group_by=model`, this field provides the model name of the grouped usage result. + - `name: optional string` - - `project_id: optional string` + The name of the certificate. - When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `"certificates.activated": optional object { certificates }` - - `user_id: optional string` + The details for events with this `type`. - When `group_by=user_id`, this field provides the user ID of the grouped usage result. + - `certificates: optional array of object { id, name }` - - `UsageVectorStoresResult object { object, usage_bytes, project_id }` + - `id: optional string` - The aggregated vector stores usage details of the specific time bucket. + The certificate ID. - - `object: "organization.usage.vector_stores.result"` + - `name: optional string` - - `"organization.usage.vector_stores.result"` + The name of the certificate. - - `usage_bytes: number` + - `"certificates.deactivated": optional object { certificates }` - The vector stores usage in bytes. + The details for events with this `type`. - - `project_id: optional string` + - `certificates: optional array of object { id, name }` - When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `id: optional string` - - `UsageCodeInterpreterSessionsResult object { object, num_sessions, project_id }` + The certificate ID. - The aggregated code interpreter sessions usage details of the specific time bucket. + - `name: optional string` - - `object: "organization.usage.code_interpreter_sessions.result"` + The name of the certificate. - - `"organization.usage.code_interpreter_sessions.result"` + - `"checkpoint.permission.created": optional object { id, data }` - - `num_sessions: optional number` + The project and fine-tuned model checkpoint that the checkpoint permission was created for. - The number of code interpreter sessions. + - `id: optional string` - - `project_id: optional string` + The ID of the checkpoint permission. - When `group_by=project_id`, this field provides the project ID of the grouped usage result. + - `data: optional object { fine_tuned_model_checkpoint, project_id }` - - `CostsResult object { object, amount, line_item, project_id }` + The payload used to create the checkpoint permission. - The aggregated costs details of the specific time bucket. + - `fine_tuned_model_checkpoint: optional string` - - `object: "organization.costs.result"` + The ID of the fine-tuned model checkpoint. - - `"organization.costs.result"` + - `project_id: optional string` - - `amount: optional object { currency, value }` + The ID of the project that the checkpoint permission was created for. - The monetary value in its associated currency. + - `"checkpoint.permission.deleted": optional object { id }` - - `currency: optional string` + The details for events with this `type`. - Lowercase ISO-4217 currency e.g. "usd" + - `id: optional string` - - `value: optional number` + The ID of the checkpoint permission. - The numeric value of the cost. + - `"external_key.registered": optional object { id, data }` - - `line_item: optional string` + The details for events with this `type`. - When `group_by=line_item`, this field provides the line item of the grouped costs result. + - `id: optional string` - - `project_id: optional string` + The ID of the external key configuration. - When `group_by=project_id`, this field provides the project ID of the grouped costs result. + - `data: optional unknown` - - `start_time: number` + The configuration for the external key. -- `has_more: boolean` + - `"external_key.removed": optional object { id }` -- `next_page: string` + The details for events with this `type`. -- `object: "page"` + - `id: optional string` - - `"page"` + The ID of the external key configuration. -### Example + - `"group.created": optional object { id, data }` -```http -curl https://api.openai.com/v1/organization/costs \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` + The details for events with this `type`. -#### Response + - `id: optional string` -```json -{ - "data": [ - { - "end_time": 0, - "object": "bucket", - "result": [ - { - "input_tokens": 0, - "num_model_requests": 0, - "object": "organization.usage.completions.result", - "output_tokens": 0, - "api_key_id": "api_key_id", - "batch": true, - "input_audio_tokens": 0, - "input_cached_tokens": 0, - "model": "model", - "output_audio_tokens": 0, - "project_id": "project_id", - "service_tier": "service_tier", - "user_id": "user_id" - } - ], - "start_time": 0 - } - ], - "has_more": true, - "next_page": "next_page", - "object": "page" -} -``` + The ID of the group. -### Example + - `data: optional object { group_name }` -```http -curl "https://api.openai.com/v1/organization/costs?start_time=1730419200&limit=1" \ --H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ --H "Content-Type: application/json" -``` + Information about the created group. -#### Response + - `group_name: optional string` -```json -{ - "object": "page", - "data": [ - { - "object": "bucket", - "start_time": 1730419200, - "end_time": 1730505600, - "results": [ - { - "object": "organization.costs.result", - "amount": { - "value": 0.06, - "currency": "usd" - }, - "line_item": null, - "project_id": null - } - ] - } - ], - "has_more": false, - "next_page": null -} -``` + The group name. -## Domain Types + - `"group.deleted": optional object { id }` -### Audit Log List Response + The details for events with this `type`. -- `AuditLogListResponse object { id, actor, effective_at, 49 more }` + - `id: optional string` - A log of a user action or configuration change within this organization. + The ID of the group. - - `id: string` + - `"group.updated": optional object { id, changes_requested }` - The ID of this log. + The details for events with this `type`. - - `actor: object { api_key, session, type }` + - `id: optional string` - The actor who performed the audit logged action. + The ID of the group. - - `api_key: optional object { id, service_account, type, user }` + - `changes_requested: optional object { group_name }` - The API Key used to perform the audit logged action. + The payload used to update the group. - - `id: optional string` + - `group_name: optional string` - The tracking id of the API key. + The updated group name. - - `service_account: optional object { id }` + - `"invite.accepted": optional object { id }` - The service account that performed the audit logged action. + The details for events with this `type`. - `id: optional string` - The service account id. + The ID of the invite. - - `type: optional "user" or "service_account"` + - `"invite.deleted": optional object { id }` - The type of API key. Can be either `user` or `service_account`. + The details for events with this `type`. - - `"user"` + - `id: optional string` - - `"service_account"` + The ID of the invite. - - `user: optional object { id, email }` + - `"invite.sent": optional object { id, data }` - The user who performed the audit logged action. + The details for events with this `type`. - `id: optional string` - The user id. + The ID of the invite. + + - `data: optional object { email, role }` + + The payload used to create the invite. - `email: optional string` - The user email. + The email invited to the organization. - - `session: optional object { ip_address, user }` + - `role: optional string` - The session in which the audit logged action was performed. + The role the email was invited to be. Is either `owner` or `member`. - - `ip_address: optional string` + - `"ip_allowlist.config.activated": optional object { configs }` - The IP address from which the action was performed. + The details for events with this `type`. - - `user: optional object { id, email }` + - `configs: optional array of object { id, name }` - The user who performed the audit logged action. + The configurations that were activated. - `id: optional string` - The user id. + The ID of the IP allowlist configuration. - - `email: optional string` + - `name: optional string` - The user email. + The name of the IP allowlist configuration. - - `type: optional "session" or "api_key"` + - `"ip_allowlist.config.deactivated": optional object { configs }` - The type of actor. Is either `session` or `api_key`. + The details for events with this `type`. - - `"session"` + - `configs: optional array of object { id, name }` - - `"api_key"` + The configurations that were deactivated. - - `effective_at: number` + - `id: optional string` - The Unix timestamp (in seconds) of the event. + The ID of the IP allowlist configuration. - - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 48 more` + - `name: optional string` - The event type. + The name of the IP allowlist configuration. - - `"api_key.created"` + - `"ip_allowlist.created": optional object { id, allowed_ips, name }` - - `"api_key.updated"` + The details for events with this `type`. - - `"api_key.deleted"` + - `id: optional string` - - `"certificate.created"` - - - `"certificate.updated"` + The ID of the IP allowlist configuration. - - `"certificate.deleted"` + - `allowed_ips: optional array of string` - - `"certificates.activated"` + The IP addresses or CIDR ranges included in the configuration. - - `"certificates.deactivated"` + - `name: optional string` - - `"checkpoint.permission.created"` + The name of the IP allowlist configuration. - - `"checkpoint.permission.deleted"` + - `"ip_allowlist.deleted": optional object { id, allowed_ips, name }` - - `"external_key.registered"` + The details for events with this `type`. - - `"external_key.removed"` + - `id: optional string` - - `"group.created"` + The ID of the IP allowlist configuration. - - `"group.updated"` + - `allowed_ips: optional array of string` - - `"group.deleted"` + The IP addresses or CIDR ranges that were in the configuration. - - `"invite.sent"` + - `name: optional string` - - `"invite.accepted"` + The name of the IP allowlist configuration. - - `"invite.deleted"` + - `"ip_allowlist.updated": optional object { id, allowed_ips }` - - `"ip_allowlist.created"` + The details for events with this `type`. - - `"ip_allowlist.updated"` + - `id: optional string` - - `"ip_allowlist.deleted"` + The ID of the IP allowlist configuration. - - `"ip_allowlist.config.activated"` + - `allowed_ips: optional array of string` - - `"ip_allowlist.config.deactivated"` + The updated set of IP addresses or CIDR ranges in the configuration. - - `"login.succeeded"` + - `"login.failed": optional object { error_code, error_message }` - - `"login.failed"` + The details for events with this `type`. - - `"logout.succeeded"` + - `error_code: optional string` - - `"logout.failed"` + The error code of the failure. - - `"organization.updated"` + - `error_message: optional string` - - `"project.created"` + The error message of the failure. - - `"project.updated"` + - `"login.succeeded": optional unknown` - - `"project.archived"` + This event has no additional fields beyond the standard audit log attributes. - - `"project.deleted"` + - `"logout.failed": optional object { error_code, error_message }` - - `"rate_limit.updated"` + The details for events with this `type`. - - `"rate_limit.deleted"` + - `error_code: optional string` - - `"resource.deleted"` + The error code of the failure. - - `"tunnel.created"` + - `error_message: optional string` - - `"tunnel.updated"` + The error message of the failure. - - `"tunnel.deleted"` + - `"logout.succeeded": optional unknown` - - `"role.created"` + This event has no additional fields beyond the standard audit log attributes. - - `"role.updated"` + - `"organization.updated": optional object { id, changes_requested }` - - `"role.deleted"` + The details for events with this `type`. - - `"role.assignment.created"` + - `id: optional string` - - `"role.assignment.deleted"` + The organization ID. - - `"scim.enabled"` + - `changes_requested: optional object { api_call_logging, api_call_logging_project_ids, description, 4 more }` - - `"scim.disabled"` + The payload used to update the organization settings. - - `"service_account.created"` + - `api_call_logging: optional string` - - `"service_account.updated"` + How your organization logs data from supported API calls. One of `disabled`, `enabled_per_call`, `enabled_for_all_projects`, or `enabled_for_selected_projects` - - `"service_account.deleted"` + - `api_call_logging_project_ids: optional string` - - `"user.added"` + The list of project ids if api_call_logging is set to `enabled_for_selected_projects` - - `"user.updated"` + - `description: optional string` - - `"user.deleted"` + The organization description. - - `"api_key.created": optional object { id, data }` + - `name: optional string` - The details for events with this `type`. + The organization name. - - `id: optional string` + - `threads_ui_visibility: optional string` - The tracking ID of the API key. + Visibility of the threads page which shows messages created with the Assistants API and Playground. One of `ANY_ROLE`, `OWNERS`, or `NONE`. - - `data: optional object { scopes }` + - `title: optional string` - The payload used to create the API key. + The organization title. - - `scopes: optional array of string` + - `usage_dashboard_visibility: optional string` - A list of scopes allowed for the API key, e.g. `["api.model.request"]` + Visibility of the usage dashboard which shows activity and costs for your organization. One of `ANY_ROLE` or `OWNERS`. - - `"api_key.deleted": optional object { id }` + - `project: optional object { id, name }` - The details for events with this `type`. + The project that the action was scoped to. Absent for actions not scoped to projects. Note that any admin actions taken via Admin API keys are associated with the default project. - `id: optional string` - The tracking ID of the API key. - - - `"api_key.updated": optional object { id, changes_requested }` - - The details for events with this `type`. + The project ID. - - `id: optional string` + - `name: optional string` - The tracking ID of the API key. + The project title. - - `changes_requested: optional object { scopes }` + - `"project.archived": optional object { id }` - The payload used to update the API key. + The details for events with this `type`. - - `scopes: optional array of string` + - `id: optional string` - A list of scopes allowed for the API key, e.g. `["api.model.request"]` + The project ID. - - `"certificate.created": optional object { id, name }` + - `"project.created": optional object { id, data }` The details for events with this `type`. - `id: optional string` - The certificate ID. + The project ID. - - `name: optional string` + - `data: optional object { name, title }` - The name of the certificate. + The payload used to create the project. - - `"certificate.deleted": optional object { id, certificate, name }` + - `name: optional string` - The details for events with this `type`. + The project name. - - `id: optional string` + - `title: optional string` - The certificate ID. + The title of the project as seen on the dashboard. - - `certificate: optional string` + - `"project.deleted": optional object { id }` - The certificate content in PEM format. + The details for events with this `type`. - - `name: optional string` + - `id: optional string` - The name of the certificate. + The project ID. - - `"certificate.updated": optional object { id, name }` + - `"project.updated": optional object { id, changes_requested }` The details for events with this `type`. - `id: optional string` - The certificate ID. - - - `name: optional string` + The project ID. - The name of the certificate. + - `changes_requested: optional object { title }` - - `"certificates.activated": optional object { certificates }` + The payload used to update the project. - The details for events with this `type`. + - `title: optional string` - - `certificates: optional array of object { id, name }` + The title of the project as seen on the dashboard. - - `id: optional string` + - `"rate_limit.deleted": optional object { id }` - The certificate ID. + The details for events with this `type`. - - `name: optional string` + - `id: optional string` - The name of the certificate. + The rate limit ID - - `"certificates.deactivated": optional object { certificates }` + - `"rate_limit.updated": optional object { id, changes_requested }` The details for events with this `type`. - - `certificates: optional array of object { id, name }` - - `id: optional string` - The certificate ID. + The rate limit ID - - `name: optional string` + - `changes_requested: optional object { batch_1_day_max_input_tokens, max_audio_megabytes_per_1_minute, max_images_per_1_minute, 3 more }` - The name of the certificate. + The payload used to update the rate limits. - - `"checkpoint.permission.created": optional object { id, data }` + - `batch_1_day_max_input_tokens: optional number` - The project and fine-tuned model checkpoint that the checkpoint permission was created for. + The maximum batch input tokens per day. Only relevant for certain models. - - `id: optional string` + - `max_audio_megabytes_per_1_minute: optional number` - The ID of the checkpoint permission. + The maximum audio megabytes per minute. Only relevant for certain models. - - `data: optional object { fine_tuned_model_checkpoint, project_id }` + - `max_images_per_1_minute: optional number` - The payload used to create the checkpoint permission. + The maximum images per minute. Only relevant for certain models. - - `fine_tuned_model_checkpoint: optional string` + - `max_requests_per_1_day: optional number` - The ID of the fine-tuned model checkpoint. + The maximum requests per day. Only relevant for certain models. - - `project_id: optional string` + - `max_requests_per_1_minute: optional number` - The ID of the project that the checkpoint permission was created for. + The maximum requests per minute. - - `"checkpoint.permission.deleted": optional object { id }` + - `max_tokens_per_1_minute: optional number` + + The maximum tokens per minute. + + - `"role.assignment.created": optional object { id, principal_id, principal_type, 2 more }` The details for events with this `type`. - `id: optional string` - The ID of the checkpoint permission. + The identifier of the role assignment. - - `"external_key.registered": optional object { id, data }` + - `principal_id: optional string` - The details for events with this `type`. + The principal (user or group) that received the role. - - `id: optional string` + - `principal_type: optional string` - The ID of the external key configuration. + The type of principal (user or group) that received the role. - - `data: optional unknown` + - `resource_id: optional string` - The configuration for the external key. + The resource the role assignment is scoped to. - - `"external_key.removed": optional object { id }` + - `resource_type: optional string` + + The type of resource the role assignment is scoped to. + + - `"role.assignment.deleted": optional object { id, principal_id, principal_type, 2 more }` The details for events with this `type`. - `id: optional string` - The ID of the external key configuration. + The identifier of the role assignment. - - `"group.created": optional object { id, data }` + - `principal_id: optional string` - The details for events with this `type`. + The principal (user or group) that had the role removed. - - `id: optional string` + - `principal_type: optional string` - The ID of the group. + The type of principal (user or group) that had the role removed. - - `data: optional object { group_name }` + - `resource_id: optional string` - Information about the created group. + The resource the role assignment was scoped to. - - `group_name: optional string` + - `resource_type: optional string` - The group name. + The type of resource the role assignment was scoped to. - - `"group.deleted": optional object { id }` + - `"role.created": optional object { id, permissions, resource_id, 2 more }` The details for events with this `type`. - `id: optional string` - The ID of the group. + The role ID. - - `"group.updated": optional object { id, changes_requested }` + - `permissions: optional array of string` - The details for events with this `type`. + The permissions granted by the role. - - `id: optional string` + - `resource_id: optional string` - The ID of the group. + The resource the role is scoped to. - - `changes_requested: optional object { group_name }` + - `resource_type: optional string` - The payload used to update the group. + The type of resource the role belongs to. - - `group_name: optional string` + - `role_name: optional string` - The updated group name. + The name of the role. - - `"invite.accepted": optional object { id }` + - `"role.deleted": optional object { id }` The details for events with this `type`. - `id: optional string` - The ID of the invite. + The role ID. - - `"invite.deleted": optional object { id }` + - `"role.updated": optional object { id, changes_requested }` The details for events with this `type`. - `id: optional string` - The ID of the invite. - - - `"invite.sent": optional object { id, data }` - - The details for events with this `type`. + The role ID. - - `id: optional string` + - `changes_requested: optional object { description, metadata, permissions_added, 4 more }` - The ID of the invite. + The payload used to update the role. - - `data: optional object { email, role }` + - `description: optional string` - The payload used to create the invite. + The updated role description, when provided. - - `email: optional string` + - `metadata: optional unknown` - The email invited to the organization. + Additional metadata stored on the role. - - `role: optional string` + - `permissions_added: optional array of string` - The role the email was invited to be. Is either `owner` or `member`. + The permissions added to the role. - - `"ip_allowlist.config.activated": optional object { configs }` + - `permissions_removed: optional array of string` - The details for events with this `type`. + The permissions removed from the role. - - `configs: optional array of object { id, name }` + - `resource_id: optional string` - The configurations that were activated. + The resource the role is scoped to. - - `id: optional string` + - `resource_type: optional string` - The ID of the IP allowlist configuration. + The type of resource the role belongs to. - - `name: optional string` + - `role_name: optional string` - The name of the IP allowlist configuration. + The updated role name, when provided. - - `"ip_allowlist.config.deactivated": optional object { configs }` + - `"scim.disabled": optional object { id }` The details for events with this `type`. - - `configs: optional array of object { id, name }` - - The configurations that were deactivated. - - `id: optional string` - The ID of the IP allowlist configuration. - - - `name: optional string` - - The name of the IP allowlist configuration. + The ID of the SCIM was disabled for. - - `"ip_allowlist.created": optional object { id, allowed_ips, name }` + - `"scim.enabled": optional object { id }` The details for events with this `type`. - `id: optional string` - The ID of the IP allowlist configuration. - - - `allowed_ips: optional array of string` - - The IP addresses or CIDR ranges included in the configuration. - - - `name: optional string` - - The name of the IP allowlist configuration. + The ID of the SCIM was enabled for. - - `"ip_allowlist.deleted": optional object { id, allowed_ips, name }` + - `"service_account.created": optional object { id, data }` The details for events with this `type`. - `id: optional string` - The ID of the IP allowlist configuration. + The service account ID. - - `allowed_ips: optional array of string` + - `data: optional object { role }` - The IP addresses or CIDR ranges that were in the configuration. + The payload used to create the service account. - - `name: optional string` + - `role: optional string` - The name of the IP allowlist configuration. + The role of the service account. Is either `owner` or `member`. - - `"ip_allowlist.updated": optional object { id, allowed_ips }` + - `"service_account.deleted": optional object { id }` The details for events with this `type`. - `id: optional string` - The ID of the IP allowlist configuration. - - - `allowed_ips: optional array of string` - - The updated set of IP addresses or CIDR ranges in the configuration. + The service account ID. - - `"login.failed": optional object { error_code, error_message }` + - `"service_account.updated": optional object { id, changes_requested }` The details for events with this `type`. - - `error_code: optional string` + - `id: optional string` - The error code of the failure. + The service account ID. - - `error_message: optional string` + - `changes_requested: optional object { role }` - The error message of the failure. + The payload used to updated the service account. - - `"login.succeeded": optional unknown` + - `role: optional string` - This event has no additional fields beyond the standard audit log attributes. + The role of the service account. Is either `owner` or `member`. - - `"logout.failed": optional object { error_code, error_message }` + - `"user.added": optional object { id, data }` The details for events with this `type`. - - `error_code: optional string` + - `id: optional string` - The error code of the failure. + The user ID. - - `error_message: optional string` + - `data: optional object { role }` - The error message of the failure. + The payload used to add the user to the project. - - `"logout.succeeded": optional unknown` + - `role: optional string` - This event has no additional fields beyond the standard audit log attributes. + The role of the user. Is either `owner` or `member`. - - `"organization.updated": optional object { id, changes_requested }` + - `"user.deleted": optional object { id }` The details for events with this `type`. - `id: optional string` - The organization ID. - - - `changes_requested: optional object { api_call_logging, api_call_logging_project_ids, description, 4 more }` - - The payload used to update the organization settings. - - - `api_call_logging: optional string` - - How your organization logs data from supported API calls. One of `disabled`, `enabled_per_call`, `enabled_for_all_projects`, or `enabled_for_selected_projects` + The user ID. - - `api_call_logging_project_ids: optional string` + - `"user.updated": optional object { id, changes_requested }` - The list of project ids if api_call_logging is set to `enabled_for_selected_projects` + The details for events with this `type`. - - `description: optional string` + - `id: optional string` - The organization description. + The project ID. - - `name: optional string` + - `changes_requested: optional object { role }` - The organization name. + The payload used to update the user. - - `threads_ui_visibility: optional string` + - `role: optional string` - Visibility of the threads page which shows messages created with the Assistants API and Playground. One of `ANY_ROLE`, `OWNERS`, or `NONE`. + The role of the user. Is either `owner` or `member`. - - `title: optional string` +# Admin API Keys - The organization title. +## List all organization and project API keys. - - `usage_dashboard_visibility: optional string` +**get** `/organization/admin_api_keys` - Visibility of the usage dashboard which shows activity and costs for your organization. One of `ANY_ROLE` or `OWNERS`. +List organization API keys - - `project: optional object { id, name }` +### Query Parameters - The project that the action was scoped to. Absent for actions not scoped to projects. Note that any admin actions taken via Admin API keys are associated with the default project. +- `after: optional string` - - `id: optional string` + Return keys with IDs that come after this ID in the pagination order. - The project ID. +- `limit: optional number` - - `name: optional string` + Maximum number of keys to return. - The project title. +- `order: optional "asc" or "desc"` - - `"project.archived": optional object { id }` + Order results by creation time, ascending or descending. - The details for events with this `type`. + - `"asc"` - - `id: optional string` + - `"desc"` - The project ID. +### Returns - - `"project.created": optional object { id, data }` +- `data: optional array of AdminAPIKey` - The details for events with this `type`. + - `id: string` - - `id: optional string` + The identifier, which can be referenced in API endpoints - The project ID. + - `created_at: number` - - `data: optional object { name, title }` + The Unix timestamp (in seconds) of when the API key was created - The payload used to create the project. + - `last_used_at: number` - - `name: optional string` + The Unix timestamp (in seconds) of when the API key was last used - The project name. + - `name: string` - - `title: optional string` + The name of the API key - The title of the project as seen on the dashboard. + - `object: string` - - `"project.deleted": optional object { id }` + The object type, which is always `organization.admin_api_key` - The details for events with this `type`. + - `owner: object { id, created_at, name, 3 more }` - `id: optional string` - The project ID. + The identifier, which can be referenced in API endpoints - - `"project.updated": optional object { id, changes_requested }` + - `created_at: optional number` - The details for events with this `type`. + The Unix timestamp (in seconds) of when the user was created - - `id: optional string` + - `name: optional string` - The project ID. + The name of the user - - `changes_requested: optional object { title }` + - `object: optional string` - The payload used to update the project. + The object type, which is always organization.user - - `title: optional string` + - `role: optional string` - The title of the project as seen on the dashboard. + Always `owner` - - `"rate_limit.deleted": optional object { id }` + - `type: optional string` - The details for events with this `type`. + Always `user` - - `id: optional string` + - `redacted_value: string` - The rate limit ID + The redacted value of the API key - - `"rate_limit.updated": optional object { id, changes_requested }` + - `value: optional string` - The details for events with this `type`. + The value of the API key. Only shown on create. - - `id: optional string` +- `first_id: optional string` - The rate limit ID +- `has_more: optional boolean` - - `changes_requested: optional object { batch_1_day_max_input_tokens, max_audio_megabytes_per_1_minute, max_images_per_1_minute, 3 more }` +- `last_id: optional string` - The payload used to update the rate limits. +- `object: optional string` - - `batch_1_day_max_input_tokens: optional number` +### Example - The maximum batch input tokens per day. Only relevant for certain models. +```http +curl https://api.openai.com/v1/organization/admin_api_keys \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" +``` - - `max_audio_megabytes_per_1_minute: optional number` +#### Response - The maximum audio megabytes per minute. Only relevant for certain models. +```json +{ + "data": [ + { + "id": "key_abc", + "created_at": 1711471533, + "last_used_at": 1711471534, + "name": "Administration Key", + "object": "organization.admin_api_key", + "owner": { + "id": "sa_456", + "created_at": 1711471533, + "name": "My Service Account", + "object": "organization.user", + "role": "owner", + "type": "user" + }, + "redacted_value": "sk-admin...def", + "value": "sk-admin-1234abcd" + } + ], + "first_id": "key_abc", + "has_more": false, + "last_id": "key_xyz", + "object": "list" +} +``` - - `max_images_per_1_minute: optional number` +### Example - The maximum images per minute. Only relevant for certain models. +```http +curl https://api.openai.com/v1/organization/admin_api_keys?after=key_abc&limit=20 \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -H "Content-Type: application/json" +``` - - `max_requests_per_1_day: optional number` +#### Response - The maximum requests per day. Only relevant for certain models. +```json +{ + "object": "list", + "data": [ + { + "object": "organization.admin_api_key", + "id": "key_abc", + "name": "Main Admin Key", + "redacted_value": "sk-admin...def", + "created_at": 1711471533, + "last_used_at": 1711471534, + "owner": { + "type": "service_account", + "object": "organization.service_account", + "id": "sa_456", + "name": "My Service Account", + "created_at": 1711471533, + "role": "member" + } + } + ], + "first_id": "key_abc", + "last_id": "key_abc", + "has_more": false +} +``` - - `max_requests_per_1_minute: optional number` +## Create admin API key - The maximum requests per minute. +**post** `/organization/admin_api_keys` - - `max_tokens_per_1_minute: optional number` +Create an organization admin API key - The maximum tokens per minute. +### Body Parameters - - `"role.assignment.created": optional object { id, principal_id, principal_type, 2 more }` +- `name: string` - The details for events with this `type`. +### Returns - - `id: optional string` +- `AdminAPIKey object { id, created_at, last_used_at, 5 more }` - The identifier of the role assignment. + Represents an individual Admin API key in an org. - - `principal_id: optional string` + - `id: string` - The principal (user or group) that received the role. + The identifier, which can be referenced in API endpoints - - `principal_type: optional string` + - `created_at: number` - The type of principal (user or group) that received the role. + The Unix timestamp (in seconds) of when the API key was created - - `resource_id: optional string` + - `last_used_at: number` - The resource the role assignment is scoped to. + The Unix timestamp (in seconds) of when the API key was last used - - `resource_type: optional string` + - `name: string` - The type of resource the role assignment is scoped to. + The name of the API key - - `"role.assignment.deleted": optional object { id, principal_id, principal_type, 2 more }` + - `object: string` - The details for events with this `type`. + The object type, which is always `organization.admin_api_key` + + - `owner: object { id, created_at, name, 3 more }` - `id: optional string` - The identifier of the role assignment. + The identifier, which can be referenced in API endpoints - - `principal_id: optional string` + - `created_at: optional number` - The principal (user or group) that had the role removed. + The Unix timestamp (in seconds) of when the user was created - - `principal_type: optional string` + - `name: optional string` - The type of principal (user or group) that had the role removed. + The name of the user - - `resource_id: optional string` + - `object: optional string` - The resource the role assignment was scoped to. + The object type, which is always organization.user - - `resource_type: optional string` + - `role: optional string` - The type of resource the role assignment was scoped to. + Always `owner` - - `"role.created": optional object { id, permissions, resource_id, 2 more }` + - `type: optional string` - The details for events with this `type`. + Always `user` + + - `redacted_value: string` + + The redacted value of the API key + + - `value: optional string` + + The value of the API key. Only shown on create. + +### Example + +```http +curl https://api.openai.com/v1/organization/admin_api_keys \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -d '{ + "name": "New Admin Key" + }' +``` + +#### Response + +```json +{ + "id": "key_abc", + "created_at": 1711471533, + "last_used_at": 1711471534, + "name": "Administration Key", + "object": "organization.admin_api_key", + "owner": { + "id": "sa_456", + "created_at": 1711471533, + "name": "My Service Account", + "object": "organization.user", + "role": "owner", + "type": "user" + }, + "redacted_value": "sk-admin...def", + "value": "sk-admin-1234abcd" +} +``` + +### Example + +```http +curl -X POST https://api.openai.com/v1/organization/admin_api_keys \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "New Admin Key" + }' +``` + +#### Response + +```json +{ + "object": "organization.admin_api_key", + "id": "key_xyz", + "name": "New Admin Key", + "redacted_value": "sk-admin...xyz", + "created_at": 1711471533, + "last_used_at": 1711471534, + "owner": { + "type": "user", + "object": "organization.user", + "id": "user_123", + "name": "John Doe", + "created_at": 1711471533, + "role": "owner" + }, + "value": "sk-admin-1234abcd" +} +``` + +## Retrieve admin API key + +**get** `/organization/admin_api_keys/{key_id}` + +Retrieve a single organization API key + +### Path Parameters + +- `key_id: string` + + The ID of the API key. + +### Returns + +- `AdminAPIKey object { id, created_at, last_used_at, 5 more }` + + Represents an individual Admin API key in an org. + + - `id: string` + + The identifier, which can be referenced in API endpoints + + - `created_at: number` + + The Unix timestamp (in seconds) of when the API key was created + + - `last_used_at: number` + + The Unix timestamp (in seconds) of when the API key was last used + + - `name: string` + + The name of the API key + + - `object: string` + + The object type, which is always `organization.admin_api_key` + + - `owner: object { id, created_at, name, 3 more }` - `id: optional string` - The role ID. + The identifier, which can be referenced in API endpoints - - `permissions: optional array of string` + - `created_at: optional number` - The permissions granted by the role. + The Unix timestamp (in seconds) of when the user was created - - `resource_id: optional string` + - `name: optional string` - The resource the role is scoped to. + The name of the user - - `resource_type: optional string` + - `object: optional string` - The type of resource the role belongs to. + The object type, which is always organization.user + + - `role: optional string` + + Always `owner` + + - `type: optional string` + + Always `user` + + - `redacted_value: string` + + The redacted value of the API key + + - `value: optional string` + + The value of the API key. Only shown on create. + +### Example + +```http +curl https://api.openai.com/v1/organization/admin_api_keys/$KEY_ID \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" +``` + +#### Response + +```json +{ + "id": "key_abc", + "created_at": 1711471533, + "last_used_at": 1711471534, + "name": "Administration Key", + "object": "organization.admin_api_key", + "owner": { + "id": "sa_456", + "created_at": 1711471533, + "name": "My Service Account", + "object": "organization.user", + "role": "owner", + "type": "user" + }, + "redacted_value": "sk-admin...def", + "value": "sk-admin-1234abcd" +} +``` + +### Example + +```http +curl https://api.openai.com/v1/organization/admin_api_keys/key_abc \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -H "Content-Type: application/json" +``` + +#### Response + +```json +{ + "object": "organization.admin_api_key", + "id": "key_abc", + "name": "Main Admin Key", + "redacted_value": "sk-admin...xyz", + "created_at": 1711471533, + "last_used_at": 1711471534, + "owner": { + "type": "user", + "object": "organization.user", + "id": "user_123", + "name": "John Doe", + "created_at": 1711471533, + "role": "owner" + } +} +``` + +## Delete admin API key + +**delete** `/organization/admin_api_keys/{key_id}` + +Delete an organization admin API key + +### Path Parameters + +- `key_id: string` + + The ID of the API key to be deleted. + +### Returns + +- `id: optional string` + +- `deleted: optional boolean` + +- `object: optional string` + +### Example + +```http +curl https://api.openai.com/v1/organization/admin_api_keys/$KEY_ID \ + -X DELETE \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" +``` - - `role_name: optional string` +#### Response - The name of the role. +```json +{ + "id": "key_abc", + "deleted": true, + "object": "organization.admin_api_key.deleted" +} +``` - - `"role.deleted": optional object { id }` +### Example - The details for events with this `type`. +```http +curl -X DELETE https://api.openai.com/v1/organization/admin_api_keys/key_abc \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -H "Content-Type: application/json" +``` - - `id: optional string` +#### Response - The role ID. +```json +{ + "id": "key_abc", + "object": "organization.admin_api_key.deleted", + "deleted": true +} +``` - - `"role.updated": optional object { id, changes_requested }` +## Domain Types - The details for events with this `type`. +### Admin API Key - - `id: optional string` +- `AdminAPIKey object { id, created_at, last_used_at, 5 more }` - The role ID. + Represents an individual Admin API key in an org. - - `changes_requested: optional object { description, metadata, permissions_added, 4 more }` + - `id: string` - The payload used to update the role. + The identifier, which can be referenced in API endpoints - - `description: optional string` + - `created_at: number` - The updated role description, when provided. + The Unix timestamp (in seconds) of when the API key was created - - `metadata: optional unknown` + - `last_used_at: number` - Additional metadata stored on the role. + The Unix timestamp (in seconds) of when the API key was last used - - `permissions_added: optional array of string` + - `name: string` - The permissions added to the role. + The name of the API key - - `permissions_removed: optional array of string` + - `object: string` - The permissions removed from the role. + The object type, which is always `organization.admin_api_key` - - `resource_id: optional string` + - `owner: object { id, created_at, name, 3 more }` - The resource the role is scoped to. + - `id: optional string` - - `resource_type: optional string` + The identifier, which can be referenced in API endpoints - The type of resource the role belongs to. + - `created_at: optional number` - - `role_name: optional string` + The Unix timestamp (in seconds) of when the user was created - The updated role name, when provided. + - `name: optional string` - - `"scim.disabled": optional object { id }` + The name of the user - The details for events with this `type`. + - `object: optional string` - - `id: optional string` + The object type, which is always organization.user - The ID of the SCIM was disabled for. + - `role: optional string` - - `"scim.enabled": optional object { id }` + Always `owner` - The details for events with this `type`. + - `type: optional string` - - `id: optional string` + Always `user` - The ID of the SCIM was enabled for. + - `redacted_value: string` - - `"service_account.created": optional object { id, data }` + The redacted value of the API key - The details for events with this `type`. + - `value: optional string` - - `id: optional string` + The value of the API key. Only shown on create. - The service account ID. +### Admin API Key Delete Response - - `data: optional object { role }` +- `AdminAPIKeyDeleteResponse object { id, deleted, object }` - The payload used to create the service account. + - `id: optional string` - - `role: optional string` + - `deleted: optional boolean` - The role of the service account. Is either `owner` or `member`. + - `object: optional string` - - `"service_account.deleted": optional object { id }` +# Usage - The details for events with this `type`. +## Audio speeches - - `id: optional string` +**get** `/organization/usage/audio_speeches` - The service account ID. +Get audio speeches usage details for the organization. - - `"service_account.updated": optional object { id, changes_requested }` +### Query Parameters - The details for events with this `type`. +- `start_time: number` - - `id: optional string` + Start time (Unix seconds) of the query time range, inclusive. - The service account ID. +- `api_key_ids: optional array of string` - - `changes_requested: optional object { role }` + Return only usage for these API keys. - The payload used to updated the service account. +- `bucket_width: optional "1m" or "1h" or "1d"` - - `role: optional string` + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - The role of the service account. Is either `owner` or `member`. + - `"1m"` - - `"user.added": optional object { id, data }` + - `"1h"` - The details for events with this `type`. + - `"1d"` - - `id: optional string` +- `end_time: optional number` - The user ID. + End time (Unix seconds) of the query time range, exclusive. - - `data: optional object { role }` +- `group_by: optional array of "project_id" or "user_id" or "api_key_id" or "model"` - The payload used to add the user to the project. + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. - - `role: optional string` + - `"project_id"` - The role of the user. Is either `owner` or `member`. + - `"user_id"` - - `"user.deleted": optional object { id }` + - `"api_key_id"` - The details for events with this `type`. + - `"model"` - - `id: optional string` +- `limit: optional number` - The user ID. + Specifies the number of buckets to return. - - `"user.updated": optional object { id, changes_requested }` + - `bucket_width=1d`: default: 7, max: 31 + - `bucket_width=1h`: default: 24, max: 168 + - `bucket_width=1m`: default: 60, max: 1440 - The details for events with this `type`. +- `models: optional array of string` - - `id: optional string` + Return only usage for these models. - The project ID. +- `page: optional string` - - `changes_requested: optional object { role }` + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - The payload used to update the user. +- `project_ids: optional array of string` - - `role: optional string` + Return only usage for these projects. - The role of the user. Is either `owner` or `member`. +- `user_ids: optional array of string` -### Audit Log Get Costs Response + Return only usage for these users. -- `AuditLogGetCostsResponse object { data, has_more, next_page, object }` +### Returns - - `data: array of object { end_time, object, result, start_time }` +- `data: array of object { end_time, object, result, start_time }` - `end_time: number` @@ -2997,181 +3198,93 @@ curl "https://api.openai.com/v1/organization/costs?start_time=1730419200&limit=1 When `group_by=model`, this field provides the model name of the grouped usage result. - - `project_id: optional string` - - When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - - `user_id: optional string` - - When `group_by=user_id`, this field provides the user ID of the grouped usage result. - - - `UsageVectorStoresResult object { object, usage_bytes, project_id }` - - The aggregated vector stores usage details of the specific time bucket. - - - `object: "organization.usage.vector_stores.result"` - - - `"organization.usage.vector_stores.result"` - - - `usage_bytes: number` - - The vector stores usage in bytes. - - - `project_id: optional string` - - When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - - `UsageCodeInterpreterSessionsResult object { object, num_sessions, project_id }` - - The aggregated code interpreter sessions usage details of the specific time bucket. - - - `object: "organization.usage.code_interpreter_sessions.result"` - - - `"organization.usage.code_interpreter_sessions.result"` - - - `num_sessions: optional number` - - The number of code interpreter sessions. - - - `project_id: optional string` - - When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - - `CostsResult object { object, amount, line_item, project_id }` - - The aggregated costs details of the specific time bucket. - - - `object: "organization.costs.result"` - - - `"organization.costs.result"` - - - `amount: optional object { currency, value }` - - The monetary value in its associated currency. - - - `currency: optional string` - - Lowercase ISO-4217 currency e.g. "usd" - - - `value: optional number` - - The numeric value of the cost. - - - `line_item: optional string` - - When `group_by=line_item`, this field provides the line item of the grouped costs result. - - - `project_id: optional string` - - When `group_by=project_id`, this field provides the project ID of the grouped costs result. - - - `start_time: number` - - - `has_more: boolean` - - - `next_page: string` - - - `object: "page"` - - - `"page"` - -# Admin API Keys - -## List all organization and project API keys. - -**get** `/organization/admin_api_keys` - -List organization API keys - -### Query Parameters - -- `after: optional string` + - `project_id: optional string` - Return keys with IDs that come after this ID in the pagination order. + When `group_by=project_id`, this field provides the project ID of the grouped usage result. -- `limit: optional number` + - `user_id: optional string` - Maximum number of keys to return. + When `group_by=user_id`, this field provides the user ID of the grouped usage result. -- `order: optional "asc" or "desc"` + - `UsageVectorStoresResult object { object, usage_bytes, project_id }` - Order results by creation time, ascending or descending. + The aggregated vector stores usage details of the specific time bucket. - - `"asc"` + - `object: "organization.usage.vector_stores.result"` - - `"desc"` + - `"organization.usage.vector_stores.result"` -### Returns + - `usage_bytes: number` -- `data: optional array of object { id, created_at, last_used_at, 5 more }` + The vector stores usage in bytes. - - `id: string` + - `project_id: optional string` - The identifier, which can be referenced in API endpoints + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `created_at: number` + - `UsageCodeInterpreterSessionsResult object { object, num_sessions, project_id }` - The Unix timestamp (in seconds) of when the API key was created + The aggregated code interpreter sessions usage details of the specific time bucket. - - `last_used_at: number` + - `object: "organization.usage.code_interpreter_sessions.result"` - The Unix timestamp (in seconds) of when the API key was last used + - `"organization.usage.code_interpreter_sessions.result"` - - `name: string` + - `num_sessions: optional number` - The name of the API key + The number of code interpreter sessions. - - `object: string` + - `project_id: optional string` - The object type, which is always `organization.admin_api_key` + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `owner: object { id, created_at, name, 3 more }` + - `CostsResult object { object, amount, api_key_id, 2 more }` - - `id: optional string` + The aggregated costs details of the specific time bucket. - The identifier, which can be referenced in API endpoints + - `object: "organization.costs.result"` - - `created_at: optional number` + - `"organization.costs.result"` - The Unix timestamp (in seconds) of when the user was created + - `amount: optional object { currency, value }` - - `name: optional string` + The monetary value in its associated currency. - The name of the user + - `currency: optional string` - - `object: optional string` + Lowercase ISO-4217 currency e.g. "usd" - The object type, which is always organization.user + - `value: optional number` - - `role: optional string` + The numeric value of the cost. - Always `owner` + - `api_key_id: optional string` - - `type: optional string` + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. - Always `user` + - `line_item: optional string` - - `redacted_value: string` + When `group_by=line_item`, this field provides the line item of the grouped costs result. - The redacted value of the API key + - `project_id: optional string` - - `value: optional string` + When `group_by=project_id`, this field provides the project ID of the grouped costs result. - The value of the API key. Only shown on create. + - `start_time: number` -- `first_id: optional string` +- `has_more: boolean` -- `has_more: optional boolean` +- `next_page: string` -- `last_id: optional string` +- `object: "page"` -- `object: optional string` + - `"page"` ### Example ```http -curl https://api.openai.com/v1/organization/admin_api_keys \ - -H "Authorization: Bearer $OPENAI_API_KEY" +curl https://api.openai.com/v1/organization/usage/audio_speeches \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -3180,580 +3293,528 @@ curl https://api.openai.com/v1/organization/admin_api_keys \ { "data": [ { - "id": "key_abc", - "created_at": 1711471533, - "last_used_at": 1711471534, - "name": "Administration Key", - "object": "organization.admin_api_key", - "owner": { - "id": "sa_456", - "created_at": 1711471533, - "name": "My Service Account", - "object": "organization.user", - "role": "owner", - "type": "user" - }, - "redacted_value": "sk-admin...def", - "value": "sk-admin-1234abcd" + "end_time": 0, + "object": "bucket", + "result": [ + { + "input_tokens": 0, + "num_model_requests": 0, + "object": "organization.usage.completions.result", + "output_tokens": 0, + "api_key_id": "api_key_id", + "batch": true, + "input_audio_tokens": 0, + "input_cached_tokens": 0, + "model": "model", + "output_audio_tokens": 0, + "project_id": "project_id", + "service_tier": "service_tier", + "user_id": "user_id" } ], - "first_id": "key_abc", - "has_more": false, - "last_id": "key_xyz", - "object": "list" + "start_time": 0 + } + ], + "has_more": true, + "next_page": "next_page", + "object": "page" } ``` ### Example ```http -curl https://api.openai.com/v1/organization/admin_api_keys?after=key_abc&limit=20 \ - -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ - -H "Content-Type: application/json" +curl "https://api.openai.com/v1/organization/usage/audio_speeches?start_time=1730419200&limit=1" \ +-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ +-H "Content-Type: application/json" ``` #### Response ```json { - "object": "list", + "object": "page", "data": [ { - "object": "organization.admin_api_key", - "id": "key_abc", - "name": "Main Admin Key", - "redacted_value": "sk-admin...def", - "created_at": 1711471533, - "last_used_at": 1711471534, - "owner": { - "type": "service_account", - "object": "organization.service_account", - "id": "sa_456", - "name": "My Service Account", - "created_at": 1711471533, - "role": "member" + "object": "bucket", + "start_time": 1730419200, + "end_time": 1730505600, + "results": [ + { + "object": "organization.usage.audio_speeches.result", + "characters": 45, + "num_model_requests": 1, + "project_id": null, + "user_id": null, + "api_key_id": null, + "model": null } + ] } ], - "first_id": "key_abc", - "last_id": "key_abc", - "has_more": false + "has_more": false, + "next_page": null } ``` -## Create admin API key - -**post** `/organization/admin_api_keys` - -Create an organization admin API key - -### Body Parameters - -- `name: string` - -### Returns - -- `id: string` - - The identifier, which can be referenced in API endpoints - -- `created_at: number` - - The Unix timestamp (in seconds) of when the API key was created +## Audio transcriptions -- `last_used_at: number` +**get** `/organization/usage/audio_transcriptions` - The Unix timestamp (in seconds) of when the API key was last used +Get audio transcriptions usage details for the organization. -- `name: string` +### Query Parameters - The name of the API key +- `start_time: number` -- `object: string` + Start time (Unix seconds) of the query time range, inclusive. - The object type, which is always `organization.admin_api_key` +- `api_key_ids: optional array of string` -- `owner: object { id, created_at, name, 3 more }` + Return only usage for these API keys. - - `id: optional string` +- `bucket_width: optional "1m" or "1h" or "1d"` - The identifier, which can be referenced in API endpoints + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - - `created_at: optional number` + - `"1m"` - The Unix timestamp (in seconds) of when the user was created + - `"1h"` - - `name: optional string` + - `"1d"` - The name of the user +- `end_time: optional number` - - `object: optional string` + End time (Unix seconds) of the query time range, exclusive. - The object type, which is always organization.user +- `group_by: optional array of "project_id" or "user_id" or "api_key_id" or "model"` - - `role: optional string` + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. - Always `owner` + - `"project_id"` - - `type: optional string` + - `"user_id"` - Always `user` + - `"api_key_id"` -- `redacted_value: string` + - `"model"` - The redacted value of the API key +- `limit: optional number` -- `value: optional string` + Specifies the number of buckets to return. - The value of the API key. Only shown on create. + - `bucket_width=1d`: default: 7, max: 31 + - `bucket_width=1h`: default: 24, max: 168 + - `bucket_width=1m`: default: 60, max: 1440 -### Example +- `models: optional array of string` -```http -curl https://api.openai.com/v1/organization/admin_api_keys \ - -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "name": "New Admin Key" - }' -``` + Return only usage for these models. -#### Response +- `page: optional string` -```json -{ - "id": "key_abc", - "created_at": 1711471533, - "last_used_at": 1711471534, - "name": "Administration Key", - "object": "organization.admin_api_key", - "owner": { - "id": "sa_456", - "created_at": 1711471533, - "name": "My Service Account", - "object": "organization.user", - "role": "owner", - "type": "user" - }, - "redacted_value": "sk-admin...def", - "value": "sk-admin-1234abcd" -} -``` + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. -### Example +- `project_ids: optional array of string` -```http -curl -X POST https://api.openai.com/v1/organization/admin_api_keys \ - -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "name": "New Admin Key" - }' -``` + Return only usage for these projects. -#### Response +- `user_ids: optional array of string` -```json -{ - "object": "organization.admin_api_key", - "id": "key_xyz", - "name": "New Admin Key", - "redacted_value": "sk-admin...xyz", - "created_at": 1711471533, - "last_used_at": 1711471534, - "owner": { - "type": "user", - "object": "organization.user", - "id": "user_123", - "name": "John Doe", - "created_at": 1711471533, - "role": "owner" - }, - "value": "sk-admin-1234abcd" -} -``` + Return only usage for these users. -## Retrieve admin API key +### Returns -**get** `/organization/admin_api_keys/{key_id}` +- `data: array of object { end_time, object, result, start_time }` -Retrieve a single organization API key + - `end_time: number` -### Path Parameters + - `object: "bucket"` -- `key_id: string` + - `"bucket"` - The ID of the API key. + - `result: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 6 more` -### Returns + - `UsageCompletionsResult object { input_tokens, num_model_requests, object, 10 more }` -- `id: string` + The aggregated completions usage details of the specific time bucket. - The identifier, which can be referenced in API endpoints + - `input_tokens: number` -- `created_at: number` + The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens. - The Unix timestamp (in seconds) of when the API key was created + - `num_model_requests: number` -- `last_used_at: number` + The count of requests made to the model. - The Unix timestamp (in seconds) of when the API key was last used + - `object: "organization.usage.completions.result"` -- `name: string` + - `"organization.usage.completions.result"` - The name of the API key + - `output_tokens: number` -- `object: string` + The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens. - The object type, which is always `organization.admin_api_key` + - `api_key_id: optional string` -- `owner: object { id, created_at, name, 3 more }` + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - - `id: optional string` + - `batch: optional boolean` - The identifier, which can be referenced in API endpoints + When `group_by=batch`, this field tells whether the grouped usage result is batch or not. - - `created_at: optional number` + - `input_audio_tokens: optional number` - The Unix timestamp (in seconds) of when the user was created + The aggregated number of audio input tokens used, including cached tokens. - - `name: optional string` + - `input_cached_tokens: optional number` - The name of the user + The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens. - - `object: optional string` + - `model: optional string` - The object type, which is always organization.user + When `group_by=model`, this field provides the model name of the grouped usage result. - - `role: optional string` + - `output_audio_tokens: optional number` - Always `owner` + The aggregated number of audio output tokens used. - - `type: optional string` + - `project_id: optional string` - Always `user` + When `group_by=project_id`, this field provides the project ID of the grouped usage result. -- `redacted_value: string` + - `service_tier: optional string` - The redacted value of the API key + When `group_by=service_tier`, this field provides the service tier of the grouped usage result. -- `value: optional string` + - `user_id: optional string` - The value of the API key. Only shown on create. + When `group_by=user_id`, this field provides the user ID of the grouped usage result. -### Example + - `UsageEmbeddingsResult object { input_tokens, num_model_requests, object, 4 more }` -```http -curl https://api.openai.com/v1/organization/admin_api_keys/$KEY_ID \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` + The aggregated embeddings usage details of the specific time bucket. -#### Response + - `input_tokens: number` -```json -{ - "id": "key_abc", - "created_at": 1711471533, - "last_used_at": 1711471534, - "name": "Administration Key", - "object": "organization.admin_api_key", - "owner": { - "id": "sa_456", - "created_at": 1711471533, - "name": "My Service Account", - "object": "organization.user", - "role": "owner", - "type": "user" - }, - "redacted_value": "sk-admin...def", - "value": "sk-admin-1234abcd" -} -``` + The aggregated number of input tokens used. -### Example + - `num_model_requests: number` -```http -curl https://api.openai.com/v1/organization/admin_api_keys/key_abc \ - -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ - -H "Content-Type: application/json" -``` + The count of requests made to the model. -#### Response + - `object: "organization.usage.embeddings.result"` -```json -{ - "object": "organization.admin_api_key", - "id": "key_abc", - "name": "Main Admin Key", - "redacted_value": "sk-admin...xyz", - "created_at": 1711471533, - "last_used_at": 1711471534, - "owner": { - "type": "user", - "object": "organization.user", - "id": "user_123", - "name": "John Doe", - "created_at": 1711471533, - "role": "owner" - } -} -``` + - `"organization.usage.embeddings.result"` -## Delete admin API key + - `api_key_id: optional string` -**delete** `/organization/admin_api_keys/{key_id}` + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. -Delete an organization admin API key + - `model: optional string` -### Path Parameters + When `group_by=model`, this field provides the model name of the grouped usage result. -- `key_id: string` + - `project_id: optional string` - The ID of the API key to be deleted. + When `group_by=project_id`, this field provides the project ID of the grouped usage result. -### Returns + - `user_id: optional string` -- `id: optional string` + When `group_by=user_id`, this field provides the user ID of the grouped usage result. -- `deleted: optional boolean` + - `UsageModerationsResult object { input_tokens, num_model_requests, object, 4 more }` -- `object: optional string` + The aggregated moderations usage details of the specific time bucket. -### Example + - `input_tokens: number` -```http -curl https://api.openai.com/v1/organization/admin_api_keys/$KEY_ID \ - -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` + The aggregated number of input tokens used. -#### Response + - `num_model_requests: number` -```json -{ - "id": "key_abc", - "deleted": true, - "object": "organization.admin_api_key.deleted" -} -``` + The count of requests made to the model. -### Example + - `object: "organization.usage.moderations.result"` -```http -curl -X DELETE https://api.openai.com/v1/organization/admin_api_keys/key_abc \ - -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ - -H "Content-Type: application/json" -``` + - `"organization.usage.moderations.result"` -#### Response + - `api_key_id: optional string` -```json -{ - "id": "key_abc", - "object": "organization.admin_api_key.deleted", - "deleted": true -} -``` + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. -## Domain Types + - `model: optional string` -### Admin API Key List Response + When `group_by=model`, this field provides the model name of the grouped usage result. -- `AdminAPIKeyListResponse object { id, created_at, last_used_at, 5 more }` + - `project_id: optional string` - Represents an individual Admin API key in an org. + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `id: string` + - `user_id: optional string` - The identifier, which can be referenced in API endpoints + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - - `created_at: number` + - `UsageImagesResult object { images, num_model_requests, object, 6 more }` - The Unix timestamp (in seconds) of when the API key was created + The aggregated images usage details of the specific time bucket. - - `last_used_at: number` + - `images: number` - The Unix timestamp (in seconds) of when the API key was last used + The number of images processed. - - `name: string` + - `num_model_requests: number` - The name of the API key + The count of requests made to the model. - - `object: string` + - `object: "organization.usage.images.result"` - The object type, which is always `organization.admin_api_key` + - `"organization.usage.images.result"` - - `owner: object { id, created_at, name, 3 more }` + - `api_key_id: optional string` - - `id: optional string` + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - The identifier, which can be referenced in API endpoints + - `model: optional string` - - `created_at: optional number` + When `group_by=model`, this field provides the model name of the grouped usage result. + + - `project_id: optional string` + + When `group_by=project_id`, this field provides the project ID of the grouped usage result. + + - `size: optional string` + + When `group_by=size`, this field provides the image size of the grouped usage result. + + - `source: optional string` + + When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`. - The Unix timestamp (in seconds) of when the user was created + - `user_id: optional string` - - `name: optional string` + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - The name of the user + - `UsageAudioSpeechesResult object { characters, num_model_requests, object, 4 more }` - - `object: optional string` + The aggregated audio speeches usage details of the specific time bucket. - The object type, which is always organization.user + - `characters: number` - - `role: optional string` + The number of characters processed. - Always `owner` + - `num_model_requests: number` - - `type: optional string` + The count of requests made to the model. - Always `user` + - `object: "organization.usage.audio_speeches.result"` - - `redacted_value: string` + - `"organization.usage.audio_speeches.result"` - The redacted value of the API key + - `api_key_id: optional string` - - `value: optional string` + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - The value of the API key. Only shown on create. + - `model: optional string` -### Admin API Key Create Response + When `group_by=model`, this field provides the model name of the grouped usage result. -- `AdminAPIKeyCreateResponse object { id, created_at, last_used_at, 5 more }` + - `project_id: optional string` - Represents an individual Admin API key in an org. + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `id: string` + - `user_id: optional string` - The identifier, which can be referenced in API endpoints + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - - `created_at: number` + - `UsageAudioTranscriptionsResult object { num_model_requests, object, seconds, 4 more }` - The Unix timestamp (in seconds) of when the API key was created + The aggregated audio transcriptions usage details of the specific time bucket. - - `last_used_at: number` + - `num_model_requests: number` - The Unix timestamp (in seconds) of when the API key was last used + The count of requests made to the model. - - `name: string` + - `object: "organization.usage.audio_transcriptions.result"` - The name of the API key + - `"organization.usage.audio_transcriptions.result"` - - `object: string` + - `seconds: number` - The object type, which is always `organization.admin_api_key` + The number of seconds processed. - - `owner: object { id, created_at, name, 3 more }` + - `api_key_id: optional string` - - `id: optional string` + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - The identifier, which can be referenced in API endpoints + - `model: optional string` - - `created_at: optional number` + When `group_by=model`, this field provides the model name of the grouped usage result. - The Unix timestamp (in seconds) of when the user was created + - `project_id: optional string` - - `name: optional string` + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - The name of the user + - `user_id: optional string` - - `object: optional string` + When `group_by=user_id`, this field provides the user ID of the grouped usage result. - The object type, which is always organization.user + - `UsageVectorStoresResult object { object, usage_bytes, project_id }` - - `role: optional string` + The aggregated vector stores usage details of the specific time bucket. - Always `owner` + - `object: "organization.usage.vector_stores.result"` - - `type: optional string` + - `"organization.usage.vector_stores.result"` - Always `user` + - `usage_bytes: number` - - `redacted_value: string` + The vector stores usage in bytes. - The redacted value of the API key + - `project_id: optional string` - - `value: optional string` + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - The value of the API key. Only shown on create. + - `UsageCodeInterpreterSessionsResult object { object, num_sessions, project_id }` -### Admin API Key Retrieve Response + The aggregated code interpreter sessions usage details of the specific time bucket. -- `AdminAPIKeyRetrieveResponse object { id, created_at, last_used_at, 5 more }` + - `object: "organization.usage.code_interpreter_sessions.result"` - Represents an individual Admin API key in an org. + - `"organization.usage.code_interpreter_sessions.result"` - - `id: string` + - `num_sessions: optional number` - The identifier, which can be referenced in API endpoints + The number of code interpreter sessions. - - `created_at: number` + - `project_id: optional string` - The Unix timestamp (in seconds) of when the API key was created + When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `last_used_at: number` + - `CostsResult object { object, amount, api_key_id, 2 more }` - The Unix timestamp (in seconds) of when the API key was last used + The aggregated costs details of the specific time bucket. - - `name: string` + - `object: "organization.costs.result"` - The name of the API key + - `"organization.costs.result"` - - `object: string` + - `amount: optional object { currency, value }` - The object type, which is always `organization.admin_api_key` + The monetary value in its associated currency. - - `owner: object { id, created_at, name, 3 more }` + - `currency: optional string` - - `id: optional string` + Lowercase ISO-4217 currency e.g. "usd" - The identifier, which can be referenced in API endpoints + - `value: optional number` - - `created_at: optional number` + The numeric value of the cost. - The Unix timestamp (in seconds) of when the user was created + - `api_key_id: optional string` - - `name: optional string` + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. - The name of the user + - `line_item: optional string` - - `object: optional string` + When `group_by=line_item`, this field provides the line item of the grouped costs result. - The object type, which is always organization.user + - `project_id: optional string` - - `role: optional string` + When `group_by=project_id`, this field provides the project ID of the grouped costs result. - Always `owner` + - `start_time: number` - - `type: optional string` +- `has_more: boolean` - Always `user` +- `next_page: string` - - `redacted_value: string` +- `object: "page"` - The redacted value of the API key + - `"page"` - - `value: optional string` +### Example - The value of the API key. Only shown on create. +```http +curl https://api.openai.com/v1/organization/usage/audio_transcriptions \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" +``` -### Admin API Key Delete Response +#### Response -- `AdminAPIKeyDeleteResponse object { id, deleted, object }` +```json +{ + "data": [ + { + "end_time": 0, + "object": "bucket", + "result": [ + { + "input_tokens": 0, + "num_model_requests": 0, + "object": "organization.usage.completions.result", + "output_tokens": 0, + "api_key_id": "api_key_id", + "batch": true, + "input_audio_tokens": 0, + "input_cached_tokens": 0, + "model": "model", + "output_audio_tokens": 0, + "project_id": "project_id", + "service_tier": "service_tier", + "user_id": "user_id" + } + ], + "start_time": 0 + } + ], + "has_more": true, + "next_page": "next_page", + "object": "page" +} +``` - - `id: optional string` +### Example - - `deleted: optional boolean` +```http +curl "https://api.openai.com/v1/organization/usage/audio_transcriptions?start_time=1730419200&limit=1" \ +-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ +-H "Content-Type: application/json" +``` - - `object: optional string` +#### Response -# Usage +```json +{ + "object": "page", + "data": [ + { + "object": "bucket", + "start_time": 1730419200, + "end_time": 1730505600, + "results": [ + { + "object": "organization.usage.audio_transcriptions.result", + "seconds": 20, + "num_model_requests": 1, + "project_id": null, + "user_id": null, + "api_key_id": null, + "model": null + } + ] + } + ], + "has_more": false, + "next_page": null +} +``` -## Audio speeches +## Code interpreter sessions -**get** `/organization/usage/audio_speeches` +**get** `/organization/usage/code_interpreter_sessions` -Get audio speeches usage details for the organization. +Get code interpreter sessions usage details for the organization. ### Query Parameters @@ -3761,10 +3822,6 @@ Get audio speeches usage details for the organization. Start time (Unix seconds) of the query time range, inclusive. -- `api_key_ids: optional array of string` - - Return only usage for these API keys. - - `bucket_width: optional "1m" or "1h" or "1d"` Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. @@ -3779,18 +3836,12 @@ Get audio speeches usage details for the organization. End time (Unix seconds) of the query time range, exclusive. -- `group_by: optional array of "project_id" or "user_id" or "api_key_id" or "model"` +- `group_by: optional array of "project_id"` - Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. + Group the usage data by the specified fields. Support fields include `project_id`. - `"project_id"` - - `"user_id"` - - - `"api_key_id"` - - - `"model"` - - `limit: optional number` Specifies the number of buckets to return. @@ -3799,10 +3850,6 @@ Get audio speeches usage details for the organization. - `bucket_width=1h`: default: 24, max: 168 - `bucket_width=1m`: default: 60, max: 1440 -- `models: optional array of string` - - Return only usage for these models. - - `page: optional string` A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. @@ -3811,10 +3858,6 @@ Get audio speeches usage details for the organization. Return only usage for these projects. -- `user_ids: optional array of string` - - Return only usage for these users. - ### Returns - `data: array of object { end_time, object, result, start_time }` @@ -4083,7 +4126,7 @@ Get audio speeches usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -4103,6 +4146,10 @@ Get audio speeches usage details for the organization. The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -4124,8 +4171,8 @@ Get audio speeches usage details for the organization. ### Example ```http -curl https://api.openai.com/v1/organization/usage/audio_speeches \ - -H "Authorization: Bearer $OPENAI_API_KEY" +curl https://api.openai.com/v1/organization/usage/code_interpreter_sessions \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -4165,7 +4212,7 @@ curl https://api.openai.com/v1/organization/usage/audio_speeches \ ### Example ```http -curl "https://api.openai.com/v1/organization/usage/audio_speeches?start_time=1730419200&limit=1" \ +curl "https://api.openai.com/v1/organization/usage/code_interpreter_sessions?start_time=1730419200&limit=1" \ -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -H "Content-Type: application/json" ``` @@ -4180,15 +4227,11 @@ curl "https://api.openai.com/v1/organization/usage/audio_speeches?start_time=173 "object": "bucket", "start_time": 1730419200, "end_time": 1730505600, - "results": [ - { - "object": "organization.usage.audio_speeches.result", - "characters": 45, - "num_model_requests": 1, - "project_id": null, - "user_id": null, - "api_key_id": null, - "model": null + "results": [ + { + "object": "organization.usage.code_interpreter_sessions.result", + "num_sessions": 1, + "project_id": null } ] } @@ -4198,11 +4241,11 @@ curl "https://api.openai.com/v1/organization/usage/audio_speeches?start_time=173 } ``` -## Audio transcriptions +## Completions -**get** `/organization/usage/audio_transcriptions` +**get** `/organization/usage/completions` -Get audio transcriptions usage details for the organization. +Get completions usage details for the organization. ### Query Parameters @@ -4214,6 +4257,10 @@ Get audio transcriptions usage details for the organization. Return only usage for these API keys. +- `batch: optional boolean` + + If `true`, return batch jobs only. If `false`, return non-batch jobs only. By default, return both. + - `bucket_width: optional "1m" or "1h" or "1d"` Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. @@ -4228,9 +4275,9 @@ Get audio transcriptions usage details for the organization. End time (Unix seconds) of the query time range, exclusive. -- `group_by: optional array of "project_id" or "user_id" or "api_key_id" or "model"` +- `group_by: optional array of "project_id" or "user_id" or "api_key_id" or 3 more` - Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier` or any combination of them. - `"project_id"` @@ -4240,6 +4287,10 @@ Get audio transcriptions usage details for the organization. - `"model"` + - `"batch"` + + - `"service_tier"` + - `limit: optional number` Specifies the number of buckets to return. @@ -4532,7 +4583,7 @@ Get audio transcriptions usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -4552,6 +4603,10 @@ Get audio transcriptions usage details for the organization. The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -4573,8 +4628,8 @@ Get audio transcriptions usage details for the organization. ### Example ```http -curl https://api.openai.com/v1/organization/usage/audio_transcriptions \ - -H "Authorization: Bearer $OPENAI_API_KEY" +curl https://api.openai.com/v1/organization/usage/completions \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -4614,7 +4669,7 @@ curl https://api.openai.com/v1/organization/usage/audio_transcriptions \ ### Example ```http -curl "https://api.openai.com/v1/organization/usage/audio_transcriptions?start_time=1730419200&limit=1" \ +curl "https://api.openai.com/v1/organization/usage/completions?start_time=1730419200&limit=1" \ -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -H "Content-Type: application/json" ``` @@ -4631,27 +4686,33 @@ curl "https://api.openai.com/v1/organization/usage/audio_transcriptions?start_ti "end_time": 1730505600, "results": [ { - "object": "organization.usage.audio_transcriptions.result", - "seconds": 20, - "num_model_requests": 1, + "object": "organization.usage.completions.result", + "input_tokens": 1000, + "output_tokens": 500, + "input_cached_tokens": 800, + "input_audio_tokens": 0, + "output_audio_tokens": 0, + "num_model_requests": 5, "project_id": null, "user_id": null, "api_key_id": null, - "model": null + "model": null, + "batch": null, + "service_tier": null } ] } ], - "has_more": false, - "next_page": null + "has_more": true, + "next_page": "page_AAAAAGdGxdEiJdKOAAAAAGcqsYA=" } ``` -## Code interpreter sessions +## Embeddings -**get** `/organization/usage/code_interpreter_sessions` +**get** `/organization/usage/embeddings` -Get code interpreter sessions usage details for the organization. +Get embeddings usage details for the organization. ### Query Parameters @@ -4659,6 +4720,10 @@ Get code interpreter sessions usage details for the organization. Start time (Unix seconds) of the query time range, inclusive. +- `api_key_ids: optional array of string` + + Return only usage for these API keys. + - `bucket_width: optional "1m" or "1h" or "1d"` Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. @@ -4673,12 +4738,18 @@ Get code interpreter sessions usage details for the organization. End time (Unix seconds) of the query time range, exclusive. -- `group_by: optional array of "project_id"` +- `group_by: optional array of "project_id" or "user_id" or "api_key_id" or "model"` - Group the usage data by the specified fields. Support fields include `project_id`. + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. - `"project_id"` + - `"user_id"` + + - `"api_key_id"` + + - `"model"` + - `limit: optional number` Specifies the number of buckets to return. @@ -4687,6 +4758,10 @@ Get code interpreter sessions usage details for the organization. - `bucket_width=1h`: default: 24, max: 168 - `bucket_width=1m`: default: 60, max: 1440 +- `models: optional array of string` + + Return only usage for these models. + - `page: optional string` A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. @@ -4695,6 +4770,10 @@ Get code interpreter sessions usage details for the organization. Return only usage for these projects. +- `user_ids: optional array of string` + + Return only usage for these users. + ### Returns - `data: array of object { end_time, object, result, start_time }` @@ -4963,7 +5042,7 @@ Get code interpreter sessions usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -4983,6 +5062,10 @@ Get code interpreter sessions usage details for the organization. The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -5004,8 +5087,8 @@ Get code interpreter sessions usage details for the organization. ### Example ```http -curl https://api.openai.com/v1/organization/usage/code_interpreter_sessions \ - -H "Authorization: Bearer $OPENAI_API_KEY" +curl https://api.openai.com/v1/organization/usage/embeddings \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -5045,7 +5128,7 @@ curl https://api.openai.com/v1/organization/usage/code_interpreter_sessions \ ### Example ```http -curl "https://api.openai.com/v1/organization/usage/code_interpreter_sessions?start_time=1730419200&limit=1" \ +curl "https://api.openai.com/v1/organization/usage/embeddings?start_time=1730419200&limit=1" \ -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -H "Content-Type: application/json" ``` @@ -5062,9 +5145,13 @@ curl "https://api.openai.com/v1/organization/usage/code_interpreter_sessions?sta "end_time": 1730505600, "results": [ { - "object": "organization.usage.code_interpreter_sessions.result", - "num_sessions": 1, - "project_id": null + "object": "organization.usage.embeddings.result", + "input_tokens": 16, + "num_model_requests": 2, + "project_id": null, + "user_id": null, + "api_key_id": null, + "model": null } ] } @@ -5074,11 +5161,11 @@ curl "https://api.openai.com/v1/organization/usage/code_interpreter_sessions?sta } ``` -## Completions +## Images -**get** `/organization/usage/completions` +**get** `/organization/usage/images` -Get completions usage details for the organization. +Get images usage details for the organization. ### Query Parameters @@ -5090,10 +5177,6 @@ Get completions usage details for the organization. Return only usage for these API keys. -- `batch: optional boolean` - - If `true`, return batch jobs only. If `false`, return non-batch jobs only. By default, return both. - - `bucket_width: optional "1m" or "1h" or "1d"` Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. @@ -5110,7 +5193,7 @@ Get completions usage details for the organization. - `group_by: optional array of "project_id" or "user_id" or "api_key_id" or 3 more` - Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier` or any combination of them. + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `size`, `source` or any combination of them. - `"project_id"` @@ -5120,9 +5203,9 @@ Get completions usage details for the organization. - `"model"` - - `"batch"` + - `"size"` - - `"service_tier"` + - `"source"` - `limit: optional number` @@ -5144,6 +5227,30 @@ Get completions usage details for the organization. Return only usage for these projects. +- `sizes: optional array of "256x256" or "512x512" or "1024x1024" or 2 more` + + Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them. + + - `"256x256"` + + - `"512x512"` + + - `"1024x1024"` + + - `"1792x1792"` + + - `"1024x1792"` + +- `sources: optional array of "image.generation" or "image.edit" or "image.variation"` + + Return only usages for these sources. Possible values are `image.generation`, `image.edit`, `image.variation` or any combination of them. + + - `"image.generation"` + + - `"image.edit"` + + - `"image.variation"` + - `user_ids: optional array of string` Return only usage for these users. @@ -5416,7 +5523,7 @@ Get completions usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -5436,6 +5543,10 @@ Get completions usage details for the organization. The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -5457,8 +5568,8 @@ Get completions usage details for the organization. ### Example ```http -curl https://api.openai.com/v1/organization/usage/completions \ - -H "Authorization: Bearer $OPENAI_API_KEY" +curl https://api.openai.com/v1/organization/usage/images \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -5498,7 +5609,7 @@ curl https://api.openai.com/v1/organization/usage/completions \ ### Example ```http -curl "https://api.openai.com/v1/organization/usage/completions?start_time=1730419200&limit=1" \ +curl "https://api.openai.com/v1/organization/usage/images?start_time=1730419200&limit=1" \ -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -H "Content-Type: application/json" ``` @@ -5515,33 +5626,29 @@ curl "https://api.openai.com/v1/organization/usage/completions?start_time=173041 "end_time": 1730505600, "results": [ { - "object": "organization.usage.completions.result", - "input_tokens": 1000, - "output_tokens": 500, - "input_cached_tokens": 800, - "input_audio_tokens": 0, - "output_audio_tokens": 0, - "num_model_requests": 5, + "object": "organization.usage.images.result", + "images": 2, + "num_model_requests": 2, + "size": null, + "source": null, "project_id": null, "user_id": null, "api_key_id": null, - "model": null, - "batch": null, - "service_tier": null + "model": null } ] } ], - "has_more": true, - "next_page": "page_AAAAAGdGxdEiJdKOAAAAAGcqsYA=" + "has_more": false, + "next_page": null } ``` -## Embeddings +## Moderations -**get** `/organization/usage/embeddings` +**get** `/organization/usage/moderations` -Get embeddings usage details for the organization. +Get moderations usage details for the organization. ### Query Parameters @@ -5871,7 +5978,7 @@ Get embeddings usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -5891,6 +5998,10 @@ Get embeddings usage details for the organization. The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -5912,8 +6023,8 @@ Get embeddings usage details for the organization. ### Example ```http -curl https://api.openai.com/v1/organization/usage/embeddings \ - -H "Authorization: Bearer $OPENAI_API_KEY" +curl https://api.openai.com/v1/organization/usage/moderations \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -5953,7 +6064,7 @@ curl https://api.openai.com/v1/organization/usage/embeddings \ ### Example ```http -curl "https://api.openai.com/v1/organization/usage/embeddings?start_time=1730419200&limit=1" \ +curl "https://api.openai.com/v1/organization/usage/moderations?start_time=1730419200&limit=1" \ -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -H "Content-Type: application/json" ``` @@ -5970,7 +6081,7 @@ curl "https://api.openai.com/v1/organization/usage/embeddings?start_time=1730419 "end_time": 1730505600, "results": [ { - "object": "organization.usage.embeddings.result", + "object": "organization.usage.moderations.result", "input_tokens": 16, "num_model_requests": 2, "project_id": null, @@ -5986,11 +6097,11 @@ curl "https://api.openai.com/v1/organization/usage/embeddings?start_time=1730419 } ``` -## Images +## Vector stores -**get** `/organization/usage/images` +**get** `/organization/usage/vector_stores` -Get images usage details for the organization. +Get vector stores usage details for the organization. ### Query Parameters @@ -5998,10 +6109,6 @@ Get images usage details for the organization. Start time (Unix seconds) of the query time range, inclusive. -- `api_key_ids: optional array of string` - - Return only usage for these API keys. - - `bucket_width: optional "1m" or "1h" or "1d"` Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. @@ -6016,22 +6123,12 @@ Get images usage details for the organization. End time (Unix seconds) of the query time range, exclusive. -- `group_by: optional array of "project_id" or "user_id" or "api_key_id" or 3 more` +- `group_by: optional array of "project_id"` - Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `size`, `source` or any combination of them. + Group the usage data by the specified fields. Support fields include `project_id`. - `"project_id"` - - `"user_id"` - - - `"api_key_id"` - - - `"model"` - - - `"size"` - - - `"source"` - - `limit: optional number` Specifies the number of buckets to return. @@ -6040,10 +6137,6 @@ Get images usage details for the organization. - `bucket_width=1h`: default: 24, max: 168 - `bucket_width=1m`: default: 60, max: 1440 -- `models: optional array of string` - - Return only usage for these models. - - `page: optional string` A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. @@ -6052,34 +6145,6 @@ Get images usage details for the organization. Return only usage for these projects. -- `sizes: optional array of "256x256" or "512x512" or "1024x1024" or 2 more` - - Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them. - - - `"256x256"` - - - `"512x512"` - - - `"1024x1024"` - - - `"1792x1792"` - - - `"1024x1792"` - -- `sources: optional array of "image.generation" or "image.edit" or "image.variation"` - - Return only usages for these sources. Possible values are `image.generation`, `image.edit`, `image.variation` or any combination of them. - - - `"image.generation"` - - - `"image.edit"` - - - `"image.variation"` - -- `user_ids: optional array of string` - - Return only usage for these users. - ### Returns - `data: array of object { end_time, object, result, start_time }` @@ -6348,7 +6413,7 @@ Get images usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -6368,6 +6433,10 @@ Get images usage details for the organization. The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -6389,8 +6458,8 @@ Get images usage details for the organization. ### Example ```http -curl https://api.openai.com/v1/organization/usage/images \ - -H "Authorization: Bearer $OPENAI_API_KEY" +curl https://api.openai.com/v1/organization/usage/vector_stores \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -6430,7 +6499,7 @@ curl https://api.openai.com/v1/organization/usage/images \ ### Example ```http -curl "https://api.openai.com/v1/organization/usage/images?start_time=1730419200&limit=1" \ +curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730419200&limit=1" \ -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -H "Content-Type: application/json" ``` @@ -6447,15 +6516,9 @@ curl "https://api.openai.com/v1/organization/usage/images?start_time=1730419200& "end_time": 1730505600, "results": [ { - "object": "organization.usage.images.result", - "images": 2, - "num_model_requests": 2, - "size": null, - "source": null, - "project_id": null, - "user_id": null, - "api_key_id": null, - "model": null + "object": "organization.usage.vector_stores.result", + "usage_bytes": 1024, + "project_id": null } ] } @@ -6465,11 +6528,11 @@ curl "https://api.openai.com/v1/organization/usage/images?start_time=1730419200& } ``` -## Moderations +## Costs -**get** `/organization/usage/moderations` +**get** `/organization/costs` -Get moderations usage details for the organization. +Get costs details for the organization. ### Query Parameters @@ -6479,15 +6542,11 @@ Get moderations usage details for the organization. - `api_key_ids: optional array of string` - Return only usage for these API keys. - -- `bucket_width: optional "1m" or "1h" or "1d"` - - Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + Return only costs for these API keys. - - `"1m"` +- `bucket_width: optional "1d"` - - `"1h"` + Width of each time bucket in response. Currently only `1d` is supported, default to `1d`. - `"1d"` @@ -6495,29 +6554,19 @@ Get moderations usage details for the organization. End time (Unix seconds) of the query time range, exclusive. -- `group_by: optional array of "project_id" or "user_id" or "api_key_id" or "model"` +- `group_by: optional array of "project_id" or "line_item" or "api_key_id"` - Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. + Group the costs by the specified fields. Support fields include `project_id`, `line_item`, `api_key_id` and any combination of them. - `"project_id"` - - `"user_id"` + - `"line_item"` - `"api_key_id"` - - `"model"` - - `limit: optional number` - Specifies the number of buckets to return. - - - `bucket_width=1d`: default: 7, max: 31 - - `bucket_width=1h`: default: 24, max: 168 - - `bucket_width=1m`: default: 60, max: 1440 - -- `models: optional array of string` - - Return only usage for these models. + A limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7. - `page: optional string` @@ -6525,11 +6574,7 @@ Get moderations usage details for the organization. - `project_ids: optional array of string` - Return only usage for these projects. - -- `user_ids: optional array of string` - - Return only usage for these users. + Return only costs for these projects. ### Returns @@ -6799,7 +6844,7 @@ Get moderations usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -6819,6 +6864,10 @@ Get moderations usage details for the organization. The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -6840,8 +6889,8 @@ Get moderations usage details for the organization. ### Example ```http -curl https://api.openai.com/v1/organization/usage/moderations \ - -H "Authorization: Bearer $OPENAI_API_KEY" +curl https://api.openai.com/v1/organization/costs \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -6881,7 +6930,7 @@ curl https://api.openai.com/v1/organization/usage/moderations \ ### Example ```http -curl "https://api.openai.com/v1/organization/usage/moderations?start_time=1730419200&limit=1" \ +curl "https://api.openai.com/v1/organization/costs?start_time=1730419200&limit=1" \ -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -H "Content-Type: application/json" ``` @@ -6898,13 +6947,14 @@ curl "https://api.openai.com/v1/organization/usage/moderations?start_time=173041 "end_time": 1730505600, "results": [ { - "object": "organization.usage.moderations.result", - "input_tokens": 16, - "num_model_requests": 2, + "object": "organization.costs.result", + "amount": { + "value": 0.06, + "currency": "usd" + }, + "line_item": null, "project_id": null, - "user_id": null, - "api_key_id": null, - "model": null + "api_key_id": null } ] } @@ -6914,57 +6964,13 @@ curl "https://api.openai.com/v1/organization/usage/moderations?start_time=173041 } ``` -## Vector stores - -**get** `/organization/usage/vector_stores` - -Get vector stores usage details for the organization. - -### Query Parameters - -- `start_time: number` - - Start time (Unix seconds) of the query time range, inclusive. - -- `bucket_width: optional "1m" or "1h" or "1d"` - - Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - - - `"1m"` - - - `"1h"` - - - `"1d"` - -- `end_time: optional number` - - End time (Unix seconds) of the query time range, exclusive. - -- `group_by: optional array of "project_id"` - - Group the usage data by the specified fields. Support fields include `project_id`. - - - `"project_id"` - -- `limit: optional number` - - Specifies the number of buckets to return. - - - `bucket_width=1d`: default: 7, max: 31 - - `bucket_width=1h`: default: 24, max: 168 - - `bucket_width=1m`: default: 60, max: 1440 - -- `page: optional string` - - A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - -- `project_ids: optional array of string` +## Domain Types - Return only usage for these projects. +### Usage Audio Speeches Response -### Returns +- `UsageAudioSpeechesResponse object { data, has_more, next_page, object }` -- `data: array of object { end_time, object, result, start_time }` + - `data: array of object { end_time, object, result, start_time }` - `end_time: number` @@ -7230,7 +7236,7 @@ Get vector stores usage details for the organization. When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -7250,6 +7256,10 @@ Get vector stores usage details for the organization. The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -7260,92 +7270,17 @@ Get vector stores usage details for the organization. - `start_time: number` -- `has_more: boolean` + - `has_more: boolean` -- `next_page: string` + - `next_page: string` -- `object: "page"` + - `object: "page"` - `"page"` -### Example - -```http -curl https://api.openai.com/v1/organization/usage/vector_stores \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "end_time": 0, - "object": "bucket", - "result": [ - { - "input_tokens": 0, - "num_model_requests": 0, - "object": "organization.usage.completions.result", - "output_tokens": 0, - "api_key_id": "api_key_id", - "batch": true, - "input_audio_tokens": 0, - "input_cached_tokens": 0, - "model": "model", - "output_audio_tokens": 0, - "project_id": "project_id", - "service_tier": "service_tier", - "user_id": "user_id" - } - ], - "start_time": 0 - } - ], - "has_more": true, - "next_page": "next_page", - "object": "page" -} -``` - -### Example - -```http -curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730419200&limit=1" \ --H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ --H "Content-Type: application/json" -``` - -#### Response - -```json -{ - "object": "page", - "data": [ - { - "object": "bucket", - "start_time": 1730419200, - "end_time": 1730505600, - "results": [ - { - "object": "organization.usage.vector_stores.result", - "usage_bytes": 1024, - "project_id": null - } - ] - } - ], - "has_more": false, - "next_page": null -} -``` - -## Domain Types - -### Usage Get Audio Speeches Response +### Usage Audio Transcriptions Response -- `UsageGetAudioSpeechesResponse object { data, has_more, next_page, object }` +- `UsageAudioTranscriptionsResponse object { data, has_more, next_page, object }` - `data: array of object { end_time, object, result, start_time }` @@ -7613,7 +7548,7 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -7633,6 +7568,10 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -7651,9 +7590,9 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 - `"page"` -### Usage Get Audio Transcriptions Response +### Usage Code Interpreter Sessions Response -- `UsageGetAudioTranscriptionsResponse object { data, has_more, next_page, object }` +- `UsageCodeInterpreterSessionsResponse object { data, has_more, next_page, object }` - `data: array of object { end_time, object, result, start_time }` @@ -7921,7 +7860,7 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -7941,6 +7880,10 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -7959,9 +7902,9 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 - `"page"` -### Usage Get Code Interpreter Sessions Response +### Usage Completions Response -- `UsageGetCodeInterpreterSessionsResponse object { data, has_more, next_page, object }` +- `UsageCompletionsResponse object { data, has_more, next_page, object }` - `data: array of object { end_time, object, result, start_time }` @@ -8229,7 +8172,7 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -8249,6 +8192,10 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -8267,9 +8214,9 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 - `"page"` -### Usage Get Completions Response +### Usage Embeddings Response -- `UsageGetCompletionsResponse object { data, has_more, next_page, object }` +- `UsageEmbeddingsResponse object { data, has_more, next_page, object }` - `data: array of object { end_time, object, result, start_time }` @@ -8537,7 +8484,7 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -8557,6 +8504,10 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -8575,9 +8526,9 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 - `"page"` -### Usage Get Embeddings Response +### Usage Images Response -- `UsageGetEmbeddingsResponse object { data, has_more, next_page, object }` +- `UsageImagesResponse object { data, has_more, next_page, object }` - `data: array of object { end_time, object, result, start_time }` @@ -8845,7 +8796,7 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -8865,6 +8816,10 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -8883,9 +8838,9 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 - `"page"` -### Usage Get Images Response +### Usage Moderations Response -- `UsageGetImagesResponse object { data, has_more, next_page, object }` +- `UsageModerationsResponse object { data, has_more, next_page, object }` - `data: array of object { end_time, object, result, start_time }` @@ -9153,7 +9108,7 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -9173,6 +9128,10 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -9191,9 +9150,9 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 - `"page"` -### Usage Get Moderations Response +### Usage Vector Stores Response -- `UsageGetModerationsResponse object { data, has_more, next_page, object }` +- `UsageVectorStoresResponse object { data, has_more, next_page, object }` - `data: array of object { end_time, object, result, start_time }` @@ -9461,7 +9420,7 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -9481,6 +9440,10 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -9499,9 +9462,9 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 - `"page"` -### Usage Get Vector Stores Response +### Usage Costs Response -- `UsageGetVectorStoresResponse object { data, has_more, next_page, object }` +- `UsageCostsResponse object { data, has_more, next_page, object }` - `data: array of object { end_time, object, result, start_time }` @@ -9769,7 +9732,7 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 When `group_by=project_id`, this field provides the project ID of the grouped usage result. - - `CostsResult object { object, amount, line_item, project_id }` + - `CostsResult object { object, amount, api_key_id, 2 more }` The aggregated costs details of the specific time bucket. @@ -9789,6 +9752,10 @@ curl "https://api.openai.com/v1/organization/usage/vector_stores?start_time=1730 The numeric value of the cost. + - `api_key_id: optional string` + + When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. + - `line_item: optional string` When `group_by=line_item`, this field provides the line item of the grouped costs result. @@ -9911,7 +9878,7 @@ Returns a list of invites in the organization. ```http curl https://api.openai.com/v1/organization/invites \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -10081,7 +10048,7 @@ Create an invite for a user to the organization. The invite must be accepted by ```http curl https://api.openai.com/v1/organization/invites \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "email": "email", "role": "reader" @@ -10236,7 +10203,7 @@ Retrieves an invite. ```http curl https://api.openai.com/v1/organization/invites/$INVITE_ID \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -10310,7 +10277,7 @@ Delete an invite. If the invite has already been accepted, it cannot be deleted. ```http curl https://api.openai.com/v1/organization/invites/$INVITE_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -10447,7 +10414,7 @@ Lists all of the users in the organization. ### Returns -- `data: array of User` +- `data: array of OrganizationUser` - `id: string` @@ -10493,7 +10460,7 @@ Lists all of the users in the organization. ```http curl https://api.openai.com/v1/organization/users \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -10558,7 +10525,7 @@ Retrieves a user by their identifier. ### Returns -- `User object { id, added_at, email, 3 more }` +- `OrganizationUser object { id, added_at, email, 3 more }` Represents an individual `user` within an organization. @@ -10596,7 +10563,7 @@ Retrieves a user by their identifier. ```http curl https://api.openai.com/v1/organization/users/$USER_ID \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -10655,7 +10622,7 @@ Modifies a user's role in the organization. ### Returns -- `User object { id, added_at, email, 3 more }` +- `OrganizationUser object { id, added_at, email, 3 more }` Represents an individual `user` within an organization. @@ -10694,7 +10661,7 @@ Modifies a user's role in the organization. ```http curl https://api.openai.com/v1/organization/users/$USER_ID \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "role": "owner" }' @@ -10762,7 +10729,7 @@ Deletes a user from the organization. ```http curl https://api.openai.com/v1/organization/users/$USER_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -10795,9 +10762,9 @@ curl -X DELETE https://api.openai.com/v1/organization/users/user_abc \ ## Domain Types -### User +### Organization User -- `User object { id, added_at, email, 3 more }` +- `OrganizationUser object { id, added_at, email, 3 more }` Represents an individual `user` within an organization. @@ -10941,7 +10908,7 @@ Lists the organization roles assigned to a user within the organization. ```http curl https://api.openai.com/v1/organization/users/$USER_ID/roles \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -11039,7 +11006,7 @@ Assigns an organization role to a user within the organization. - `"user.role"` -- `role: object { id, description, name, 4 more }` +- `role: Role` Details about a role that can be assigned through the public Roles API. @@ -11073,7 +11040,7 @@ Assigns an organization role to a user within the organization. Resource type the role is bound to (for example `api.organization` or `api.project`). -- `user: User` +- `user: OrganizationUser` Represents an individual `user` within an organization. @@ -11112,7 +11079,7 @@ Assigns an organization role to a user within the organization. ```http curl https://api.openai.com/v1/organization/users/$USER_ID/roles \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "role_id": "role_id" }' @@ -11211,7 +11178,7 @@ Unassigns an organization role from a user within the organization. ```http curl https://api.openai.com/v1/organization/users/$USER_ID/roles/$ROLE_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -11304,7 +11271,7 @@ curl -X DELETE https://api.openai.com/v1/organization/users/user_abc123/roles/ro - `"user.role"` - - `role: object { id, description, name, 4 more }` + - `role: Role` Details about a role that can be assigned through the public Roles API. @@ -11338,7 +11305,7 @@ curl -X DELETE https://api.openai.com/v1/organization/users/user_abc123/roles/ro Resource type the role is bound to (for example `api.organization` or `api.project`). - - `user: User` + - `user: OrganizationUser` Represents an individual `user` within an organization. @@ -11414,7 +11381,7 @@ Lists all groups in the organization. ### Returns -- `data: array of object { id, created_at, is_scim_managed, name }` +- `data: array of Group` Groups returned in the current page. @@ -11452,7 +11419,7 @@ Lists all groups in the organization. ```http curl https://api.openai.com/v1/organization/groups \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -11514,19 +11481,23 @@ Creates a new group in the organization. ### Returns -- `id: string` +- `Group object { id, created_at, is_scim_managed, name }` + + Details about an organization group. + + - `id: string` Identifier for the group. -- `created_at: number` + - `created_at: number` Unix timestamp (in seconds) when the group was created. -- `is_scim_managed: boolean` + - `is_scim_managed: boolean` Whether the group is managed through SCIM and controlled by your identity provider. -- `name: string` + - `name: string` Display name of the group. @@ -11535,7 +11506,7 @@ Creates a new group in the organization. ```http curl https://api.openai.com/v1/organization/groups \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "name": "x" }' @@ -11614,7 +11585,7 @@ Updates a group's information. ```http curl https://api.openai.com/v1/organization/groups/$GROUP_ID \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "name": "x" }' @@ -11684,7 +11655,7 @@ Deletes a group from the organization. ```http curl https://api.openai.com/v1/organization/groups/$GROUP_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -11717,31 +11688,9 @@ curl -X DELETE https://api.openai.com/v1/organization/groups/group_01J1F8ABCDXYZ ## Domain Types -### Group List Response - -- `GroupListResponse object { id, created_at, is_scim_managed, name }` +### Group - Details about an organization group. - - - `id: string` - - Identifier for the group. - - - `created_at: number` - - Unix timestamp (in seconds) when the group was created. - - - `is_scim_managed: boolean` - - Whether the group is managed through SCIM and controlled by your identity provider. - - - `name: string` - - Display name of the group. - -### Group Create Response - -- `GroupCreateResponse object { id, created_at, is_scim_managed, name }` +- `Group object { id, created_at, is_scim_managed, name }` Details about an organization group. @@ -11835,7 +11784,7 @@ Lists the users assigned to a group. ### Returns -- `data: array of User` +- `data: array of OrganizationUser` Users in the current page. @@ -11887,7 +11836,7 @@ Lists the users assigned to a group. ```http curl https://api.openai.com/v1/organization/groups/$GROUP_ID/users \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -11975,7 +11924,7 @@ Adds a user to a group. ```http curl https://api.openai.com/v1/organization/groups/$GROUP_ID/users \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "user_id": "user_id" }' @@ -12041,7 +11990,7 @@ Removes a user from a group. ```http curl https://api.openai.com/v1/organization/groups/$GROUP_ID/users/$USER_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -12206,7 +12155,7 @@ Lists the organization roles assigned to a group within the organization. ```http curl https://api.openai.com/v1/organization/groups/$GROUP_ID/roles \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -12330,7 +12279,7 @@ Assigns an organization role to a group within the organization. - `"group.role"` -- `role: object { id, description, name, 4 more }` +- `role: Role` Details about a role that can be assigned through the public Roles API. @@ -12369,7 +12318,7 @@ Assigns an organization role to a group within the organization. ```http curl https://api.openai.com/v1/organization/groups/$GROUP_ID/roles \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "role_id": "role_id" }' @@ -12466,7 +12415,7 @@ Unassigns an organization role from a group within the organization. ```http curl https://api.openai.com/v1/organization/groups/$GROUP_ID/roles/$ROLE_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -12585,7 +12534,7 @@ curl -X DELETE https://api.openai.com/v1/organization/groups/group_01J1F8ABCDXYZ - `"group.role"` - - `role: object { id, description, name, 4 more }` + - `role: Role` Details about a role that can be assigned through the public Roles API. @@ -12661,7 +12610,7 @@ Lists the roles configured for the organization. ### Returns -- `data: array of object { id, description, name, 4 more }` +- `data: array of Role` Roles returned in the current page. @@ -12713,7 +12662,7 @@ Lists the roles configured for the organization. ```http curl https://api.openai.com/v1/organization/roles \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -12793,33 +12742,37 @@ Creates a custom role for the organization. ### Returns -- `id: string` +- `Role object { id, description, name, 4 more }` + + Details about a role that can be assigned through the public Roles API. + + - `id: string` Identifier for the role. -- `description: string` + - `description: string` Optional description of the role. -- `name: string` + - `name: string` Unique name for the role. -- `object: "role"` + - `object: "role"` Always `role`. - `"role"` -- `permissions: array of string` + - `permissions: array of string` Permissions granted by the role. -- `predefined_role: boolean` + - `predefined_role: boolean` Whether the role is predefined and managed by OpenAI. -- `resource_type: string` + - `resource_type: string` Resource type the role is bound to (for example `api.organization` or `api.project`). @@ -12828,7 +12781,7 @@ Creates a custom role for the organization. ```http curl https://api.openai.com/v1/organization/roles \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "permissions": [ "string" @@ -12912,33 +12865,37 @@ Updates an existing organization role. ### Returns -- `id: string` +- `Role object { id, description, name, 4 more }` + + Details about a role that can be assigned through the public Roles API. + + - `id: string` Identifier for the role. -- `description: string` + - `description: string` Optional description of the role. -- `name: string` + - `name: string` Unique name for the role. -- `object: "role"` + - `object: "role"` Always `role`. - `"role"` -- `permissions: array of string` + - `permissions: array of string` Permissions granted by the role. -- `predefined_role: boolean` + - `predefined_role: boolean` Whether the role is predefined and managed by OpenAI. -- `resource_type: string` + - `resource_type: string` Resource type the role is bound to (for example `api.organization` or `api.project`). @@ -12947,7 +12904,7 @@ Updates an existing organization role. ```http curl https://api.openai.com/v1/organization/roles/$ROLE_ID \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{}' ``` @@ -13031,7 +12988,7 @@ Deletes a custom role from the organization. ```http curl https://api.openai.com/v1/organization/roles/$ROLE_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -13064,81 +13021,9 @@ curl -X DELETE https://api.openai.com/v1/organization/roles/role_01J1F8ROLE01 \ ## Domain Types -### Role List Response - -- `RoleListResponse object { id, description, name, 4 more }` - - Details about a role that can be assigned through the public Roles API. - - - `id: string` - - Identifier for the role. - - - `description: string` - - Optional description of the role. - - - `name: string` - - Unique name for the role. - - - `object: "role"` - - Always `role`. - - - `"role"` - - - `permissions: array of string` - - Permissions granted by the role. - - - `predefined_role: boolean` - - Whether the role is predefined and managed by OpenAI. - - - `resource_type: string` - - Resource type the role is bound to (for example `api.organization` or `api.project`). - -### Role Create Response - -- `RoleCreateResponse object { id, description, name, 4 more }` - - Details about a role that can be assigned through the public Roles API. - - - `id: string` - - Identifier for the role. - - - `description: string` - - Optional description of the role. - - - `name: string` - - Unique name for the role. - - - `object: "role"` - - Always `role`. - - - `"role"` - - - `permissions: array of string` - - Permissions granted by the role. - - - `predefined_role: boolean` - - Whether the role is predefined and managed by OpenAI. - - - `resource_type: string` - - Resource type the role is bound to (for example `api.organization` or `api.project`). - -### Role Update Response +### Role -- `RoleUpdateResponse object { id, description, name, 4 more }` +- `Role object { id, description, name, 4 more }` Details about a role that can be assigned through the public Roles API. @@ -13220,7 +13105,7 @@ List uploaded certificates for this organization. ### Returns -- `data: array of object { id, certificate_details, created_at, 3 more }` +- `data: array of Certificate` - `id: string` @@ -13280,7 +13165,7 @@ List uploaded certificates for this organization. ```http curl https://api.openai.com/v1/organization/certificates \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -13359,11 +13244,15 @@ Organizations can upload up to 50 certificates. ### Returns -- `id: string` +- `Certificate object { id, certificate_details, created_at, 3 more }` + + Represents an individual `certificate` uploaded to the organization. + + - `id: string` The identifier, which can be referenced in API endpoints -- `certificate_details: object { content, expires_at, valid_at }` + - `certificate_details: object { content, expires_at, valid_at }` - `content: optional string` @@ -13377,15 +13266,15 @@ Organizations can upload up to 50 certificates. The Unix timestamp (in seconds) of when the certificate becomes valid. -- `created_at: number` + - `created_at: number` The Unix timestamp (in seconds) of when the certificate was uploaded. -- `name: string` + - `name: string` The name of the certificate. -- `object: "certificate" or "organization.certificate" or "organization.project.certificate"` + - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` The object type. @@ -13399,7 +13288,7 @@ Organizations can upload up to 50 certificates. - `"organization.project.certificate"` -- `active: optional boolean` + - `active: optional boolean` Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. @@ -13408,7 +13297,7 @@ Organizations can upload up to 50 certificates. ```http curl https://api.openai.com/v1/organization/certificates \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "content": "content" }' @@ -13480,11 +13369,15 @@ You can get a certificate regardless of whether it is active or not. ### Returns -- `id: string` +- `Certificate object { id, certificate_details, created_at, 3 more }` + + Represents an individual `certificate` uploaded to the organization. + + - `id: string` The identifier, which can be referenced in API endpoints -- `certificate_details: object { content, expires_at, valid_at }` + - `certificate_details: object { content, expires_at, valid_at }` - `content: optional string` @@ -13498,15 +13391,15 @@ You can get a certificate regardless of whether it is active or not. The Unix timestamp (in seconds) of when the certificate becomes valid. -- `created_at: number` + - `created_at: number` The Unix timestamp (in seconds) of when the certificate was uploaded. -- `name: string` + - `name: string` The name of the certificate. -- `object: "certificate" or "organization.certificate" or "organization.project.certificate"` + - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` The object type. @@ -13520,7 +13413,7 @@ You can get a certificate regardless of whether it is active or not. - `"organization.project.certificate"` -- `active: optional boolean` + - `active: optional boolean` Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. @@ -13528,7 +13421,7 @@ You can get a certificate regardless of whether it is active or not. ```http curl https://api.openai.com/v1/organization/certificates/$CERTIFICATE_ID \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -13589,11 +13482,15 @@ Modify a certificate. Note that only the name can be modified. ### Returns -- `id: string` +- `Certificate object { id, certificate_details, created_at, 3 more }` + + Represents an individual `certificate` uploaded to the organization. + + - `id: string` The identifier, which can be referenced in API endpoints -- `certificate_details: object { content, expires_at, valid_at }` + - `certificate_details: object { content, expires_at, valid_at }` - `content: optional string` @@ -13607,15 +13504,15 @@ Modify a certificate. Note that only the name can be modified. The Unix timestamp (in seconds) of when the certificate becomes valid. -- `created_at: number` + - `created_at: number` The Unix timestamp (in seconds) of when the certificate was uploaded. -- `name: string` + - `name: string` The name of the certificate. -- `object: "certificate" or "organization.certificate" or "organization.project.certificate"` + - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` The object type. @@ -13629,7 +13526,7 @@ Modify a certificate. Note that only the name can be modified. - `"organization.project.certificate"` -- `active: optional boolean` + - `active: optional boolean` Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. @@ -13638,7 +13535,7 @@ Modify a certificate. Note that only the name can be modified. ```http curl https://api.openai.com/v1/organization/certificates/$CERTIFICATE_ID \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "name": "name" }' @@ -13716,7 +13613,7 @@ The certificate must be inactive for the organization and all projects. ```http curl https://api.openai.com/v1/organization/certificates/$CERTIFICATE_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -13728,180 +13625,29 @@ curl https://api.openai.com/v1/organization/certificates/$CERTIFICATE_ID \ } ``` -### Example - -```http -curl -X DELETE https://api.openai.com/v1/organization/certificates/cert_abc \ --H "Authorization: Bearer $OPENAI_ADMIN_KEY" -``` - -#### Response - -```json -{ - "object": "certificate.deleted", - "id": "cert_abc" -} -``` - -## Activate certificates for organization - -**post** `/organization/certificates/activate` - -Activate certificates at the organization level. - -You can atomically and idempotently activate up to 10 certificates at a time. - -### Body Parameters - -- `certificate_ids: array of string` - -### Returns - -- `data: array of object { id, certificate_details, created_at, 3 more }` - - - `id: string` - - The identifier, which can be referenced in API endpoints - - - `certificate_details: object { content, expires_at, valid_at }` - - - `content: optional string` - - The content of the certificate in PEM format. - - - `expires_at: optional number` - - The Unix timestamp (in seconds) of when the certificate expires. - - - `valid_at: optional number` - - The Unix timestamp (in seconds) of when the certificate becomes valid. - - - `created_at: number` - - The Unix timestamp (in seconds) of when the certificate was uploaded. - - - `name: string` - - The name of the certificate. - - - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` - - The object type. - - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - - - `"certificate"` - - - `"organization.certificate"` - - - `"organization.project.certificate"` - - - `active: optional boolean` - - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. - -- `has_more: boolean` - -- `object: "list"` - - - `"list"` - -- `first_id: optional string` - -- `last_id: optional string` - -### Example - -```http -curl https://api.openai.com/v1/organization/certificates/activate \ - -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "certificate_ids": [ - "cert_abc" - ] - }' -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "certificate_details": { - "content": "content", - "expires_at": 0, - "valid_at": 0 - }, - "created_at": 0, - "name": "name", - "object": "certificate", - "active": true - } - ], - "has_more": true, - "object": "list", - "first_id": "cert_abc", - "last_id": "cert_abc" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/organization/certificates/activate \ --H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ --H "Content-Type: application/json" \ --d '{ - "data": ["cert_abc", "cert_def"] -}' +### Example + +```http +curl -X DELETE https://api.openai.com/v1/organization/certificates/cert_abc \ +-H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response ```json { - "object": "organization.certificate.activation", - "data": [ - { - "object": "organization.certificate", - "id": "cert_abc", - "name": "My Example Certificate", - "active": true, - "created_at": 1234567, - "certificate_details": { - "valid_at": 12345667, - "expires_at": 12345678 - } - }, - { - "object": "organization.certificate", - "id": "cert_def", - "name": "My Example Certificate 2", - "active": true, - "created_at": 1234567, - "certificate_details": { - "valid_at": 12345667, - "expires_at": 12345678 - } - }, - ], + "object": "certificate.deleted", + "id": "cert_abc" } ``` -## Deactivate certificates for organization +## Activate certificates for organization -**post** `/organization/certificates/deactivate` +**post** `/organization/certificates/activate` -Deactivate certificates at the organization level. +Activate certificates at the organization level. -You can atomically and idempotently deactivate up to 10 certificates at a time. +You can atomically and idempotently activate up to 10 certificates at a time. ### Body Parameters @@ -13909,7 +13655,7 @@ You can atomically and idempotently deactivate up to 10 certificates at a time. ### Returns -- `data: array of object { id, certificate_details, created_at, 3 more }` +- `data: array of Certificate` - `id: string` @@ -13968,9 +13714,9 @@ You can atomically and idempotently deactivate up to 10 certificates at a time. ### Example ```http -curl https://api.openai.com/v1/organization/certificates/deactivate \ +curl https://api.openai.com/v1/organization/certificates/activate \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "certificate_ids": [ "cert_abc" @@ -14006,7 +13752,7 @@ curl https://api.openai.com/v1/organization/certificates/deactivate \ ### Example ```http -curl https://api.openai.com/v1/organization/certificates/deactivate \ +curl https://api.openai.com/v1/organization/certificates/activate \ -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -H "Content-Type: application/json" \ -d '{ @@ -14018,13 +13764,13 @@ curl https://api.openai.com/v1/organization/certificates/deactivate \ ```json { - "object": "organization.certificate.deactivation", + "object": "organization.certificate.activation", "data": [ { "object": "organization.certificate", "id": "cert_abc", "name": "My Example Certificate", - "active": false, + "active": true, "created_at": 1234567, "certificate_details": { "valid_at": 12345667, @@ -14035,238 +13781,32 @@ curl https://api.openai.com/v1/organization/certificates/deactivate \ "object": "organization.certificate", "id": "cert_def", "name": "My Example Certificate 2", - "active": false, + "active": true, "created_at": 1234567, "certificate_details": { - "valid_at": 12345667, - "expires_at": 12345678 - } - }, - ], -} -``` - -## Domain Types - -### Certificate List Response - -- `CertificateListResponse object { id, certificate_details, created_at, 3 more }` - - Represents an individual `certificate` uploaded to the organization. - - - `id: string` - - The identifier, which can be referenced in API endpoints - - - `certificate_details: object { content, expires_at, valid_at }` - - - `content: optional string` - - The content of the certificate in PEM format. - - - `expires_at: optional number` - - The Unix timestamp (in seconds) of when the certificate expires. - - - `valid_at: optional number` - - The Unix timestamp (in seconds) of when the certificate becomes valid. - - - `created_at: number` - - The Unix timestamp (in seconds) of when the certificate was uploaded. - - - `name: string` - - The name of the certificate. - - - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` - - The object type. - - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - - - `"certificate"` - - - `"organization.certificate"` - - - `"organization.project.certificate"` - - - `active: optional boolean` - - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. - -### Certificate Create Response - -- `CertificateCreateResponse object { id, certificate_details, created_at, 3 more }` - - Represents an individual `certificate` uploaded to the organization. - - - `id: string` - - The identifier, which can be referenced in API endpoints - - - `certificate_details: object { content, expires_at, valid_at }` - - - `content: optional string` - - The content of the certificate in PEM format. - - - `expires_at: optional number` - - The Unix timestamp (in seconds) of when the certificate expires. - - - `valid_at: optional number` - - The Unix timestamp (in seconds) of when the certificate becomes valid. - - - `created_at: number` - - The Unix timestamp (in seconds) of when the certificate was uploaded. - - - `name: string` - - The name of the certificate. - - - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` - - The object type. - - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - - - `"certificate"` - - - `"organization.certificate"` - - - `"organization.project.certificate"` - - - `active: optional boolean` - - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. - -### Certificate Retrieve Response - -- `CertificateRetrieveResponse object { id, certificate_details, created_at, 3 more }` - - Represents an individual `certificate` uploaded to the organization. - - - `id: string` - - The identifier, which can be referenced in API endpoints - - - `certificate_details: object { content, expires_at, valid_at }` - - - `content: optional string` - - The content of the certificate in PEM format. - - - `expires_at: optional number` - - The Unix timestamp (in seconds) of when the certificate expires. - - - `valid_at: optional number` - - The Unix timestamp (in seconds) of when the certificate becomes valid. - - - `created_at: number` - - The Unix timestamp (in seconds) of when the certificate was uploaded. - - - `name: string` - - The name of the certificate. - - - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` - - The object type. - - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - - - `"certificate"` - - - `"organization.certificate"` - - - `"organization.project.certificate"` - - - `active: optional boolean` - - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. - -### Certificate Update Response - -- `CertificateUpdateResponse object { id, certificate_details, created_at, 3 more }` - - Represents an individual `certificate` uploaded to the organization. - - - `id: string` - - The identifier, which can be referenced in API endpoints - - - `certificate_details: object { content, expires_at, valid_at }` - - - `content: optional string` - - The content of the certificate in PEM format. - - - `expires_at: optional number` - - The Unix timestamp (in seconds) of when the certificate expires. - - - `valid_at: optional number` - - The Unix timestamp (in seconds) of when the certificate becomes valid. - - - `created_at: number` - - The Unix timestamp (in seconds) of when the certificate was uploaded. - - - `name: string` - - The name of the certificate. - - - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` - - The object type. - - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - - - `"certificate"` - - - `"organization.certificate"` - - - `"organization.project.certificate"` - - - `active: optional boolean` - - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. - -### Certificate Delete Response - -- `CertificateDeleteResponse object { id, object }` + "valid_at": 12345667, + "expires_at": 12345678 + } + }, + ], +} +``` - - `id: string` +## Deactivate certificates for organization - The ID of the certificate that was deleted. +**post** `/organization/certificates/deactivate` - - `object: "certificate.deleted"` +Deactivate certificates at the organization level. - The object type, must be `certificate.deleted`. +You can atomically and idempotently deactivate up to 10 certificates at a time. - - `"certificate.deleted"` +### Body Parameters -### Certificate Activate Response +- `certificate_ids: array of string` -- `CertificateActivateResponse object { id, certificate_details, created_at, 3 more }` +### Returns - Represents an individual `certificate` uploaded to the organization. +- `data: array of Certificate` - `id: string` @@ -14312,9 +13852,102 @@ curl https://api.openai.com/v1/organization/certificates/deactivate \ Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. -### Certificate Deactivate Response +- `has_more: boolean` + +- `object: "list"` + + - `"list"` + +- `first_id: optional string` + +- `last_id: optional string` + +### Example + +```http +curl https://api.openai.com/v1/organization/certificates/deactivate \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -d '{ + "certificate_ids": [ + "cert_abc" + ] + }' +``` + +#### Response + +```json +{ + "data": [ + { + "id": "id", + "certificate_details": { + "content": "content", + "expires_at": 0, + "valid_at": 0 + }, + "created_at": 0, + "name": "name", + "object": "certificate", + "active": true + } + ], + "has_more": true, + "object": "list", + "first_id": "cert_abc", + "last_id": "cert_abc" +} +``` + +### Example + +```http +curl https://api.openai.com/v1/organization/certificates/deactivate \ +-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ +-H "Content-Type: application/json" \ +-d '{ + "data": ["cert_abc", "cert_def"] +}' +``` + +#### Response + +```json +{ + "object": "organization.certificate.deactivation", + "data": [ + { + "object": "organization.certificate", + "id": "cert_abc", + "name": "My Example Certificate", + "active": false, + "created_at": 1234567, + "certificate_details": { + "valid_at": 12345667, + "expires_at": 12345678 + } + }, + { + "object": "organization.certificate", + "id": "cert_def", + "name": "My Example Certificate 2", + "active": false, + "created_at": 1234567, + "certificate_details": { + "valid_at": 12345667, + "expires_at": 12345678 + } + }, + ], +} +``` + +## Domain Types + +### Certificate -- `CertificateDeactivateResponse object { id, certificate_details, created_at, 3 more }` +- `Certificate object { id, certificate_details, created_at, 3 more }` Represents an individual `certificate` uploaded to the organization. @@ -14362,6 +13995,20 @@ curl https://api.openai.com/v1/organization/certificates/deactivate \ Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. +### Certificate Delete Response + +- `CertificateDeleteResponse object { id, object }` + + - `id: string` + + The ID of the certificate that was deleted. + + - `object: "certificate.deleted"` + + The object type, must be `certificate.deleted`. + + - `"certificate.deleted"` + # Projects ## List projects @@ -14432,7 +14079,7 @@ Returns a list of projects. ```http curl https://api.openai.com/v1/organization/projects \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -14558,7 +14205,7 @@ Create a new project in the organization. Projects can be created and archived, ```http curl https://api.openai.com/v1/organization/projects \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "name": "name" }' @@ -14651,7 +14298,7 @@ Retrieves a project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -14745,7 +14392,7 @@ Modifies a project in the organization. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "name": "name" }' @@ -14826,7 +14473,7 @@ Archives a project in the organization. Archived projects cannot be used or upda ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/archive \ -X POST \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -14969,7 +14616,7 @@ Returns a list of users in the project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/users \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -15087,7 +14734,7 @@ Adds a user to the project. Users must already be members of the organization to ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/users \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "role": "owner", "user_id": "user_id" @@ -15183,7 +14830,7 @@ Retrieves a user in the project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/users/$USER_ID \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -15283,7 +14930,7 @@ Modifies a user's role in the project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/users/$USER_ID \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "role": "owner" }' @@ -15356,7 +15003,7 @@ archived (archived projects have no users). ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/users/$USER_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -15537,7 +15184,7 @@ Lists the project roles assigned to a user within a project. ```http curl https://api.openai.com/v1/projects/$PROJECT_ID/users/$USER_ID/roles \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -15637,7 +15284,7 @@ Assigns a project role to a user within a project. - `"user.role"` -- `role: object { id, description, name, 4 more }` +- `role: Role` Details about a role that can be assigned through the public Roles API. @@ -15671,7 +15318,7 @@ Assigns a project role to a user within a project. Resource type the role is bound to (for example `api.organization` or `api.project`). -- `user: User` +- `user: OrganizationUser` Represents an individual `user` within an organization. @@ -15710,7 +15357,7 @@ Assigns a project role to a user within a project. ```http curl https://api.openai.com/v1/projects/$PROJECT_ID/users/$USER_ID/roles \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "role_id": "role_id" }' @@ -15811,7 +15458,7 @@ Unassigns a project role from a user within a project. ```http curl https://api.openai.com/v1/projects/$PROJECT_ID/users/$USER_ID/roles/$ROLE_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -15904,7 +15551,7 @@ curl -X DELETE https://api.openai.com/v1/projects/proj_abc123/users/user_abc123/ - `"user.role"` - - `role: object { id, description, name, 4 more }` + - `role: Role` Details about a role that can be assigned through the public Roles API. @@ -15938,7 +15585,7 @@ curl -X DELETE https://api.openai.com/v1/projects/proj_abc123/users/user_abc123/ Resource type the role is bound to (for example `api.organization` or `api.project`). - - `user: User` + - `user: OrganizationUser` Represents an individual `user` within an organization. @@ -16052,7 +15699,7 @@ Returns a list of service accounts in the project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/service_accounts \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -16158,7 +15805,7 @@ Creates a new service account in the project. This also returns an unredacted AP ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/service_accounts \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "name": "name" }' @@ -16261,7 +15908,7 @@ Retrieves a service account in the project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/service_accounts/$SERVICE_ACCOUNT_ID \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -16326,7 +15973,7 @@ is archived (archived projects have no service accounts). ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/service_accounts/$SERVICE_ACCOUNT_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -16463,7 +16110,7 @@ Returns a list of API keys in the project. ### Returns -- `data: array of ProjectAPIEy` +- `data: array of ProjectAPIKey` - `id: string` @@ -16579,7 +16226,7 @@ Returns a list of API keys in the project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/api_keys \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -16675,7 +16322,7 @@ Retrieves an API key in the project. ### Returns -- `ProjectAPIEy object { id, created_at, last_used_at, 4 more }` +- `ProjectAPIKey object { id, created_at, last_used_at, 4 more }` Represents an individual API key in a project. @@ -16783,7 +16430,7 @@ Retrieves an API key in the project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/api_keys/$KEY_ID \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -16879,7 +16526,7 @@ a service account. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/api_keys/$KEY_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -16912,9 +16559,9 @@ curl -X DELETE https://api.openai.com/v1/organization/projects/proj_abc/api_keys ## Domain Types -### Project API Ey +### Project API Key -- `ProjectAPIEy object { id, created_at, last_used_at, 4 more }` +- `ProjectAPIKey object { id, created_at, last_used_at, 4 more }` Represents an individual API key in a project. @@ -17058,7 +16705,7 @@ Returns the rate limits per model for a project. ### Returns -- `data: array of object { id, max_requests_per_1_minute, max_tokens_per_1_minute, 6 more }` +- `data: array of ProjectRateLimit` - `id: string` @@ -17112,7 +16759,7 @@ Returns the rate limits per model for a project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/rate_limits \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -17208,41 +16855,45 @@ Updates a project rate limit. ### Returns -- `id: string` +- `ProjectRateLimit object { id, max_requests_per_1_minute, max_tokens_per_1_minute, 6 more }` + + Represents a project rate limit config. + + - `id: string` The identifier, which can be referenced in API endpoints. -- `max_requests_per_1_minute: number` + - `max_requests_per_1_minute: number` The maximum requests per minute. -- `max_tokens_per_1_minute: number` + - `max_tokens_per_1_minute: number` The maximum tokens per minute. -- `model: string` + - `model: string` The model this rate limit applies to. -- `object: "project.rate_limit"` + - `object: "project.rate_limit"` The object type, which is always `project.rate_limit` - `"project.rate_limit"` -- `batch_1_day_max_input_tokens: optional number` + - `batch_1_day_max_input_tokens: optional number` The maximum batch input tokens per day. Only present for relevant models. -- `max_audio_megabytes_per_1_minute: optional number` + - `max_audio_megabytes_per_1_minute: optional number` The maximum audio megabytes per minute. Only present for relevant models. -- `max_images_per_1_minute: optional number` + - `max_images_per_1_minute: optional number` The maximum images per minute. Only present for relevant models. -- `max_requests_per_1_day: optional number` + - `max_requests_per_1_day: optional number` The maximum requests per day. Only present for relevant models. @@ -17251,7 +16902,7 @@ Updates a project rate limit. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/rate_limits/$RATE_LIMIT_ID \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{}' ``` @@ -17297,53 +16948,9 @@ curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/rate_limit ## Domain Types -### Rate Limit List Rate Limits Response - -- `RateLimitListRateLimitsResponse object { id, max_requests_per_1_minute, max_tokens_per_1_minute, 6 more }` - - Represents a project rate limit config. - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `max_requests_per_1_minute: number` - - The maximum requests per minute. - - - `max_tokens_per_1_minute: number` - - The maximum tokens per minute. - - - `model: string` - - The model this rate limit applies to. - - - `object: "project.rate_limit"` - - The object type, which is always `project.rate_limit` - - - `"project.rate_limit"` - - - `batch_1_day_max_input_tokens: optional number` - - The maximum batch input tokens per day. Only present for relevant models. - - - `max_audio_megabytes_per_1_minute: optional number` - - The maximum audio megabytes per minute. Only present for relevant models. - - - `max_images_per_1_minute: optional number` - - The maximum images per minute. Only present for relevant models. - - - `max_requests_per_1_day: optional number` - - The maximum requests per day. Only present for relevant models. - -### Rate Limit Update Rate Limit Response +### Project Rate Limit -- `RateLimitUpdateRateLimitResponse object { id, max_requests_per_1_minute, max_tokens_per_1_minute, 6 more }` +- `ProjectRateLimit object { id, max_requests_per_1_minute, max_tokens_per_1_minute, 6 more }` Represents a project rate limit config. @@ -17417,7 +17024,7 @@ Lists the groups that have access to a project. ### Returns -- `data: array of object { created_at, group_id, group_name, 2 more }` +- `data: array of ProjectGroup` Project group memberships returned in the current page. @@ -17461,7 +17068,7 @@ Lists the groups that have access to a project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/groups \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -17532,25 +17139,29 @@ Grants a group access to a project. ### Returns -- `created_at: number` +- `ProjectGroup object { created_at, group_id, group_name, 2 more }` + + Details about a group's membership in a project. + + - `created_at: number` Unix timestamp (in seconds) when the group was granted project access. -- `group_id: string` + - `group_id: string` Identifier of the group that has access to the project. -- `group_name: string` + - `group_name: string` Display name of the group. -- `object: "project.group"` + - `object: "project.group"` Always `project.group`. - `"project.group"` -- `project_id: string` + - `project_id: string` Identifier of the project. @@ -17559,7 +17170,7 @@ Grants a group access to a project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/groups \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "group_id": "group_id", "role": "role" @@ -17631,7 +17242,7 @@ Revokes a group's access to a project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/groups/$GROUP_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -17662,37 +17273,9 @@ curl -X DELETE https://api.openai.com/v1/organization/projects/proj_abc123/group ## Domain Types -### Group List Response - -- `GroupListResponse object { created_at, group_id, group_name, 2 more }` - - Details about a group's membership in a project. - - - `created_at: number` - - Unix timestamp (in seconds) when the group was granted project access. - - - `group_id: string` - - Identifier of the group that has access to the project. - - - `group_name: string` - - Display name of the group. - - - `object: "project.group"` - - Always `project.group`. - - - `"project.group"` - - - `project_id: string` - - Identifier of the project. - -### Group Create Response +### Project Group -- `GroupCreateResponse object { created_at, group_id, group_name, 2 more }` +- `ProjectGroup object { created_at, group_id, group_name, 2 more }` Details about a group's membership in a project. @@ -17834,7 +17417,7 @@ Lists the project roles assigned to a group within a project. ```http curl https://api.openai.com/v1/projects/$PROJECT_ID/groups/$GROUP_ID/roles \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -17960,7 +17543,7 @@ Assigns a project role to a group within a project. - `"group.role"` -- `role: object { id, description, name, 4 more }` +- `role: Role` Details about a role that can be assigned through the public Roles API. @@ -17999,7 +17582,7 @@ Assigns a project role to a group within a project. ```http curl https://api.openai.com/v1/projects/$PROJECT_ID/groups/$GROUP_ID/roles \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "role_id": "role_id" }' @@ -18098,7 +17681,7 @@ Unassigns a project role from a group within a project. ```http curl https://api.openai.com/v1/projects/$PROJECT_ID/groups/$GROUP_ID/roles/$ROLE_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -18217,7 +17800,7 @@ curl -X DELETE https://api.openai.com/v1/projects/proj_abc123/groups/group_01J1F - `"group.role"` - - `role: object { id, description, name, 4 more }` + - `role: Role` Details about a role that can be assigned through the public Roles API. @@ -18297,7 +17880,7 @@ Lists the roles configured for a project. ### Returns -- `data: array of object { id, description, name, 4 more }` +- `data: array of Role` Roles returned in the current page. @@ -18349,7 +17932,7 @@ Lists the roles configured for a project. ```http curl https://api.openai.com/v1/projects/$PROJECT_ID/roles \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -18433,33 +18016,37 @@ Creates a custom role for a project. ### Returns -- `id: string` +- `Role object { id, description, name, 4 more }` + + Details about a role that can be assigned through the public Roles API. + + - `id: string` Identifier for the role. -- `description: string` + - `description: string` Optional description of the role. -- `name: string` + - `name: string` Unique name for the role. -- `object: "role"` + - `object: "role"` Always `role`. - `"role"` -- `permissions: array of string` + - `permissions: array of string` Permissions granted by the role. -- `predefined_role: boolean` + - `predefined_role: boolean` Whether the role is predefined and managed by OpenAI. -- `resource_type: string` + - `resource_type: string` Resource type the role is bound to (for example `api.organization` or `api.project`). @@ -18468,7 +18055,7 @@ Creates a custom role for a project. ```http curl https://api.openai.com/v1/projects/$PROJECT_ID/roles \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "permissions": [ "string" @@ -18554,33 +18141,37 @@ Updates an existing project role. ### Returns -- `id: string` +- `Role object { id, description, name, 4 more }` + + Details about a role that can be assigned through the public Roles API. + + - `id: string` Identifier for the role. -- `description: string` + - `description: string` Optional description of the role. -- `name: string` + - `name: string` Unique name for the role. -- `object: "role"` + - `object: "role"` Always `role`. - `"role"` -- `permissions: array of string` + - `permissions: array of string` Permissions granted by the role. -- `predefined_role: boolean` + - `predefined_role: boolean` Whether the role is predefined and managed by OpenAI. -- `resource_type: string` + - `resource_type: string` Resource type the role is bound to (for example `api.organization` or `api.project`). @@ -18589,7 +18180,7 @@ Updates an existing project role. ```http curl https://api.openai.com/v1/projects/$PROJECT_ID/roles/$ROLE_ID \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{}' ``` @@ -18675,7 +18266,7 @@ Deletes a custom role from a project. ```http curl https://api.openai.com/v1/projects/$PROJECT_ID/roles/$ROLE_ID \ -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -18708,114 +18299,6 @@ curl -X DELETE https://api.openai.com/v1/projects/proj_abc123/roles/role_01J1F8P ## Domain Types -### Role List Response - -- `RoleListResponse object { id, description, name, 4 more }` - - Details about a role that can be assigned through the public Roles API. - - - `id: string` - - Identifier for the role. - - - `description: string` - - Optional description of the role. - - - `name: string` - - Unique name for the role. - - - `object: "role"` - - Always `role`. - - - `"role"` - - - `permissions: array of string` - - Permissions granted by the role. - - - `predefined_role: boolean` - - Whether the role is predefined and managed by OpenAI. - - - `resource_type: string` - - Resource type the role is bound to (for example `api.organization` or `api.project`). - -### Role Create Response - -- `RoleCreateResponse object { id, description, name, 4 more }` - - Details about a role that can be assigned through the public Roles API. - - - `id: string` - - Identifier for the role. - - - `description: string` - - Optional description of the role. - - - `name: string` - - Unique name for the role. - - - `object: "role"` - - Always `role`. - - - `"role"` - - - `permissions: array of string` - - Permissions granted by the role. - - - `predefined_role: boolean` - - Whether the role is predefined and managed by OpenAI. - - - `resource_type: string` - - Resource type the role is bound to (for example `api.organization` or `api.project`). - -### Role Update Response - -- `RoleUpdateResponse object { id, description, name, 4 more }` - - Details about a role that can be assigned through the public Roles API. - - - `id: string` - - Identifier for the role. - - - `description: string` - - Optional description of the role. - - - `name: string` - - Unique name for the role. - - - `object: "role"` - - Always `role`. - - - `"role"` - - - `permissions: array of string` - - Permissions granted by the role. - - - `predefined_role: boolean` - - Whether the role is predefined and managed by OpenAI. - - - `resource_type: string` - - Resource type the role is bound to (for example `api.organization` or `api.project`). - ### Role Delete Response - `RoleDeleteResponse object { id, deleted, object }` @@ -18868,7 +18351,7 @@ List certificates for this project. ### Returns -- `data: array of object { id, certificate_details, created_at, 3 more }` +- `data: array of Certificate` - `id: string` @@ -18928,7 +18411,7 @@ List certificates for this project. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/certificates \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" ``` #### Response @@ -19005,7 +18488,7 @@ You can atomically and idempotently activate up to 10 certificates at a time. ### Returns -- `data: array of object { id, certificate_details, created_at, 3 more }` +- `data: array of Certificate` - `id: string` @@ -19066,7 +18549,7 @@ You can atomically and idempotently activate up to 10 certificates at a time. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/certificates/activate \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "certificate_ids": [ "cert_abc" @@ -19159,7 +18642,7 @@ idempotently deactivate up to 10 certificates at a time. ### Returns -- `data: array of object { id, certificate_details, created_at, 3 more }` +- `data: array of Certificate` - `id: string` @@ -19220,7 +18703,7 @@ idempotently deactivate up to 10 certificates at a time. ```http curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/certificates/deactivate \ -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ -d '{ "certificate_ids": [ "cert_abc" @@ -19295,155 +18778,3 @@ curl https://api.openai.com/v1/organization/projects/proj_abc/certificates/deact ], } ``` - -## Domain Types - -### Certificate List Response - -- `CertificateListResponse object { id, certificate_details, created_at, 3 more }` - - Represents an individual `certificate` uploaded to the organization. - - - `id: string` - - The identifier, which can be referenced in API endpoints - - - `certificate_details: object { content, expires_at, valid_at }` - - - `content: optional string` - - The content of the certificate in PEM format. - - - `expires_at: optional number` - - The Unix timestamp (in seconds) of when the certificate expires. - - - `valid_at: optional number` - - The Unix timestamp (in seconds) of when the certificate becomes valid. - - - `created_at: number` - - The Unix timestamp (in seconds) of when the certificate was uploaded. - - - `name: string` - - The name of the certificate. - - - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` - - The object type. - - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - - - `"certificate"` - - - `"organization.certificate"` - - - `"organization.project.certificate"` - - - `active: optional boolean` - - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. - -### Certificate Activate Response - -- `CertificateActivateResponse object { id, certificate_details, created_at, 3 more }` - - Represents an individual `certificate` uploaded to the organization. - - - `id: string` - - The identifier, which can be referenced in API endpoints - - - `certificate_details: object { content, expires_at, valid_at }` - - - `content: optional string` - - The content of the certificate in PEM format. - - - `expires_at: optional number` - - The Unix timestamp (in seconds) of when the certificate expires. - - - `valid_at: optional number` - - The Unix timestamp (in seconds) of when the certificate becomes valid. - - - `created_at: number` - - The Unix timestamp (in seconds) of when the certificate was uploaded. - - - `name: string` - - The name of the certificate. - - - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` - - The object type. - - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - - - `"certificate"` - - - `"organization.certificate"` - - - `"organization.project.certificate"` - - - `active: optional boolean` - - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. - -### Certificate Deactivate Response - -- `CertificateDeactivateResponse object { id, certificate_details, created_at, 3 more }` - - Represents an individual `certificate` uploaded to the organization. - - - `id: string` - - The identifier, which can be referenced in API endpoints - - - `certificate_details: object { content, expires_at, valid_at }` - - - `content: optional string` - - The content of the certificate in PEM format. - - - `expires_at: optional number` - - The Unix timestamp (in seconds) of when the certificate expires. - - - `valid_at: optional number` - - The Unix timestamp (in seconds) of when the certificate becomes valid. - - - `created_at: number` - - The Unix timestamp (in seconds) of when the certificate was uploaded. - - - `name: string` - - The name of the certificate. - - - `object: "certificate" or "organization.certificate" or "organization.project.certificate"` - - The object type. - - - If creating, updating, or getting a specific certificate, the object type is `certificate`. - - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - - - `"certificate"` - - - `"organization.certificate"` - - - `"organization.project.certificate"` - - - `active: optional boolean` - - Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate.