Endpoints
Generate a comment
Writes a natural Reddit comment from a post and your product: the tone of the subreddit, a single product mention, no promotional tells.
/api/v1/generate-comment35 creditsThe comment is stored nowhere on our side: it is returned once, and it is yours to keep. You can publish it yourself, have it reviewed, or send it to the publishing endpoint.
Parameters
Request body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
post_url | string | Required | Full URL of the Reddit post. Must start with https://www.reddit.com/ or https://reddit.com/. It doubles as the idempotency key for the charge. |
post_title | string | Required | Title of the post. It carries most of the context. 300 characters at most. |
post_body | string | Optional | Body of the post, when there is one. 2,000 characters at most. Providing it yields a markedly more specific comment. |
product_description | string | Required | Description of your product or service. Between 10 and 500 characters. Without it, there is nothing to mention. |
product_name | string | Optional | Product name, 60 characters at most. When absent it is inferred from the start of the description — often less cleanly. |
target_language | fr | en | Optional | Fallback language for the comment. The detected language of the post still takes priority.Default: "fr" |
Example
curl -s -X POST https://subreply.io/api/v1/generate-comment \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sr_live_VOTRE_CLE_API" \
-d '{
"post_url": "https://www.reddit.com/r/startupfrance/comments/1abc23/...",
"post_title": "Comment trouver mes premiers clients B2B sans réseau ?",
"post_body": "Je lance mon cabinet de conseil et je n'\''ai aucun réseau...",
"product_description": "SaaS de gestion de leads pour TPE/PME françaises",
"product_name": "Leadly",
"target_language": "fr"
}'{
"comment": "J'ai monté mon cabinet il y a deux ans avec exactement le même problème. Ce qui a marché pour moi : identifier 30 boîtes ultra ciblées plutôt que d'arroser large, et suivre chaque échange quelque part. Au début un tableur suffit, ensuite j'ai basculé sur Leadly parce que je perdais le fil des relances. Le réseau vient après les premiers clients, pas avant.",
"credits_used": 35,
"credits_remaining": 465
}credits_used is the REAL charge, not the price list: it is 0 on an idempotent replay. credits_remaining is your balance after the call — enough to stop a workflow before it runs out of credits.
Idempotency
The charge is keyed on the post URL, normalised (trailing slash, domain casing and tracking parameters ignored). Two calls on the same post therefore bill once: the second returns a fresh comment with credits_used: 0.
The practical consequence: replaying a call after a network timeout costs nothing. You can retry without counting your calls.
The generation is owed to you, even if the charge fails
credits_used: 0. The loss is ours: we never bill for work we did not deliver, and we never hold back work already produced.Best practices
- Always pass
product_name— the product mention is then exact and natural, instead of being guessed from the description. - Chain it after
/scrape: scrape first (free), then generate only on posts abovescore: 0.7. That is the best ratio of credits spent to replies earned. - Send
post_bodywhenever it exists : a comment that answers the detail of the post blends in, a comment that answers the title alone stands out. - Read it before publishing if the topic is sensitive. The text is ready to paste, it is still written by an AI.
The language of the post wins
target_language is a FALLBACK, not an order: generation follows the detected language of the post first. We never answer in French under an English thread — an off-language comment is the fastest way to get spotted and removed.