Developers

Reseller API

Create and manage AI for WP licenses for your customers. Each license activates the AI for WP plugin (with your brand) on your customer's WordPress site.

Base URLHTTPShttps://api.ai-for-wp.be/v1/reseller
FormatJSONRequest and response bodies are JSON; times are UTC (RFC 3339).
SpecOpenAPI 3.1openapi.yaml

Authentication. Send your API key as Authorization: Bearer aibr_…. Keys are made in your account by AI for WP and can be limited to your servers' addresses.

Package and billing. Your account has a package: a monthly fee that includes a number of licenses, a price per license beyond that, and AI credits per license (each license has its own). You get one invoice per month: the fee, the licenses beyond the included number for the time they existed (to the second), and the extra AI credits you added. Deleting a license stops its AI immediately and it no longer counts.

Limits. 120 requests per minute per key. Errors are JSON: {"code": "...", "message": "...", "fields": {...}}.

Quick start

1.Get an API key

Create a key in your reseller portal, optionally limited to your servers’ addresses. Keep it secret; store it as AIFORWP_KEY.

export AIFORWP_KEY="aibr_…"

2.Create a license for a customer

Use your own customer or contract id as external_ref. The response contains the license key, only this once.

curl -X POST "https://api.ai-for-wp.be/v1/reseller/licenses" \
  -H "Authorization: Bearer $AIFORWP_KEY" \
  -H "Idempotency-Key: 7d0c2f4e-cust-20931" \
  -H "Content-Type: application/json" \
  -d '{"external_ref":"cust-20931","label":"bakkerij-jansen.be"}'

3.Install and activate the plugin

Download your white-label plugin (also in the portal), install it on the customer’s WordPress site and activate the license, or let your customer paste the key in the plugin settings.

curl -H "Authorization: Bearer $AIFORWP_KEY" https://api.ai-for-wp.be/v1/reseller/plugin.zip -o plugin.zip
wp plugin install plugin.zip --activate
wp ai-builder license activate aib_lic_3kQ9…

4.Delete it when the customer leaves

The AI stops on the site at once and the license no longer counts on your invoice. Pages already built stay on the site.

curl -X DELETE "https://api.ai-for-wp.be/v1/reseller/licenses/1042" \
  -H "Authorization: Bearer $AIFORWP_KEY"

Endpoints

GET/plans

Your package (every license is on it)

Example

curl "https://api.ai-for-wp.be/v1/reseller/plans" \
  -H "Authorization: Bearer $AIFORWP_KEY"

Response 200 · Plans

{
  "data": [
    {
      "code": "reseller-starter",
      "name": "Reseller Starter",
      "price_cents": 3900,
      "included_licenses": 10,
      "extra_license_price_cents": 390,
      "credits_per_license": 10,
      "extra_credits_price_cents": 1200
    }
  ]
}
GET/licenses

List licenses (newest first)

Parameters

statusquery · stringone of current, active, suspended, deleted, all · default current
external_refquery · string
unused_daysquery · integerOnly licenses created
limitquery · integer · default 50 · max 200
cursorquery · stringnext_cursor of the previous page

Example

curl "https://api.ai-for-wp.be/v1/reseller/licenses?status=current" \
  -H "Authorization: Bearer $AIFORWP_KEY"

Response 200 · A page of licenses

{
  "data": [
    {
      "id": 1042,
      "key": "aib_lic_3kQ9…",
      "key_prefix": "aib_lic_3kQ9",
      "plan": "reseller-starter",
      "status": "active",
      "external_ref": "cust-20931",
      "label": "bakkerij-jansen.be",
      "created_at": "2026-11-04T09:12:00Z",
      "deleted_at": null,
      "last_ai_use_at": "2026-11-04T10:30:00Z",
      "sites": [
        {
          "url": "https://bakkerij-jansen.be",
          "plugin_version": "0.9.0",
          "wp_version": "6.8",
          "activated_at": "2026-11-04T09:20:00Z",
          "last_seen_at": "2026-11-04T10:31:00Z"
        }
      ],
      "credits": {
        "monthly": 10,
        "rollover": 0,
        "extra": 0,
        "used": 3,
        "remaining": 7,
        "period_start": "2026-11-01T00:00:00Z",
        "period_end": "2026-12-01T00:00:00Z"
      }
    }
  ],
  "next_cursor": null
}
POST/licenses

Create a license

Returns the license key once (key): give it to your customer or activate the plugin with it (wp ai-builder license activate <key>). Send an Idempotency-Key header to retry safely: a retry within 24 hours returns the first answer instead of a second license.

Parameters

Idempotency-Keyheader · string

Body

external_refstringYour customer or contract id · max 128 chars
labelstring · max 128 chars

Example

curl -X POST "https://api.ai-for-wp.be/v1/reseller/licenses" \
  -H "Authorization: Bearer $AIFORWP_KEY" \
  -H "Idempotency-Key: 7d0c2f4e-cust-20931" \
  -H "Content-Type: application/json" \
  -d '{"external_ref":"cust-20931","label":"bakkerij-jansen.be"}'

Response 201 · Created (with key)

{
  "id": 1042,
  "key": "aib_lic_3kQ9…",
  "key_prefix": "aib_lic_3kQ9",
  "plan": "reseller-starter",
  "status": "active",
  "external_ref": "cust-20931",
  "label": "bakkerij-jansen.be",
  "created_at": "2026-11-04T09:12:00Z",
  "deleted_at": null,
  "last_ai_use_at": "2026-11-04T10:30:00Z",
  "sites": [
    {
      "url": "https://bakkerij-jansen.be",
      "plugin_version": "0.9.0",
      "wp_version": "6.8",
      "activated_at": "2026-11-04T09:20:00Z",
      "last_seen_at": "2026-11-04T10:31:00Z"
    }
  ],
  "credits": {
    "monthly": 10,
    "rollover": 0,
    "extra": 0,
    "used": 3,
    "remaining": 7,
    "period_start": "2026-11-01T00:00:00Z",
    "period_end": "2026-12-01T00:00:00Z"
  }
}
GET/licenses/{id}

Get a license

Parameters

id *path · integer

Example

curl "https://api.ai-for-wp.be/v1/reseller/licenses/1042" \
  -H "Authorization: Bearer $AIFORWP_KEY"

Response 200 · License

{
  "id": 1042,
  "key": "aib_lic_3kQ9…",
  "key_prefix": "aib_lic_3kQ9",
  "plan": "reseller-starter",
  "status": "active",
  "external_ref": "cust-20931",
  "label": "bakkerij-jansen.be",
  "created_at": "2026-11-04T09:12:00Z",
  "deleted_at": null,
  "last_ai_use_at": "2026-11-04T10:30:00Z",
  "sites": [
    {
      "url": "https://bakkerij-jansen.be",
      "plugin_version": "0.9.0",
      "wp_version": "6.8",
      "activated_at": "2026-11-04T09:20:00Z",
      "last_seen_at": "2026-11-04T10:31:00Z"
    }
  ],
  "credits": {
    "monthly": 10,
    "rollover": 0,
    "extra": 0,
    "used": 3,
    "remaining": 7,
    "period_start": "2026-11-01T00:00:00Z",
    "period_end": "2026-12-01T00:00:00Z"
  }
}
PATCH/licenses/{id}

Change status, reference or label

status: suspended pauses the AI (e.g. your customer didn't pay); the license still counts towards your package.

Parameters

id *path · integer

Body

statusstringone of active, suspended
external_refstring
labelstring

Example

curl -X PATCH "https://api.ai-for-wp.be/v1/reseller/licenses/1042" \
  -H "Authorization: Bearer $AIFORWP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"active","external_ref":"cust-20931","label":"bakkerij-jansen.be"}'

Response 200 · License

{
  "id": 1042,
  "key": "aib_lic_3kQ9…",
  "key_prefix": "aib_lic_3kQ9",
  "plan": "reseller-starter",
  "status": "active",
  "external_ref": "cust-20931",
  "label": "bakkerij-jansen.be",
  "created_at": "2026-11-04T09:12:00Z",
  "deleted_at": null,
  "last_ai_use_at": "2026-11-04T10:30:00Z",
  "sites": [
    {
      "url": "https://bakkerij-jansen.be",
      "plugin_version": "0.9.0",
      "wp_version": "6.8",
      "activated_at": "2026-11-04T09:20:00Z",
      "last_seen_at": "2026-11-04T10:31:00Z"
    }
  ],
  "credits": {
    "monthly": 10,
    "rollover": 0,
    "extra": 0,
    "used": 3,
    "remaining": 7,
    "period_start": "2026-11-01T00:00:00Z",
    "period_end": "2026-12-01T00:00:00Z"
  }
}
DELETE/licenses/{id}

Delete a license

The AI stops on its sites at once and the license no longer counts. Pages already built stay.

Parameters

id *path · integer

Example

curl -X DELETE "https://api.ai-for-wp.be/v1/reseller/licenses/1042" \
  -H "Authorization: Bearer $AIFORWP_KEY"

Response 200 · The deleted license

{
  "id": 1042,
  "key": "aib_lic_3kQ9…",
  "key_prefix": "aib_lic_3kQ9",
  "plan": "reseller-starter",
  "status": "active",
  "external_ref": "cust-20931",
  "label": "bakkerij-jansen.be",
  "created_at": "2026-11-04T09:12:00Z",
  "deleted_at": null,
  "last_ai_use_at": "2026-11-04T10:30:00Z",
  "sites": [
    {
      "url": "https://bakkerij-jansen.be",
      "plugin_version": "0.9.0",
      "wp_version": "6.8",
      "activated_at": "2026-11-04T09:20:00Z",
      "last_seen_at": "2026-11-04T10:31:00Z"
    }
  ],
  "credits": {
    "monthly": 10,
    "rollover": 0,
    "extra": 0,
    "used": 3,
    "remaining": 7,
    "period_start": "2026-11-01T00:00:00Z",
    "period_end": "2026-12-01T00:00:00Z"
  }
}
POST/licenses/{id}/credits

Add extra AI credits

Extra credits don't expire; they are invoiced at your package's price per 100 credits.

Parameters

id *path · integer

Body

credits *integer · 1–100000

Example

curl -X POST "https://api.ai-for-wp.be/v1/reseller/licenses/1042/credits" \
  -H "Authorization: Bearer $AIFORWP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"credits":100}'

Response 200 · License

{
  "id": 1042,
  "key": "aib_lic_3kQ9…",
  "key_prefix": "aib_lic_3kQ9",
  "plan": "reseller-starter",
  "status": "active",
  "external_ref": "cust-20931",
  "label": "bakkerij-jansen.be",
  "created_at": "2026-11-04T09:12:00Z",
  "deleted_at": null,
  "last_ai_use_at": "2026-11-04T10:30:00Z",
  "sites": [
    {
      "url": "https://bakkerij-jansen.be",
      "plugin_version": "0.9.0",
      "wp_version": "6.8",
      "activated_at": "2026-11-04T09:20:00Z",
      "last_seen_at": "2026-11-04T10:31:00Z"
    }
  ],
  "credits": {
    "monthly": 10,
    "rollover": 0,
    "extra": 0,
    "used": 3,
    "remaining": 7,
    "period_start": "2026-11-01T00:00:00Z",
    "period_end": "2026-12-01T00:00:00Z"
  }
}
POST/licenses/{id}/regenerate-key

Replace the license key

Returns the new key once. Sites that are already active keep working.

Parameters

id *path · integer

Example

curl -X POST "https://api.ai-for-wp.be/v1/reseller/licenses/1042/regenerate-key" \
  -H "Authorization: Bearer $AIFORWP_KEY"

Response 200 · License with key

{
  "id": 1042,
  "key": "aib_lic_3kQ9…",
  "key_prefix": "aib_lic_3kQ9",
  "plan": "reseller-starter",
  "status": "active",
  "external_ref": "cust-20931",
  "label": "bakkerij-jansen.be",
  "created_at": "2026-11-04T09:12:00Z",
  "deleted_at": null,
  "last_ai_use_at": "2026-11-04T10:30:00Z",
  "sites": [
    {
      "url": "https://bakkerij-jansen.be",
      "plugin_version": "0.9.0",
      "wp_version": "6.8",
      "activated_at": "2026-11-04T09:20:00Z",
      "last_seen_at": "2026-11-04T10:31:00Z"
    }
  ],
  "credits": {
    "monthly": 10,
    "rollover": 0,
    "extra": 0,
    "used": 3,
    "remaining": 7,
    "period_start": "2026-11-01T00:00:00Z",
    "period_end": "2026-12-01T00:00:00Z"
  }
}
GET/usage

What you owe for a month so far

Parameters

monthquery · string

Example

curl "https://api.ai-for-wp.be/v1/reseller/usage" \
  -H "Authorization: Bearer $AIFORWP_KEY"

Response 200 · Running total

{
  "month": "2026-11",
  "net_cents": 3900,
  "lines": [
    {
      "description": "Reseller Starter, November 2026",
      "quantity": "1",
      "net_cents": 3900
    }
  ],
  "licenses": [
    {
      "id": 1042,
      "external_ref": "cust-20931",
      "license_months": 1
    }
  ]
}
GET/plugin.zip

Download the plugin with your brand

The current plugin, with your name, logo and colours built in.

Example

curl "https://api.ai-for-wp.be/v1/reseller/plugin.zip" \
  -H "Authorization: Bearer $AIFORWP_KEY" \
  -o plugin.zip

Response 200 · Zip file

application/zip

Objects

Plan

codestring
namestring
price_centsintegerMonthly fee
included_licensesintegerLicenses included in the fee
extra_license_price_centsintegerPer license per month beyond the included ones
credits_per_licenseintegerAI credits per license per month
extra_credits_price_centsintegerPrice of 100 extra credits; 0 = not available

License

idinteger
keystringOnly when created or regenerated
key_prefixstring
planstring
statusstringone of active, suspended, deleted
external_refstring
labelstring
created_atstring (date-time)
deleted_atstring | null (date-time)
last_ai_use_atstring | null (date-time)
sitesobject[]
creditsobjectThis month's AI credits (absent for deleted licenses)
License.sites[]
urlstring
plugin_versionstring
wp_versionstring
activated_atstring (date-time)
last_seen_atstring | null (date-time)
License.credits
monthlyinteger
rolloverinteger
extrainteger
usedinteger
remaininginteger
period_startstring (date-time)
period_endstring (date-time)