This is the full technical reference. New here? Start with the AI Content Writer API overview or the Molixa API platform.
Get access
The API is for approved B2B partners. Apply at /partners (or from your dashboard under Watermark API — the same partner account). Once approved you get a secret mlx_ key for server-side use. The Content API bills a shared credit balance — the same credits power the Watermark API. Enable the Content API from your partner dashboard to mint a content-scoped key.
Base URL & auth
All requests are HTTPS. Authenticate with your secret key in the X-Api-Key header (or Authorization: Bearer). Send X-Owns-Content: true to accept the Content Acceptable Use Policy for the generation (required).
POST https://molixa.app/api/v1/content/generate
X-Api-Key: mlx_your_secret_key
X-Owns-Content: true
Content-Type: application/jsonThe endpoint
POST /api/v1/content/generate with a JSON body:
- prompt (required): the topic, instruction, or source text (≤ 8,000 chars).
- task: what to write. One of
freeform, blog-intro, blog-outline, blog-section, product-description, ad-copy, email, rewrite, summarize. Defaultfreeform. - tone: e.g.
friendly,formal. Optional. - language: output language. Default English.
- maxWords: target length, clamped 1–2000. Default 400.
- tier:
fast(DeepSeek, default) orquality(OpenAI).
Send an Idempotency-Key header to make retries safe — a repeat with the same key replays the first result instead of generating (and charging) again.
curl -X POST https://molixa.app/api/v1/content/generate \
-H "X-Api-Key: $MOLIXA_CONTENT_API_KEY" -H "X-Owns-Content: true" \
-H "Content-Type: application/json" -H "Idempotency-Key: post-4821" \
-d '{
"task": "product-description",
"prompt": "Noise-cancelling wireless earbuds, 40h battery",
"tone": "confident", "maxWords": 120, "tier": "fast"
}'Response — 200 OK
{
"ok": true,
"text": "…the generated copy…",
"jobId": "…",
"task": "product-description",
"tier": "fast",
"model": "deepseek-chat",
"provider": "deepseek",
"wordsUsed": 118,
"creditsRemaining": 499882
}Billing — you pay for the words you get
One prepaid credit balance powers both this API and the Watermark API. Content costs 0.2 credits/word on the fast tier and 0.5/word on quality. We authorize the worst case (maxWords) up front, generate, then refund the unused remainder — so you are charged for the words you actually receive and never more. A failed or policy-blocked generation is fully refunded. When your balance runs out the API returns INSUFFICIENT_CREDITS until you top up.
Errors
All errors are JSON with a 4xx status and a stable code:
| Status | code | Meaning |
|---|---|---|
| 422 | BLOCKED | Prompt or output refused by the content policy (not charged). |
| 422 | GENERATION_FAILED | All providers failed (credit refunded). |
| 429 | RATE_LIMITED | Too many requests this minute — back off. |
| 402 | INSUFFICIENT_CREDITS | Out of credits — top up. |
| 403 | SCOPE_FORBIDDEN | Key not enabled for the Content API. |
| 401 / 403 | NO_KEY · INVALID_KEY · PARTNER_NOT_APPROVED | Auth. |
| 400 | AFFIRMATION_REQUIRED · BAD_INPUT | Missing X-Owns-Content / bad field. |
Node / TypeScript
const res = await fetch("https://molixa.app/api/v1/content/generate", {
method: "POST",
headers: {
"X-Api-Key": process.env.MOLIXA_CONTENT_API_KEY!, // server-side only
"X-Owns-Content": "true",
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({ task: "blog-intro", prompt: "How to sleep better", maxWords: 150 }),
});
const data = await res.json();
if (data.ok) {
// data.text is the generated copy; data.wordsUsed was billed
}Compliance
Your terms must bind users to an Acceptable Use Policy that forbids generating spam, deceptive or illegal content, disinformation, harassment, or unauthorized impersonation. Only send X-Owns-Content: true for users who accepted it. Every prompt and output is run through moderation; flagged text is blocked and not charged. You remain responsible for reviewing and publishing generated content.
Pricing
Prepaid credits — one balance for both APIs. At 0.2 credits/word (fast), a pack of credits translates to a lot of copy. Bigger packs cost less per credit:
| Pack | Price | Credits | Words (fast) |
|---|---|---|---|
| Starter | $50 | 50,000 | 250,000 |
| Growth | $90 | 99,000 | 495,000 |
| Scale | $230 | 276,000 | 1,380,000 |
| Enterprise | custom | — | — |
Ready to integrate? Apply for API access →