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

2026-11-19 17:50 更新

创建工作负载身份提供商

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
}
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号