Skip to content

AI

1 endpoint: draft a reply to a comment.

Draft a reply to a comment

POST /v1/ai/comment_replies

Writes a short reply to one comment, in the comment's language, using the Workspace's Tokens. Send max_tokens: without it, or when the price is higher, the request is refused with the price and nothing is charged. Nothing is posted; reply with POST /v1/comments/threads/{thread_id}/replies when you are happy with it. In a sandbox the reply is simulated and free.

Permission: ai:use · Counts 5 requests · Accepts Idempotency-Key · Answers 201

Body

FieldTypeRequiredDescription
commentstringYesThe comment to answer. Treated as data, never as instructions. (up to 600 characters)
video_titlestringNoTitle of the video or post the comment is on, for context. (up to 200 characters)
languagestringNoBCP 47 tag for the reply when the comment's language is unclear. (up to 35 characters, default "en")
max_tokensnumber or stringNoThe most this call may cost, in Tokens.

Response

FieldTypeRequiredDescription
object"comment_reply"Yes
replystringYes
questionstring or nullYesA question the draft needs answered before it can be specific, if any.
tokensstringYesTokens charged, as a decimal string.
simulatedbooleanYes
curl -X POST https://api.nowscale.com/v1/ai/comment_replies \
  -H "Authorization: Bearer $NOWSCALE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ ... }'