Skip to main content
AI AdsBy Kevin O'Connell11 min readMay 13, 2026

How to get an OpenAI Ads API key for ChatGPT Ads

The OpenAI Ads API key (OPENAI_ADS_API_KEY) is separate from your OPENAI_API_KEY used for chat completion. Provision it at ads.openai.com Settings, test via GET /ad_account, and use it to manage campaigns and pull performance via the Advertiser and Insights APIs. Two paths: the AI-Advisors ChatGPT Ads integration (paste your key, view edit publish analyze inside AI-Advisors) or the manual 4-step curl walkthrough.

The OpenAI Ads API key (OPENAI_ADS_API_KEY) is separate from your OPENAI_API_KEY for chat completion. Provision it at ads.openai.com → Settings → API keys, copy the value at creation (shown only once), test it via GET /ad_account, then use it to manage campaigns and pull performance data programmatically. Two paths: the AI-Advisors ChatGPT Ads integration (paste your key, view / edit / publish / analyze inside AI-Advisors with AEO overlay) or the manual curl walkthrough below.

  • The key is NOT the same as your platform.openai.com key. Different env var, different base URL, different provisioning UI
  • Provisioned at: ads.openai.com → Settings → API keys
  • Scope: One key per ad account (multi-account requires contacting OpenAI)
  • Base URL: https://api.ads.openai.com/v1/
  • Test endpoint: GET /ad_account
  • Rate limits: 600 req/min per endpoint, 1,200 req/min per ad account (plus per-IP limits)

OpenAI launched its ChatGPT Ads platform on February 9, 2026 and opened the Ads Manager to every US advertiser on May 5, 2026 with no minimum spend. Alongside the May 5 expansion, OpenAI shipped two programmatic API surfaces: the Advertiser API (CRUD on campaigns, ad groups, ads, and creative files) and the Insights API (performance reporting at four scopes). Both authenticate with the same credential: the OpenAI Ads API key.

The single most common mistake when developers and marketers first encounter this API is confusing the OPENAI_ADS_API_KEY with the standard OPENAI_API_KEY used for chat completion. They are two completely separate credentials, issued by two completely separate OpenAI products, with two different base URLs. This guide leads with the disambiguation and then walks both install paths: the AI-Advisors ChatGPT Ads integration (2 minutes, no curl) and the manual curl walkthrough (5 minutes, full control).

The OpenAI Ads API key is not your platform.openai.com key. Different env var, different base URL, different provisioning UI. Confusing the two returns 401 in both directions.

What the OpenAI Ads API key is (and isn't)

The OpenAI Ads API key is a bearer token that authenticates programmatic requests to OpenAI's advertising platform. Read the official API overview for the full reference; the table below isolates the differences from the chat completion key that almost everyone confuses it with on first encounter.

DimensionOpenAI Ads API keyOpenAI platform API key
Env-var nameOPENAI_ADS_API_KEYOPENAI_API_KEY
Provisioned atads.openai.com → Settings → API keysplatform.openai.com → API keys
Base URLhttps://api.ads.openai.com/v1/https://api.openai.com/v1/
ScopeOne ad account per keyProject or organization, multiple permissions
What it can doManage campaigns + ads + creative files; read insightsGenerate completions, embeddings, images, fine-tunes
Test endpointGET /ad_accountGET /models

Prerequisites

  • An Ads Manager account. Sign in at ads.openai.com. Self-serve is open to every US advertiser as of May 5, 2026 with no minimum spend.
  • Admin access on the ad account. Only admin users can issue API keys. If you are a Standard or View-only user, ask the account admin to issue a key for you.
  • An idea of which environment you are using. Generate separate keys for development and production. Two keys, two ad accounts, no chance of test traffic hitting production billing.
  • A secrets manager or environment-variable strategy. The key is a credential; treat it like a password. We'll cover storage best practices below.

One-click connection: AI-Advisors ChatGPT Ads integration (2 minutes)

The fastest path is the AI-Advisors ChatGPT Ads integration. Paste your OPENAI_ADS_API_KEY into the integration form and AI-Advisors uses the key to surface ChatGPT Ads campaign performance (impressions, clicks, spend, CTR, CPC, CPM) inside the AI-Advisors dashboard alongside your organic AI citation share, GA4, and Google Search Console data. The integration also unlocks view / edit / publish operations on campaigns and ad groups directly from inside AI-Advisors with the AEO overlay you cannot get anywhere else.

Free on all plans. The key is encrypted at rest and never leaves AI-Advisors. You can revoke access at any time by deleting the key from the integration form or rotating it in OpenAI's Ads Manager.

Skip the manual curl walkthrough. Paste your $OPENAI_ADS_API_KEY into AI-Advisors and view, edit, publish, and analyze your ChatGPT Ads alongside your AEO data. Free on all plans.

Connect the ChatGPT Ads integration

Manual: Provision the key at ads.openai.com (5 minutes)

If you are building your own integration or want to test the API directly with curl before connecting AI-Advisors, the manual provisioning path takes four steps. The key value is shown only once at creation, so read all four steps before clicking Create.

STEP 1: Sign in to ads.openai.com

~30 sec

Open ads.openai.com in your browser and sign in with the account that has admin access to your ad account. This is a different surface from platform.openai.com (the chat completion platform) and from chatgpt.com (the consumer product). Make sure you are on the Ads Manager interface before continuing.

STEP 2: Open the Settings tab and navigate to API keys

~1 min

In Ads Manager, click Settings in the left navigation, then locate the API keys section. The interface lists existing keys (if any) with their name, creation date, and last-used timestamp. The value itself is never shown after creation, so the list is for management (rotation, revocation) rather than retrieval.

STEP 3: Click Create new key and copy the value immediately

~1 min

Click Create new key, name it descriptively (e.g. main-account-prod or backfill-script-dev), and copy the value the moment it appears. The key is shown only once at creation. Paste it into your secrets manager, env-var file, or password manager before closing the modal.

If you lose the key value

The key itself stays valid in OpenAI's system, but you cannot recover the secret. Generate a new key, swap it into your environment, then revoke the old one. This protects against accidental leaks even when you forget to delete the unrecoverable original.

STEP 4: Test the key with GET /ad_account

~30 sec

Export the key as an environment variable and run a curl request against the canonical test endpoint:

Bash
export OPENAI_ADS_API_KEY="<paste the value from step 3>"

curl -H "Authorization: Bearer $OPENAI_ADS_API_KEY" \
  -H "Accept: application/json" \
  https://api.ads.openai.com/v1/ad_account

A successful response returns the ad account's ID, name, timezone, and currency. A 401 Unauthorized response means the key is wrong (typo, expired, revoked) or you are pointing at the wrong base URL (likely api.openai.com instead of api.ads.openai.com).

What the Insights API exposes

Once the key is verified, the Insights API gives you performance data across four scopes (ad_account / campaign / ad_group / ad). Documented metrics: impressions, clicks, spend, CTR, CPC, CPM. The conversions metric is sent INTO OpenAI via the Measurement Pixel and Conversions API but is not yet a documented output field in the Insights endpoints; expect that to evolve as the platform matures.

Bash
# Account-level daily insights for the last 30 days
curl -H "Authorization: Bearer $OPENAI_ADS_API_KEY" \
  -H "Accept: application/json" \
  "https://api.ads.openai.com/v1/ad_account/insights?time_granularity=daily&fields=impressions,clicks,spend,ctr,cpc,cpm&limit=30"

Pagination uses cursor-based before and after parameters. time_granularity accepts daily or none; aggregation_level can be set to ad_account, campaign, ad_group, or ad to control the row shape of the response.

Object status model

For an ad to actually show to users, three conditions must all be true:

  • The ad is enabled. Toggling state via the Advertiser API is one of the most common operations.
  • The parent ad group is enabled. Disabling an ad group instantly pauses all child ads regardless of their individual status.
  • The parent campaign is enabled. Same cascade rule applies one level up.
  • The ad has passed review. Monitor the review_status field on each ad. Reviews typically complete within a few minutes; ads cannot serve until the review finishes successfully.

Rate limits and multi-account access

The Advertiser API enforces two limits simultaneously:

  • 600 requests per minute per endpoint
  • 1,200 requests per minute overall per ad account

Both are also enforced by IP address, so a single request must stay within all four ceilings (per-endpoint per-account, overall per-account, per-endpoint per-IP, overall per-IP) at the same time. For most marketing workflows the limits are not constraining; bulk operations like backfilling six months of campaign-level insights can hit the cap if you do not paginate carefully.

Each API key is scoped to one ad account by default. Agencies managing multiple client accounts and enterprises with separate business units need one key per ad account. If you need a single key that manages multiple ad accounts, contact OpenAI via openai.com/advertisers.

Security best practices

  • Store as an environment variable. Never hard-code the key in source. Use process.env.OPENAI_ADS_API_KEY (Node), os.environ["OPENAI_ADS_API_KEY"] (Python), or your platform's secrets manager (AWS Secrets Manager, Doppler, 1Password Connect, Vercel encrypted env vars).
  • Keep .env in .gitignore. Committing the key to a public or private repo creates a permanent leak. Use git-secrets or a pre-commit hook to prevent accidental commits.
  • Rotate on a schedule. Most teams rotate every 90 days, plus immediately if there is any suspicion the key has been exposed (departing employee, accidental commit, third-party breach, agency offboarding).
  • Separate development and production keys. One key per environment, scoped to its own ad account. Test traffic should never hit production billing.
  • Restrict by IP if your stack supports it. Most secrets-manager solutions support source-IP allowlisting at the runtime layer; combined with the API's per-IP rate limit, this provides defense in depth.

Common mistakes

  • Confusing with platform.openai.com keys. The #1 mistake. The chat completion key (OPENAI_API_KEY) cannot authenticate Advertiser API requests; the Ads key cannot authenticate chat completion. Both fail with 401.
  • Pointing at the wrong base URL. Use https://api.ads.openai.com/v1/ for the Ads API. The platform key's base URL is https://api.openai.com/v1/.
  • Not copying the value at creation. The key is shown only once. If you close the modal without copying, generate a new key (the original stays valid but unrecoverable).
  • Reusing one key across multiple ad accounts. Each key is scoped to exactly one ad account. Trying to use a key for a different account returns 401 even if the credential is otherwise valid.
  • Forgetting that ads must pass review. Even if the ad, ad group, and campaign are all enabled, an ad with review_status still pending will not serve. Reviews typically take a few minutes.

Pair with the Measurement Pixel for end-to-end tracking

The API key handles the management and reporting side of your campaigns. For the measurement side (conversions back from your site to OpenAI), you also need the JavaScript Measurement Pixel installed via Google Tag Manager. See our companion post on how to install the ChatGPT Ads Measurement Pixel via GTM. For the full strategic picture of why both the pixel and the API key matter, see our deep-dive on ChatGPT Ads conversion tracking.

The API key manages and reports. The pixel measures and attributes. Both run from the same ad account; both belong in your stack.

Skip the manual provisioning, secrets-manager setup, and per-endpoint plumbing. Paste your $OPENAI_ADS_API_KEY into AI-Advisors and view, edit, publish, and analyze your ChatGPT Ads campaigns overlayed with your AEO data.

Connect the ChatGPT Ads integration

Frequently Asked Questions

#Is the OpenAI Ads API key the same as my OpenAI platform API key?

No. They are two different credentials issued by two different OpenAI products. The OpenAI Ads API key (OPENAI_ADS_API_KEY) is provisioned in the Settings tab of ads.openai.com and authenticates requests to the Advertiser API and Insights API at https://api.ads.openai.com/v1/. The standard OPENAI_API_KEY is provisioned at platform.openai.com and authenticates chat completion, embedding, image generation, and other model API requests at https://api.openai.com/v1/. They cannot be used interchangeably. A request to the Advertiser API with a platform.openai.com key returns 401 Unauthorized.

#Where in Ads Manager do I find the API key?

Sign in to ads.openai.com, click the Settings tab in the left navigation, and look for the API keys section. Click Create new key, name it, and copy the value. The key is shown only once at creation. If you do not copy it now, generate a new key (the old one stays valid but the value is unrecoverable).

#Can one API key manage multiple ad accounts?

Not by default. Each OpenAI Ads API key is scoped to exactly one ad account. Agencies managing multiple client accounts, or enterprises with separate business units, need a separate key per account. If you need to manage multiple ad accounts on a single key, contact OpenAI directly via openai.com/advertisers to request that access.

#What can I do with the OpenAI Ads API key?

Two API surfaces. The Advertiser API gives you CRUD operations on Campaigns, Ad Groups, Ads, and Files (creative uploads): create new campaigns, list existing ones, update ad copy, change state from paused to enabled, and upload creative assets. The Insights API gives you performance data across four scopes (ad_account, campaign, ad_group, ad) with documented metrics for impressions, clicks, spend, CTR, CPC, and CPM. Conversions are sent INTO OpenAI via the Measurement Pixel and the Conversions API but are not yet a documented output metric in the Insights API.

#What happens if I lose my OpenAI Ads API key?

The key value is shown only once at creation. If you lose the value, the key itself stays valid in OpenAI's system but you cannot recover the secret. The fix: generate a new key in the Settings tab, swap it into your environment (env var, secrets manager, or the AI-Advisors ChatGPT Ads integration field), then revoke the old key. Treat the key like a password: never commit it to git, never paste it into a public document, and rotate it on a schedule.

#What rate limits does the OpenAI Ads API enforce?

Two limits enforced together: 600 requests per minute per endpoint, and 1,200 requests per minute overall per ad account. Both are also enforced by IP address, so a request must stay within all four ceilings (per-endpoint per-account, overall per-account, per-endpoint per-IP, overall per-IP) simultaneously. For most marketing workflows the limits are not constraining, but bulk operations like backfilling six months of campaign-level insights can hit the limit if you do not paginate carefully.

Kevin O'Connell
Kevin O'Connell
Founder & AEO Consultant, AI-Advisors.ai

20-year B2B SaaS marketer. 3x Head of Marketing. One company exit (Sapling HR acquired by Kallidus, 2021). Now building AI-Advisors.ai to give mid-market B2B teams the AI visibility tools enterprise brands get. Writing about Answer Engine Optimization, ChatGPT Ads, Microsoft Copilot SEO, and the 5 A's of AI Marketing framework.

Start tracking your AI visibility today

Install the tracking snippet, run your first audit, and see how AI platforms treat your brand. Start your 7-day free trial.

Get Started Free

Keep Reading

AI Ads
The Conversational Conversion Stack: How to Measure ChatGPT Ads
11 min read
AI Ads
Google Ads Terms of Service Update 2026: What Changed
8 min read
AI Ads
How to See If Competitors Are Running ChatGPT Ads
11 min read