Pro feature

API Reference

The onePost REST API lets you repurpose content programmatically — from your own apps, scripts, or automations. One endpoint, full control.

Base URLhttps://onepost.app

Authentication

All API requests must include your API key in the Authorization header. API access is available on the Pro plan only.

Header

Authorization: Bearer rk_live_...

Get your API key from Settings → API Keys. Keep it secret — never expose it in client-side code or commit it to version control. If compromised, regenerate it immediately from Settings.

bash
curl -X POST https://onepost.app/api/repurpose \
  -H "Authorization: Bearer rk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"content": "...", "tone": "professional", "platforms": ["linkedin"]}'

POST /api/repurpose

Repurpose a piece of long-form content into platform-optimised posts. This is the only endpoint in the API.

POST/api/repurpose
contentrequired

string

The source content to repurpose. Plain text, a YouTube URL, or a blog/article URL. Minimum 10 characters, maximum 10,000.

platformsrequired

string[]

Array of platforms to generate content for. Allowed values: linkedin, twitter, instagram, tiktok, newsletter, seo.

tonerequired

string

Writing tone. Allowed values: professional, casual, bold, witty.

input_type

string

How to interpret content. One of text (default), youtube (pass a YouTube URL), url (pass a blog/article URL).

mode

string

repurpose (default) deducts a credit and saves to history. regenerate returns results only — no credit cost, no history entry.

Response

On success, the API returns 200 OK with a JSON body.

json
{
  "results": {
    "linkedin": "The full generated LinkedIn post...",
    "twitter": "1/ Hook tweet\n\n2/ Next tweet...",
    "instagram": "Caption text here..."
  },
  "creditsUsed": 7
}

results contains one key per platform you requested, each holding the full generated post as a string. creditsUsed reflects your total usage after this request (only present when mode is repurpose).

Error Codes

400

Bad Request

Missing or invalid fields in the request body.

401

Unauthorized

No API key provided, or the key is invalid.

402

Payment Required

No credits remaining on your plan.

403

Forbidden

Requested platform or tone is not available on your plan, or API access requires Pro.

404

Not Found

Tone profile not found (only relevant when tone is 'profile').

502

Bad Gateway

The AI model failed to respond. Retry with exponential backoff.

Error responses always include an error field:

json
{ "error": "No credits remaining. Upgrade your plan to continue." }

Examples

cURL

bash
curl -X POST https://onepost.app/api/repurpose \
  -H "Authorization: Bearer rk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "AI is transforming how content creators work...",
    "tone": "professional",
    "platforms": ["linkedin", "twitter"],
    "input_type": "text"
  }'

JavaScript / TypeScript

typescript
const response = await fetch("https://onepost.app/api/repurpose", {
  method: "POST",
  headers: {
    "Authorization": "Bearer rk_live_your_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    content: "AI is transforming how content creators work...",
    tone: "professional",
    platforms: ["linkedin", "twitter"],
  }),
});

const { results, creditsUsed } = await response.json();
console.log(results.linkedin); // full LinkedIn post
console.log(results.twitter);  // full Twitter thread

Python

python
import requests

response = requests.post(
    "https://onepost.app/api/repurpose",
    headers={
        "Authorization": "Bearer rk_live_your_key_here",
        "Content-Type": "application/json",
    },
    json={
        "content": "AI is transforming how content creators work...",
        "tone": "professional",
        "platforms": ["linkedin", "twitter"],
    },
)

data = response.json()
print(data["results"]["linkedin"])
print(data["results"]["twitter"])

YouTube video as input

bash
curl -X POST https://onepost.app/api/repurpose \
  -H "Authorization: Bearer rk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "tone": "casual",
    "platforms": ["tiktok", "instagram"],
    "input_type": "youtube"
  }'

Rate Limits & Credits

API requests consume credits the same way the dashboard does — each mode: repurpose call costs 1 credit. Pro plans have unlimited credits, so this only matters during trial/testing.

There is no hard rate limit per minute, but the Groq AI model processing means each request typically takes 3–8 seconds. For bulk use, process requests sequentially rather than in large parallel batches.

Ready to build?

Get your API key from Settings, then make your first request.