Agentic API 12 min read

MarketOS Agentic API: BYOK Content Generation for AI Agents

We're opening up the MarketOS content engine to AI agents. Generate marketing images, social captions, hashtags, and 100+ types of SEO content — all through a simple REST API where agents bring their own AI provider keys.

The web is changing. AI agents are no longer just chatbots answering questions — they're autonomous systems that browse, purchase, and create on behalf of humans. At MarketOS, we've been building a content generation engine that handles prompt engineering, brand context extraction, multi-model routing, and content formatting. Today, we're making all of that available as an API that AI agents can use directly.

What the Agentic API Does

The MarketOS API exposes six endpoints that cover the full marketing content pipeline. An AI agent can go from a simple brief like "promote our spring sale" to a complete social media post with image, caption, and hashtags — in a single API call.

Endpoint What It Does
/v1/generate/marketing Full pipeline: parse intent → generate image → create caption + hashtags. One call, complete social post.
/v1/generate/caption Platform-optimized captions for Instagram, LinkedIn, Twitter/X, Facebook, TikTok with hashtags.
/v1/generate/content Blog posts, SEO articles, FAQs, case studies, and 100+ content types across 11 categories.
/v1/generate/image Marketing images via Google Imagen 4 and Gemini models with 50+ visual styles.
/v1/scrape Extract brand context from any URL — voice, messaging, industry, colors.
/api-keys/register Register AI provider keys (encrypted AES-256-GCM) and get a Bearer token.

BYOK: Agents Bring Their Own Keys Too

MarketOS has always been a BYOK (Bring Your Own Keys) platform. Our desktop app never touches your API keys — you connect directly to OpenAI, Google, Anthropic, and Stability AI at wholesale rates. We apply the same philosophy to the API.

When an AI agent calls the MarketOS API, it provides its own AI provider keys. MarketOS handles the orchestration — prompt engineering, brand context injection, multi-model routing, content formatting — but the actual AI inference happens on the agent's own credentials. We never mark up AI costs.

Two Authentication Modes

  • Bearer Token (Stored BYOK) — Register your keys once via /api-keys/register. Keys are encrypted with AES-256-GCM at rest. Use the returned token for all subsequent requests.
  • Stateless BYOK — Pass API keys per-request via the X-Api-Keys header. Keys are used in-memory only, never stored. Ideal for agents that manage their own key rotation.

How AI Agents Discover the API

We've implemented the emerging standards for AI agent discovery. When an agent visits marketos.org, it can find our API through multiple channels:

llms.txt

A Markdown file at /llms.txt that describes our API endpoints, auth methods, and content types in a format optimized for LLMs.

/.well-known/agents

Redirects to our machine-readable JSON info endpoint with full capability descriptions, parameters, and schemas.

/api/v1/info

A JSON endpoint that returns all capabilities, supported models, content types, and authentication requirements.

/docs/api

Human-readable API documentation with interactive examples, code snippets, and getting started guides.

Quick Start: One API Call to a Complete Social Post

Here's what a single call to the full marketing pipeline looks like. The agent sends a brief, and MarketOS returns an image, caption, and hashtags:

curl -X POST https://marketos.org/api/v1/generate/marketing \
  -H "Content-Type: application/json" \
  -H "X-Api-Keys: {\"gemini\":\"your-gemini-key\"}" \
  -d '{
    "brief": "Promote our spring collection launch",
    "platform": "instagram",
    "brandContext": "Luxury fashion brand targeting millennials",
    "style": "fashion-editorial",
    "imageModel": "imagen-4-ultra"
  }'

The response includes a base64-encoded image, platform-optimized caption, and relevant hashtags — everything needed to publish a social media post.

100+ Content Types via API

The /v1/generate/content endpoint gives agents access to the same SEO Studio that powers the desktop app. That's 100+ content types across 11 categories:

Blog & Articles

Standard posts, opinion pieces, listicles, how-to guides, pillar pages

SEO Content

Pillar pages, topic clusters, FAQ schema, meta descriptions

Email Marketing

Newsletters, drip sequences, welcome emails, re-engagement

Ad Copy

Google Ads, Facebook Ads, LinkedIn Ads, landing page copy

AI Search (AEO)

AI Engine Optimized content for ChatGPT, Perplexity, Gemini citations

Thought Leadership

Case studies, whitepapers, industry reports, executive briefs

Payment: x402 Protocol Support

For agents that don't have a MarketOS plan, we support the x402 payment protocol for per-request payment. When an agent hits a paid endpoint without valid auth, it receives an HTTP 402 response with payment instructions. The agent pays with USDC on Base and retries — all without human intervention.

Endpoint Orchestration Fee
/v1/generate/marketing $0.05 per request
/v1/generate/image $0.05 per request
/v1/generate/content $0.05 per request
/v1/generate/caption $0.01 per request
/v1/scrape $0.01 per request

Existing MarketOS subscribers ($19.99/mo) and lifetime license holders ($199) get API access included — 1,000 requests per day, no extra charge. The x402 fees above are only for API-only users without a plan.

This is the future of machine-to-machine commerce: AI agents discovering services, negotiating payment, and completing transactions autonomously.

Serverless Architecture

The API runs as Netlify Functions — serverless, auto-scaling, zero infrastructure to manage. API keys are stored in Netlify Blobs (encrypted AES-256-GCM). Rate limiting and usage tracking happen at the edge. There's no database, no server to maintain, and no cold start penalty worth worrying about.

Pricing

API access is included with both existing MarketOS plans:

$19.99/month Subscription

Web app + API access. 1,000 API requests/day included. BYOK — you pay AI providers directly.

$199 Lifetime License

Desktop app + API access forever. 1,000 API requests/day included. One payment, no recurring fees.

For agents without a MarketOS plan, per-request payment is available via the x402 protocol: $0.05 for generation endpoints, $0.01 for lightweight calls. No account needed.

What's Next

The agentic API is live. We're working on:

  • MCP (Model Context Protocol) server integration for direct tool-use from Claude, GPT, and other agents
  • Webhook callbacks for long-running content generation jobs
  • Batch endpoints for generating content at scale
  • Usage dashboards and analytics for API consumers

Read the full API documentation or check out our step-by-step tutorial for connecting your first agent.

Try the Agentic API

Get started with the MarketOS API in minutes. All you need is a Google Gemini API key (free tier available).