codecamp

OpenAI 创建工作负载身份提供商

创建工作负载身份提供商

post /organization/workload_identity_providers

注册 OIDC 提供商,使项目服务账户可以在无需 API 密钥的情况下进行身份验证。

请求体参数

内容类型为 application/json。

  • audience: string

minLength: 1

  • issuer: string

minLength: 1

  • name: string

minLength: 1

  • type: "oidc" (default: "oidc")

  • "oidc"

  • attribute_transformations: optional array of object { attribute, expression }

maxItems: 20

  • attribute: string

minLength: 1, maxLength: 256

  • expression: string

minLength: 1, maxLength: 4096

  • description: optional string

  • enabled: optional boolean

  • verification: optional DiscoveryVerificationParam { discovery_url, type } or UploadedJwksVerificationParam { jwks, type }

  • DiscoveryVerificationParam object { discovery_url, type }

  • discovery_url: string or null

  • type: "discovery" (default: "discovery")

  • "discovery"

  • UploadedJwksVerificationParam object { jwks, type }

  • jwks: map[unknown]

  • type: "uploaded_jwks" (default: "uploaded_jwks")

  • "uploaded_jwks"

返回值

  • WorkloadIdentityProvider object { id, attribute_transformations, audience, 9 more }

  • id: string

  • attribute_transformations: array of object { attribute, expression }

  • attribute: string

  • expression: string

  • audience: string

  • created_at: integer

  • description: string or null

  • enabled: boolean

  • issuer: string

  • name: string

  • object: "organization.workload_identity_provider" (default: "organization.workload_identity_provider")

  • "organization.workload_identity_provider"

  • type: "oidc" (default: "oidc")

  • "oidc"

  • updated_at: integer

  • verification: DiscoveryVerification { discovery_url, type } or UploadedJwksVerification { jwks, type }

  • DiscoveryVerification object { discovery_url, type }

  • discovery_url: string or null

  • type: "discovery" (default: "discovery")

  • "discovery"

  • UploadedJwksVerification object { jwks, type }

  • jwks: map[unknown]

  • type: "uploaded_jwks" (default: "uploaded_jwks")

  • "uploaded_jwks"

示例

## 从环境变量读取管理员密钥。核对创建请求的参数(身份提供商)
curl -X POST "https://api.openai.com/v1/organization/workload_identity_providers" \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "CI provider",
  "type": "oidc",
  "issuer": "https://issuer.example.com",
  "audience": "openai"
}'

响应示例

{
  "object": "organization.workload_identity_provider",
  "id": "wip_example",
  "type": "oidc",
  "name": "CI provider",
  "issuer": "https://issuer.example.com",
  "audience": "openai",
  "verification": {
    "type": "discovery",
    "discovery_url": null
  },
  "description": null,
  "attribute_transformations": [],
  "enabled": true,
  "created_at": 1793664000,
  "updated_at": 1793664000
}
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; }