OnlyAI SEO

Documentation

API reference

The plugin uses this API for you. You can call it directly as well, for example from a script or to test a key.

Base URL and key

BASE_URL = https://onlyaiseo.com/wp-json/onlyai-hub/v1

# every request except /health needs this header
Authorization: Bearer hub_YOUR_API_KEY

# optional: names the calling site (shown in your dashboard)
X-Site-Url: https://mysite.com

Endpoints

GET/ping

Checks that your key works.

# {"ok":true,"version":"1.0.0"}

GET/account

Your plan, the daily limit for this key, how many requests it made in the last 24 hours, and the site bound to it.

# {"plan_name":"free","daily_limit":50,"requests_today":3,
#  "usage_remaining":47,"site_url":"https://mysite.com"}

GET/usage

Request and token counts for the last 24 hours and the last month, for this key.

# {"today":3,"today_tokens":1204,"month":41,"month_tokens":18320}

POST/generate

Writes text from a prompt. Body: prompt (required), max_tokens (default 2000, at most 4096), temperature (default 0.7), system_prompt (optional).

# POST {"prompt":"Write a 300-word intro for a post about SEO audits"}
# {"content":"...","model":"autoarticleai",
#  "tokens_used":412,"usage_remaining":46}

POST/batch

Runs up to 5 prompts in one call. Body: prompts (array of strings, at most 5), max_tokens (default 1000). Each prompt counts as one request.

# POST {"prompts":["Write an H1","Write a meta description"]}
# {"results":[{"content":"...","tokens_used":120},...],"usage_remaining":45}

POST/analyze

Keyword analysis: volume estimate, difficulty, trend, intent, long-tail suggestions and top questions. Body: keyword (required).

# POST {"keyword":"seo audit checklist"}
# {"analysis":{"keyword":"seo audit checklist","search_volume_estimate":4400,
#  "difficulty":32,"trend":"rising","intent":"informational",
#  "suggestions":[...],"top_questions":[...]},"usage_remaining":44}

POST/link-suggestions

Internal link ideas for an article. Body: content (required).

# POST {"content":"<article text>"}
# {"suggestions":[{"anchor_text":"...","target_topic":"...","reason":"..."}],
#  "model":"autoarticleai","tokens_used":310,"usage_remaining":43}

POST/repurpose

Turns an article into other formats. Body: content (required), formats (up to 4 of social_post, email, newsletter, meta_description, blog_intro, press_release).

# POST {"content":"<article text>","formats":["social_post","email"]}
# {"results":[{"format":"social_post","content":"...","suggested_title":"..."}],
#  "model":"autoarticleai","tokens_used":812,"usage_remaining":42}

POST/image-alt

Alt text, caption and a file name for an image. Body: description (required).

# POST {"description":"A white laptop on a wooden desk with code on screen"}
# {"alt_text":"Laptop displaying code on a wooden desk","caption":"...",
#  "filename_suggestion":"laptop-code-desk.jpg","model":"autoarticleai",
#  "tokens_used":95,"usage_remaining":41}

Without a key

GET https://onlyaiseo.com/wp-json/onlyai-hub/v1/health and GET https://onlyaiseo.com/api/health return yes or no for each part of the service (database, email, AI engine, billing). They never return a secret.

Errors

Errors return JSON with a message field.

400  Bad request: a required field is missing, or the JSON is invalid
401  Missing, invalid or revoked API key
404  Unknown endpoint
429  This key has used its requests for the last 24 hours
502  The AI engine failed or timed out (not counted as a request)
503  OnlyAI Cloud is not available right now