For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Overview Agent Access Ads ChatGPT + Codex user docs Use cases

API Reference

Create Api Key

POST
/api_keys

Create an API key scoped to the selected ad account.

Create Api Key

curl https://api.ads.openai.com/v1/api_keys \
    -X POST \
    -H "Authorization: Bearer $OPENAI_ADS_API_KEY"
200 — Example
{
  "api_key": "api_key",
  "api_organization_id": "api_organization_id",
  "service_account_id": "service_account_id",
  "api_key_id": "api_key_id"
}
Body Parameters
JSON
key_name: optional string
minLength1
Returns
api_key: string
api_organization_id: string
service_account_id: string
api_key_id: optional string
Returns Examples
200 — Example
{
  "api_key": "api_key",
  "api_organization_id": "api_organization_id",
  "service_account_id": "service_account_id",
  "api_key_id": "api_key_id"
}