openai.json file. This page covers how the key works, how to assemble the file, and how to point Adjar at it.
OpenAI Ads access is provisioned per advertiser through OpenAI’s onboarding. The exact click-path to generate a key lives in OpenAI’s own docs and may change — this page covers what Adjar needs and how it consumes the key, and points you to OpenAI for the provisioning steps.
Prerequisites
- An approved OpenAI Ads advertiser account. Start at ads.openai.com and see the developer docs at developers.openai.com/ads.
- The
adjarCLI installed (see the Quick Start).
How OpenAI Ads auth differs from Google
If you’ve set up Google Ads access, OpenAI is much simpler:
There’s no manager account, no OAuth client, and no refresh-token exchange — just one key.
1
Get your Ads API key
Obtain the API key for your ad account from OpenAI’s advertiser onboarding (via ads.openai.com or your OpenAI partner contact). Each key is scoped to a single ad account — if you manage more than one, you’ll have one key and one
openai.json per account.OpenAI Ads keys are bearer tokens. Treat the key like a password: it grants full read/write access to that ad account’s campaigns and spend. Store it in a secret manager or an untracked file, never in version control.2
Find your ad account ID
Your account ID looks like The response’s
adacct_6a44ee8e025c819fbd6057719ccb8545. You can read it off the OpenAI Ads dashboard, or confirm it against the key by calling the account endpoint:id field is your account ID — the value you pass to adjar import --account.Assemble the credentials file
Put the key into anopenai.json file:
api_key— required. The bearer key for your ad account.account_id— optional. The key already determines the account server-side, so Adjar only uses this to cross-check theaccount.idin your config. You can omit it.
Point Adjar at the file
Save the file anywhere, then point Adjar at it:--credentials takes priority over ADJAR_CREDENTIALS. Either way, give the path to the JSON file, not a folder. There are no implicit or default locations — credentials are always explicit.
With openai.json ready, head to the Quick Start to import your account.