Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: OpenAI Certificates API
description: The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
version: 2.3.0
termsOfService: https://openai.com/policies/terms-of-use
contact:
name: OpenAI Support
url: https://help.openai.com/
license:
name: MIT
identifier: MIT
servers:
- url: https://api.openai.com/v1
security:
- ApiKeyAuth: []
tags:
- name: Certificates
paths:
/organization/certificates:
get:
security:
- AdminApiKeyAuth: []
summary: List organization certificates
description: List uploaded certificates for this organization.
operationId: listOrganizationCertificates
tags:
- Certificates
parameters:
- name: limit
in: query
description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
'
required: false
schema:
type: integer
default: 20
- name: after
in: query
description: 'A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
'
required: false
schema:
type: string
- name: order
in: query
description: 'Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
'
schema:
type: string
default: desc
enum:
- asc
- desc
responses:
'200':
description: Certificates listed successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/ListCertificatesResponse'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
group: administration
examples:
request:
curl: 'curl https://api.openai.com/v1/organization/certificates \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY"
'
response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"organization.certificate\",\n \"id\": \"cert_abc\",\n \"name\": \"My Example Certificate\",\n \"active\": true,\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n },\n ],\n \"first_id\": \"cert_abc\",\n \"last_id\": \"cert_abc\",\n \"has_more\": false\n}\n"
post:
security:
- AdminApiKeyAuth: []
summary: Upload certificate
description: 'Upload a certificate to the organization. This does **not** automatically activate the certificate.
Organizations can upload up to 50 certificates.'
operationId: uploadCertificate
tags:
- Certificates
requestBody:
description: The certificate upload payload.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UploadCertificateRequest'
responses:
'200':
description: Certificate uploaded successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/Certificate'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
group: administration
examples:
request:
curl: "curl -X POST https://api.openai.com/v1/organization/certificates \\\n-H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"name\": \"My Example Certificate\",\n \"certificate\": \"-----BEGIN CERTIFICATE-----\\\\nMIIDeT...\\\\n-----END CERTIFICATE-----\"\n}'\n"
response: "{\n \"object\": \"certificate\",\n \"id\": \"cert_abc\",\n \"name\": \"My Example Certificate\",\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n}\n"
/organization/certificates/activate:
post:
security:
- AdminApiKeyAuth: []
summary: Activate certificates for organization
description: 'Activate certificates at the organization level.
You can atomically and idempotently activate up to 10 certificates at a time.'
operationId: activateOrganizationCertificates
tags:
- Certificates
requestBody:
description: The certificate activation payload.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ToggleCertificatesRequest'
responses:
'200':
description: Certificates activated successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/OrganizationCertificateActivationResponse'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
group: administration
examples:
request:
curl: "curl https://api.openai.com/v1/organization/certificates/activate \\\n-H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"certificate_ids\": [\"cert_abc\", \"cert_def\"]\n}'\n"
response: "{\n \"object\": \"organization.certificate.activation\",\n \"data\": [\n {\n \"object\": \"organization.certificate\",\n \"id\": \"cert_abc\",\n \"name\": \"My Example Certificate\",\n \"active\": true,\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n },\n {\n \"object\": \"organization.certificate\",\n \"id\": \"cert_def\",\n \"name\": \"My Example Certificate 2\",\n \"active\": true,\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n },\n ],\n}\n"
/organization/certificates/deactivate:
post:
security:
- AdminApiKeyAuth: []
summary: Deactivate certificates for organization
description: 'Deactivate certificates at the organization level.
You can atomically and idempotently deactivate up to 10 certificates at a time.'
operationId: deactivateOrganizationCertificates
tags:
- Certificates
requestBody:
description: The certificate deactivation payload.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ToggleCertificatesRequest'
responses:
'200':
description: Certificates deactivated successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/OrganizationCertificateDeactivationResponse'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
group: administration
examples:
request:
curl: "curl https://api.openai.com/v1/organization/certificates/deactivate \\\n-H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"certificate_ids\": [\"cert_abc\", \"cert_def\"]\n}'\n"
response: "{\n \"object\": \"organization.certificate.deactivation\",\n \"data\": [\n {\n \"object\": \"organization.certificate\",\n \"id\": \"cert_abc\",\n \"name\": \"My Example Certificate\",\n \"active\": false,\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n },\n {\n \"object\": \"organization.certificate\",\n \"id\": \"cert_def\",\n \"name\": \"My Example Certificate 2\",\n \"active\": false,\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n },\n ],\n}\n"
/organization/certificates/{certificate_id}:
get:
security:
- AdminApiKeyAuth: []
summary: Get certificate
description: 'Get a certificate that has been uploaded to the organization.
You can get a certificate regardless of whether it is active or not.'
operationId: getCertificate
tags:
- Certificates
parameters:
- name: certificate_id
in: path
description: Unique ID of the certificate to retrieve.
required: true
schema:
type: string
- name: include
in: query
description: A list of additional fields to include in the response. Currently the only supported value is `content` to fetch the PEM content of the certificate.
required: false
schema:
type: array
items:
type: string
enum:
- content
responses:
'200':
description: Certificate retrieved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/Certificate'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
group: administration
examples:
request:
curl: 'curl "https://api.openai.com/v1/organization/certificates/cert_abc?include[]=content" \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY"
'
response: "{\n \"object\": \"certificate\",\n \"id\": \"cert_abc\",\n \"name\": \"My Example Certificate\",\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 1234567,\n \"expires_at\": 12345678,\n \"content\": \"-----BEGIN CERTIFICATE-----MIIDeT...-----END CERTIFICATE-----\"\n }\n}\n"
post:
security:
- AdminApiKeyAuth: []
summary: Modify certificate
description: Modify a certificate. Note that only the name can be modified.
operationId: modifyCertificate
tags:
- Certificates
parameters:
- name: certificate_id
in: path
description: Unique ID of the certificate to modify.
required: true
schema:
type: string
requestBody:
description: The certificate modification payload.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ModifyCertificateRequest'
responses:
'200':
description: Certificate modified successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/Certificate'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
group: administration
examples:
request:
curl: "curl -X POST https://api.openai.com/v1/organization/certificates/cert_abc \\\n-H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"name\": \"Renamed Certificate\"\n}'\n"
response: "{\n \"object\": \"certificate\",\n \"id\": \"cert_abc\",\n \"name\": \"Renamed Certificate\",\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n}\n"
delete:
security:
- AdminApiKeyAuth: []
summary: Delete certificate
description: 'Delete a certificate from the organization.
The certificate must be inactive for the organization and all projects.'
operationId: deleteCertificate
tags:
- Certificates
parameters:
- name: certificate_id
in: path
description: Unique ID of the certificate to delete.
required: true
schema:
type: string
responses:
'200':
description: Certificate deleted successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteCertificateResponse'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
group: administration
examples:
request:
curl: 'curl -X DELETE https://api.openai.com/v1/organization/certificates/cert_abc \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY"
'
response: "{\n \"object\": \"certificate.deleted\",\n \"id\": \"cert_abc\"\n}\n"
/organization/projects/{project_id}/certificates:
get:
security:
- AdminApiKeyAuth: []
summary: List project certificates
description: List certificates for this project.
operationId: listProjectCertificates
tags:
- Certificates
parameters:
- name: project_id
in: path
description: The ID of the project.
required: true
schema:
type: string
- name: limit
in: query
description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
'
required: false
schema:
type: integer
default: 20
- name: after
in: query
description: 'A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
'
required: false
schema:
type: string
- name: order
in: query
description: 'Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
'
schema:
type: string
default: desc
enum:
- asc
- desc
responses:
'200':
description: Certificates listed successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/ListProjectCertificatesResponse'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
group: administration
examples:
request:
curl: 'curl https://api.openai.com/v1/organization/projects/proj_abc/certificates \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY"
'
response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"organization.project.certificate\",\n \"id\": \"cert_abc\",\n \"name\": \"My Example Certificate\",\n \"active\": true,\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n },\n ],\n \"first_id\": \"cert_abc\",\n \"last_id\": \"cert_abc\",\n \"has_more\": false\n}\n"
/organization/projects/{project_id}/certificates/activate:
post:
security:
- AdminApiKeyAuth: []
summary: Activate certificates for project
description: 'Activate certificates at the project level.
You can atomically and idempotently activate up to 10 certificates at a time.'
operationId: activateProjectCertificates
tags:
- Certificates
parameters:
- name: project_id
in: path
description: The ID of the project.
required: true
schema:
type: string
requestBody:
description: The certificate activation payload.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ToggleCertificatesRequest'
responses:
'200':
description: Certificates activated successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/OrganizationProjectCertificateActivationResponse'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
group: administration
examples:
request:
curl: "curl https://api.openai.com/v1/organization/projects/proj_abc/certificates/activate \\\n-H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"certificate_ids\": [\"cert_abc\", \"cert_def\"]\n}'\n"
response: "{\n \"object\": \"organization.project.certificate.activation\",\n \"data\": [\n {\n \"object\": \"organization.project.certificate\",\n \"id\": \"cert_abc\",\n \"name\": \"My Example Certificate\",\n \"active\": true,\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n },\n {\n \"object\": \"organization.project.certificate\",\n \"id\": \"cert_def\",\n \"name\": \"My Example Certificate 2\",\n \"active\": true,\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n },\n ],\n}\n"
/organization/projects/{project_id}/certificates/deactivate:
post:
security:
- AdminApiKeyAuth: []
summary: Deactivate certificates for project
description: 'Deactivate certificates at the project level. You can atomically and
idempotently deactivate up to 10 certificates at a time.'
operationId: deactivateProjectCertificates
tags:
- Certificates
parameters:
- name: project_id
in: path
description: The ID of the project.
required: true
schema:
type: string
requestBody:
description: The certificate deactivation payload.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ToggleCertificatesRequest'
responses:
'200':
description: Certificates deactivated successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/OrganizationProjectCertificateDeactivationResponse'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
group: administration
examples:
request:
curl: "curl https://api.openai.com/v1/organization/projects/proj_abc/certificates/deactivate \\\n-H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"certificate_ids\": [\"cert_abc\", \"cert_def\"]\n}'\n"
response: "{\n \"object\": \"organization.project.certificate.deactivation\",\n \"data\": [\n {\n \"object\": \"organization.project.certificate\",\n \"id\": \"cert_abc\",\n \"name\": \"My Example Certificate\",\n \"active\": false,\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n },\n {\n \"object\": \"organization.project.certificate\",\n \"id\": \"cert_def\",\n \"name\": \"My Example Certificate 2\",\n \"active\": false,\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 12345667,\n \"expires_at\": 12345678\n }\n },\n ],\n}\n"
components:
responses:
TooManyRequests:
description: The request was rejected because a rate limit was exceeded.
headers:
Retry-After:
description: The minimum number of seconds to wait before retrying. This header is returned when the server has computed a retry delay and may be omitted for 429 responses that require user action.
schema:
type: integer
minimum: 1
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
schemas:
DeleteCertificateResponse:
type: object
properties:
object:
type: string
description: The object type, must be `certificate.deleted`.
enum:
- certificate.deleted
x-stainless-const: true
id:
type: string
description: The ID of the certificate that was deleted.
required:
- object
- id
ModifyCertificateRequest:
type: object
properties:
name:
type: string
description: The updated name for the certificate
_MisalignmentErrorType:
anyOf:
- type: string
- type: string
enum:
- potentially_unintended_data_transfer
- potentially_unintended_data_access
- potentially_unintended_destructive_activity
- other
OrganizationCertificateActivationResponse:
type: object
properties:
object:
type: string
enum:
- organization.certificate.activation
description: The organization certificate activation result type.
x-stainless-const: true
data:
type: array
items:
$ref: '#/components/schemas/OrganizationCertificate'
required:
- object
- data
ListProjectCertificatesResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/OrganizationProjectCertificate'
first_id:
anyOf:
- type: string
- type: 'null'
example: cert_abc
last_id:
anyOf:
- type: string
- type: 'null'
example: cert_abc
has_more:
type: boolean
object:
type: string
enum:
- list
x-stainless-const: true
required:
- object
- data
- has_more
- first_id
- last_id
OrganizationProjectCertificateDeactivationResponse:
type: object
properties:
object:
type: string
enum:
- organization.project.certificate.deactivation
description: The project certificate deactivation result type.
x-stainless-const: true
data:
type: array
items:
$ref: '#/components/schemas/OrganizationProjectCertificate'
required:
- object
- data
OrganizationCertificateDeactivationResponse:
type: object
properties:
object:
type: string
enum:
- organization.certificate.deactivation
description: The organization certificate deactivation result type.
x-stainless-const: true
data:
type: array
items:
$ref: '#/components/schemas/OrganizationCertificate'
required:
- object
- data
MisalignmentErrorDetailsResource:
properties:
error_type:
$ref: '#/components/schemas/_MisalignmentErrorType'
description: An optional classification; clients must accept additional values.
detailed_explanation:
type: string
description: The public explanation for this block.
steer:
$ref: '#/components/schemas/_MisalignmentSteer'
description: An optional public continuation instruction.
type: object
required: []
ToggleCertificatesRequest:
type: object
properties:
certificate_ids:
type: array
items:
type: string
example: cert_abc
minItems: 1
maxItems: 10
required:
- certificate_ids
OrganizationProjectCertificateActivationResponse:
type: object
properties:
object:
type: string
enum:
- organization.project.certificate.activation
description: The project certificate activation result type.
x-stainless-const: true
data:
type: array
items:
$ref: '#/components/schemas/OrganizationProjectCertificate'
required:
- object
- data
OrganizationCertificate:
type: object
description: Represents an individual certificate configured at the organization level.
properties:
object:
type: string
enum:
- organization.certificate
description: The object type, which is always `organization.certificate`.
x-stainless-const: true
id:
type: string
description: The identifier, which can be referenced in API endpoints
name:
anyOf:
- type: string
- type: 'null'
description: The name of the certificate.
created_at:
type: integer
format: unixtime
description: The Unix timestamp (in seconds) of when the certificate was uploaded.
certificate_details:
type: object
properties:
valid_at:
type: integer
format: unixtime
description: The Unix timestamp (in seconds) of when the certificate becomes valid.
expires_at:
type: integer
format: unixtime
description: The Unix timestamp (in seconds) of when the certificate expires.
active:
type: boolean
description: Whether the certificate is currently active at the organization level.
required:
- object
- id
- name
- created_at
- certificate_details
- active
Error:
type: object
properties:
code:
anyOf:
- type: string
- type: 'null'
message:
type: string
param:
anyOf:
- type: string
- type: 'null'
type:
type: string
misalignment:
$ref: '#/components/schemas/MisalignmentErrorDetailsResource'
required:
- type
- message
- param
- code
ListCertificatesResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/OrganizationCertificate'
first_id:
anyOf:
- type: string
- type: 'null'
example: cert_abc
last_id:
anyOf:
- type: string
- type: 'null'
example: cert_abc
has_more:
type: boolean
object:
type: string
enum:
- list
x-stainless-const: true
required:
- object
- data
- has_more
- first_id
- last_id
Certificate:
type: object
description: Represents an individual `certificate` uploaded to the organization.
properties:
object:
type: string
enum:
- certificate
- organization.certificate
- organization.project.certificate
description: '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`.
'
x-stainless-const: true
id:
type: string
description: The identifier, which can be referenced in API endpoints
name:
anyOf:
- type: string
- type: 'null'
description: The name of the certificate.
created_at:
type: integer
format: unixtime
description: The Unix timestamp (in seconds) of when the certificate was uploaded.
certificate_details:
type: object
properties:
valid_at:
type: integer
format: unixtime
description: The Unix timestamp (in seconds) of when the certificate becomes valid.
expires_at:
type: integer
format: unixtime
description: The Unix timestamp (in seconds) of when the certificate expires.
content:
type: string
description: The content of the certificate in PEM format.
active:
type: boolean
description: Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate.
required:
- object
- id
- name
- created_at
- certificate_details
x-oaiMeta:
name: The certificate object
example: "{\n \"object\": \"certificate\",\n \"id\": \"cert_abc\",\n \"name\": \"My Certificate\",\n \"created_at\": 1234567,\n \"certificate_details\": {\n \"valid_at\": 1234567,\n \"expires_at\": 12345678,\n \"content\": \"-----BEGIN CERTIFICATE----- MIIGAjCCA...6znFlOW+ -----END CERTIFICATE-----\"\n }\n}\n"
UploadCertificateRequest:
type: object
properties:
name:
type: string
description: An optional name for the certificate
certificate:
type: string
description: The certificate content in PEM format
required:
- certificate
_MisalignmentSteer:
properties:
message:
type: string
description: The public continuation instruction.
type: object
required:
- message
ErrorResponse:
type: object
properties:
error:
$ref: '#/components/schemas/Error'
required:
- error
OrganizationProjectCertificate:
type: object
description: Represents an individual certificate configured at the project level.
properties:
object:
type: string
enum:
- organization.project.certificate
description: The object type, which is always `organization.project.certificate`.
x-stainless-const: true
id:
type: string
description: The identifier, which can be referenced in API endpoints
name:
anyOf:
- type: string
- type: 'null'
description: The name of the certificate.
created_at:
type: integer
format: unixtime
description: The Unix timestamp (in seconds) of when the certificate was uploaded.
certificate_details:
type: object
properties:
valid_at:
type: integer
format: unixtime
description: The Unix timestamp (in seconds) of when the certificate becomes valid.
expires_at:
type: integer
format: unixtime
description: The Unix timestamp (in seconds) of when the certificate expires.
active:
type: boolean
description: Whether the certificate is currently active at the project level.
required:
- object
- id
- name
- created_at
- certificate_details
- active
securitySchemes:
ApiKeyAuth:
type: http
scheme: bearer
AdminApiKeyAuth:
type: http
scheme: bearer
x-oaiMeta:
navigationGroups:
- id: responses
title: Responses API
- id: webhooks
title: Webhooks
- id: endpoints
title: Platform APIs
- id: vector_stores
title: Vector stores
- id: chatkit
title: ChatKit
beta: true
- id: containers
title: Containers
- id: live
title: Live (alpha)
- id: realtime
title: Realtime
- id: chat
title: Chat Completions
- id: assistants
title: Assistants
deprecated: true
- id: administration
title: Administration
- id: legacy
title: Legacy
groups:
# --- truncated at 32 KB (62 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/openai/refs/heads/main/openapi/openai-certificates-api-openapi.yml