主导航

身份验证

设置 Bearer 令牌身份验证。

基础 URL

将广告 API 请求发送至

https://api.ads.openai.com/v1

Authorization

OpenAPI 规范定义了 bearer 安全方案。请在每次请求时传递您的广告 API 密钥。

请求头 (Header)
AuthorizationBearer $OPENAI_ADS_API_KEY

请求格式

大多数广告 API 端点接受 application/json。上传端点支持两种请求格式

  • 带有 image_urlapplication/json
  • 带有二进制 filemultipart/form-data

请求示例

使用 GET /ad_account 来确认您的 bearer 令牌是否有效。

curl -X GET "https://api.ads.openai.com/v1/ad_account" \
  -H "Authorization: Bearer $OPENAI_ADS_API_KEY" \
  -H "Accept: application/json"
{
  "id": "act_123",
  "name": "Acme Ads",
  "url": "https://www.acme.example",
  "preview_url": "https://preview.acme.example",
  "timezone": "UTC",
  "currency_code": "USD"
}
© . This website operates independently and is not affiliated with or endorsed by OpenAI, Inc. All brand names, logos, and trademarks are the property of their respective owners.