REST API

The Aimogen Pro REST endpoints for text, images, embeddings, models and assistants, plus the rules and webhook routes, with authentication and examples.

Aimogen Pro can expose its AI functionality over REST, so external systems can generate content through your WordPress site.

Settings › REST API

Aimogen REST API - Allowing Developers To Call Any AI Model Or Assistant Directly From The WebEnabling and calling the REST API.Watch on YouTube

This tutorial was recorded before Aiomatic was renamed to Aimogen Pro. Some labels or interface elements may differ slightly from the current version.

Enabling#

SettingWhat it does
Enable Aimogen REST API FeatureRegisters the routes. Off by default
API Key ListPrivate keys, one per line. Passed as ?apikey=YOURKEY
Bearer Token ListBearer tokens, one per line

Endpoints#

All under https://example.com/wp-json/. All accept GET and POST.

aiomatic/v1/text#

bash
curl "https://example.com/wp-json/aiomatic/v1/text?apikey=YOUR_API_KEY&prompt=Write+a+haiku+about+WordPress&model=gpt-5-mini"
bash
curl -X POST "https://example.com/wp-json/aiomatic/v1/text" \
  -H "Content-Type: application/json" \
  -d '{"apikey":"YOUR_API_KEY","prompt":"Write a haiku about WordPress","model":"gpt-5-mini"}'
json
{
  "success": true,
  "data": "Generated text based on the provided prompt...",
  "input_tokens": "Input token count (numeric)",
  "output_tokens": "Output token count (numeric)"
}

aiomatic/v1/image#

bash
curl -X POST "https://example.com/wp-json/aiomatic/v1/image" \
  -H "Content-Type: application/json" \
  -d '{"apikey":"YOUR_API_KEY","prompt":"Generate an image of a sunset","model":"gpt-image-2"}'
json
{ "success": true, "image_url": "http://example.com/generated_image.jpg" }

aiomatic/v1/embeddings#

bash
curl -X POST "https://example.com/wp-json/aiomatic/v1/embeddings" \
  -H "Content-Type: application/json" \
  -d '{"apikey":"YOUR_API_KEY","prompt":"Generate an embedding for this text","model":"text-embedding-3-small"}'
json
{ "success": true, "embedding": [ ] }

aiomatic/v1/models#

bash
curl "https://example.com/wp-json/aiomatic/v1/models?apikey=YOUR_API_KEY"
json
{ "success": true, "models": [ "gpt-5-mini", "gpt-4-turbo" ] }

aiomatic/v1/assistants#

bash
curl "https://example.com/wp-json/aiomatic/v1/assistants?apikey=YOUR_API_KEY"
json
{
  "success": true,
  "assistants": { "Assistant ID 1": "Assistant Name 1", "Assistant ID 2": "Assistant Name 2" }
}

Errors#

json
{ "success": false, "error": "You need to specify an API key for this request" }

Errors are returned as HTTP 200 with success: false, not as HTTP error statuses. Check the success field.

Other registered routes#

Two more routes exist, registered independently of the REST API setting:

RoutePurposePermission
aiomatic/v1/rulesRun a bulk rule or workflow. See WebhooksKey check
omniblock/v1/webhookThe OmniBlock webhook listenerKey check, and the feature must be enabled
aiomatic/v1/chart-imageRenders a chart as an imagePublic by design

Security#

Use a long random key. Treat it as a password. Rotate it if it leaks.

Use HTTPS. The key travels in the query string on GET requests and appears in server logs. Prefer POST with a bearer token.

Set usage limits. REST requests consume the same API budget as everything else.

Turn the feature off when unused. The routes are not registered at all when the setting is off.

Restrict at the edge if you can — a firewall rule allowing only your integration server to reach /wp-json/aiomatic/* is stronger than any application-level check.

Limits and filters apply#

REST requests go through the same pipeline: usage limits, aiomatic_ai_allowed, prompt and reply filters, Reliability Mode and usage logging. Requests appear in System & Logs › Usage Logs with their environment label.

When to use REST instead of the PHP API#

REST when the caller is outside WordPress — another server, a mobile app, an automation platform.

PHP API when the caller is PHP inside the same WordPress installation. It avoids an HTTP round trip and needs no key.

Common problems#

404 on every route. The feature is off, or permalinks need flushing.

"You need to specify an API key". Missing or wrong apikey.

403 from a firewall. A WAF is blocking /wp-json/. See Plugin and server conflicts.

Works with GET, fails with POST. Check the Content-Type: application/json header.

Still stuck? Open a support ticket and include the diagnostics from Aimogen Pro › System & Logs › System Info.