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.

Connect your agent
The test
  • campaign_created

    Calls 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_URL
  • OPENAI_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

GET/v1/ad_account
GET/v1/ad_account/insights

ad_groups

GET/v1/ad_groups
POST/v1/ad_groups
GET/v1/ad_groups/:id
POST/v1/ad_groups/:id
POST/v1/ad_groups/:id/activate
POST/v1/ad_groups/:id/archive
GET/v1/ad_groups/:id/insights
POST/v1/ad_groups/:id/pause

ads

GET/v1/ads
POST/v1/ads
GET/v1/ads/:id
POST/v1/ads/:id
POST/v1/ads/:id/activate
POST/v1/ads/:id/archive
GET/v1/ads/:id/insights
POST/v1/ads/:id/pause

campaigns

GET/v1/campaigns
POST/v1/campaigns
GET/v1/campaigns/:id
POST/v1/campaigns/:id
POST/v1/campaigns/:id/activate
POST/v1/campaigns/:id/archive
GET/v1/campaigns/:id/insights
POST/v1/campaigns/:id/pause

Seed 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/campaigns

More marketing tools

All 43 tools

ChatGPT Ads API mock FAQ

Will retrying a ChatGPT Ads campaign request create a duplicate?

In Ancha, a repeated POST /v1/campaigns 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.

Book a demo

Ancha is not affiliated with ChatGPT Ads.