Skip to content

AI drafts the player's next line

POST
/conversation/suggest-reply
curl --request POST \
--url https://api.harperharbor.com/open/v1/conversation/suggest-reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "conversationId": "example", "regenerate": true }'

Put it in the input box; the player sends it. Calling again without regenerate returns the same line with cost 0, cached true. Flat cost, charged only on success.

Media typeapplication/json
object
conversationId
required
string
regenerate
boolean
Examplegenerated
{
"conversationId": "example",
"regenerate": true
}

A draft.

Media typeapplication/json
object
reply
string
cost
number
cached
boolean
Examplegenerated
{
"reply": "example",
"cost": 1,
"cached": true
}

insufficient_credits — the account cannot pay.

Media typeapplication/json
object
error
required

Machine-readable code. unauthorized means authentication failed. Refresh the token; if refresh fails, request authorization again.

string
message
required

One English sentence a client may show verbatim.

string
retryable
boolean
detail

Present on some 4xx errors with the offending part.

object
key
additional properties
any
Example
{
"error": "unauthorized"
}