Skip to main content
Adjar manages OpenAI Ads — the ads that run inside ChatGPT — through the OpenAI Ads API. Authentication is a single API key, scoped to one ad account, that you collect into an 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

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 adacct_6a44ee8e025c819fbd6057719ccb8545. You can read it off the OpenAI Ads dashboard, or confirm it against the key by calling the account endpoint:
The response’s id field is your account ID — the value you pass to adjar import --account.

Assemble the credentials file

Put the key into an openai.json file:
  • api_keyrequired. 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 the account.id in 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.
The API key grants full control of the ad account’s campaigns and budget. Keep openai.json out of git (add it to .gitignore) and rotate the key if it’s ever exposed.
With openai.json ready, head to the Quick Start to import your account.