AI APIAPI

AI writing, exposed the way you will actually call it

One REST endpoint generates a caption from a brief. The rest of the writing toolkit, rewriting a draft for each network and repurposing a URL, lives on the FoPost MCP server, where an AI client can chain it straight into scheduling.

POST /v1/ai/generate-caption
curl -X POST https://api.fopost.com/v1/ai/generate-caption \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "9b2f6c1e-...",
    "instructions": "Announce webhook retries with exponential backoff",
    "platforms": ["linkedin"],
    "tone": "direct"
  }'

One REST endpoint

generate-caption takes a brief, a platform, and a tone, and returns ready copy.

Three MCP tools

generate_caption, rewrite_for_platforms, and repurpose_url for any MCP client.

Credit based

Every call draws from the workspace’s AI credits. Read the balance any time.

REST

Generate a caption from your own pipeline

Send a short brief and the target network, and get back a caption written inside that network’s limits. It needs the ai scope on the key. The response is text; nothing is published until you pass it to POST /v1/posts yourself.

Read the AI reference
Response
{
  "caption": "Webhook retries are live. A failed delivery now retries with exponential backoff before it ever reaches your inbox as an error. Details in the changelog.",
  "credits": { "charged": 1, "remaining": 199 }
}

Platform aware

Length, hashtag use, and line breaks follow the network you name.

Never auto-posts

The endpoint returns text. Publishing is a separate, explicit request.

ai scope

Grant it only on keys that should spend credits.

MCP

Rewrite and repurpose from an AI client

The MCP server exposes the full writing set. rewrite_for_platforms turns one draft into a thread for X and a paragraph for LinkedIn. repurpose_url reads a page and proposes a series of posts. Both hand their output to schedule_post in the same session, with the client asking before anything goes live.

Set up the MCP server
Prompt
> Take our latest changelog at https://yourbrand.com/changelog
  and turn it into three posts for LinkedIn and X this week.

Agent: I'll call repurpose_url, then rewrite_for_platforms for each,
then schedule_post for Tue, Wed, and Thu at 9am. Proceed? (y/n)

rewrite_for_platforms

One draft in, one version per network out, each inside its limits.

repurpose_url

Point it at a post, a changelog, or a docs page and get a series back.

Straight to schedule

The agent chains writing tools into schedule_post without leaving the chat.

Credits

Spend is visible, capped, and per workspace

Every AI call is metered against the free monthly usage credit included with every account. Read the balance over MCP with get_ai_credits, and in the dashboard under AI Usage. When the balance runs out, the call returns 402 with an upgrade link instead of silently failing.

Start building
The agent drafting posts for several networks in a saved brand voice

get_ai_credits

Ask the agent how many credits are left before a big batch.

Clear 402

An exhausted balance is an explicit error, never a half-written post.

Workspace scoped

Credits and prompts stay inside the workspace the key belongs to.

AI API questions, answered

Which AI features are on the REST API?

One endpoint: POST /v1/ai/generate-caption, with the ai scope. Rewriting per network, hashtag suggestions, and repurposing a URL are available as MCP tools and inside the in-app agent, not as public REST endpoints today.

Which model does it use?

FoPost does not expose the provider or model. You choose a feature and a tone; the service picks what runs it and can change it without a change on your side.

Will it publish on its own?

No. Every AI endpoint and tool returns text. Publishing is a separate request, and MCP clients show the schedule_post call for approval before running it.

How are credits charged?

Each call is metered against your billing account and returned with the response. Usage draws on the free monthly credit first; with a card on file, anything past it is billed for exactly what you use.

Does it know my brand voice?

Calls made from the in-app agent can attach a brand, which folds its voice and style into the prompt. The REST endpoint takes a tone parameter and the brief you send.

Which scope does the key need?

The ai scope. A key without it gets a 403 on this endpoint while still working for whatever other scopes it carries.

Build on the AI API today

Starting is free and the full API is included. Create a key and make your first call in minutes.

Get your API key