A ChatGPT Ads API mock for creating campaigns.
Give your agent a seeded ad account, campaigns and creatives. Check its campaign-creation call, then retrieve the campaign’s status and daily spend limit.
campaign_createdCalls POST /v1/campaigns
Starting records
campaigns
- id
cmpn_acme_pilot- status
active- name
Ridgeway Robotics Q4 pilot
accounts
- id
adacct_acme- status
active- name
Acme- url
https://acme.example
Connect your agent to the ChatGPT Ads mock
When ancha runs your agent, it sets:
OPENAI_ADS_API_URLOPENAI_ADS_API_KEY
Point the client you already use at them.
const response = await fetch(process.env.OPENAI_ADS_API_URL + '/v1/campaigns', {headers:{Authorization:'Bearer '+process.env.OPENAI_ADS_API_KEY}});
const campaigns = await response.json();Locally, ancha runs your agent as an ordinary process, so keep real ChatGPT Ads credentials out of its environment.
See all 26 endpoints
ad_account
/v1/ad_account/v1/ad_account/insightsad_groups
/v1/ad_groups/v1/ad_groups/v1/ad_groups/:id/v1/ad_groups/:id/v1/ad_groups/:id/activate/v1/ad_groups/:id/archive/v1/ad_groups/:id/insights/v1/ad_groups/:id/pauseads
/v1/ads/v1/ads/v1/ads/:id/v1/ads/:id/v1/ads/:id/activate/v1/ads/:id/archive/v1/ads/:id/insights/v1/ads/:id/pausecampaigns
/v1/campaigns/v1/campaigns/v1/campaigns/:id/v1/campaigns/:id/v1/campaigns/:id/activate/v1/campaigns/:id/archive/v1/campaigns/:id/insights/v1/campaigns/:id/pauseSeed your own data
The data the ChatGPT Ads mock starts with on every run, cut to a few records. ancha twins seed chatgpt-ads prints every field.
Full seed YAML
twins:
- chatgpt-ads
seed:
chatgpt-ads:
accounts:
- id: adacct_acme
name: Acme
url: https://acme.example
status: active
timezone: America/Los_Angeles
currency_code: USD
review:
status: approved
integrityReview:
status: approved
principals:
- id: acme-editor
accountId: adacct_acme
actor: acme-editor
files:
- id: file_acme_card
accountId: adacct_acme
width: 1024
height: 1024
mimeType: image/png
campaigns:
- id: cmpn_acme_pilot
accountId: adacct_acme
created_at: 1792512000
updated_at: 1792512000
name: Ridgeway Robotics Q4 pilot
status: active
budget:
daily_spend_limit_micros: 50000000
bidding_type: clicks
targeting:
locations:
countries:
- US
platforms:
included:
- web
adGroups:
- id: adgrp_acme_revenue
accountId: adacct_acme
campaign_id: cmpn_acme_pilot
created_at: 1792512000
updated_at: 1792512000
name: Revenue operations
status: active
context_hints:
- Account-level pipeline reporting for revenue operations
bidding_config:
billing_event_type: click
strategy: fixed_bid
max_bid_micros: 2000000
ads:
- id: ad_acme_reporting
accountId: adacct_acme
ad_group_id: adgrp_acme_revenue
created_at: 1792512000
updated_at: 1792512000
name: Pipeline clarity
status: active
creative:
type: chat_card
title: See the pipeline behind your campaigns
body: Connect campaign activity to qualified opportunities.
target_url: https://acme.example/pilot
file_id: file_acme_card
review:
status: approved
insights:
- adId: ad_acme_reporting
start_time: 1792771200
end_time: 1792774800
impressions: 1200
clicks: 36
spend_micros: 18420000
Check what your agent did
Checks YAML
checks:
- id: campaign_created
trace:
called: POST /v1/campaignsMore marketing tools
All 43 toolsChatGPT Ads API mock FAQ
Will retrying a ChatGPT Ads campaign request create a duplicate?
In Ancha, a repeated POST / with the same body and Idempotency-Key returns the campaign created by the first request. Reusing that key with a different body returns 409 idempotency_conflict.
How can I test an ad that is waiting for creative review?
A new ad or a creative update starts with review.status set to in_review. The mock uses the account's seeded newAdReview.delayMs and outcome to return the review result when the simulation reaches that delay.
Where do clicks and spend in ChatGPT Ads test reports come from?
Ancha aggregates seeded insight rows into impressions, clicks and spend, then calculates ctr, cpc and cpm. Use time_granularity=daily to group those rows by the ad account's timezone.
Install the CLI and run your agent against the ChatGPT Ads mock.
Ancha is not affiliated with ChatGPT Ads.