codecamp

OpenAI 停用项目证书

停用项目证书

post /organization/projects/{project_id}/certificates/deactivate

在项目级别停用证书。每次最多可通过具有原子性和 幂等性的操作停用10张证书。

路径参数

  • project_id: string

项目 ID。

请求体参数

内容类型:application/json

  • certificate_ids: array of string

minItems: 1, maxItems: 10

返回值

  • data: array of object { id, active, certificate_details, 3 more }

  • id: string

标识符,可在 API 端点中引用。

  • active: boolean

证书当前是否在项目级别处于启用状态。

  • certificate_details: object { expires_at, valid_at }

  • expires_at: optional integer

证书过期时间的 Unix 时间戳,单位为秒。

format: unixtime

  • valid_at: optional integer

证书开始生效时间的 Unix 时间戳,单位为秒。

format: unixtime

  • created_at: integer

证书上传时间的 Unix 时间戳,单位为秒。

format: unixtime

  • name: string or null

证书名称。

  • object: "organization.project.certificate"

对象类型,固定为 organization.project.certificate。

  • "organization.project.certificate"

  • object: "organization.project.certificate.deactivation"

项目证书停用结果的类型。

  • "organization.project.certificate.deactivation"

示例

## 使用环境变量中的组织管理员密钥停用项目证书
curl "https://api.openai.com/v1/organization/projects/proj_abc/certificates/deactivate" \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
  "certificate_ids": ["cert_abc", "cert_def"]
}'

响应示例

{
  "object": "organization.project.certificate.deactivation",
  "data": [
    {
      "object": "organization.project.certificate",
      "id": "cert_abc",
      "name": "示例证书",
      "active": false,
      "created_at": 1234567,
      "certificate_details": {
        "valid_at": 12345667,
        "expires_at": 12345678
      }
    },
    {
      "object": "organization.project.certificate",
      "id": "cert_def",
      "name": "示例证书 2",
      "active": false,
      "created_at": 1234567,
      "certificate_details": {
        "valid_at": 12345667,
        "expires_at": 12345678
      }
    }
  ]
}
OpenAI 启用项目证书
OpenAI 获取项目数据保留设置
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

其他能力与进阶指南

Embeddings 接口参考

审计日志接口参考

项目管理及子资源接口参考

Agents 接口及子资源

Decisions 接口参考

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }