AI drafts the player's next line
POST
/conversation/suggest-reply
const url = 'https://api.harperharbor.com/open/v1/conversation/suggest-reply';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"conversationId":"example","regenerate":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
conversationId
required
string
regenerate
boolean
Examplegenerated
{ "conversationId": "example", "regenerate": true}Responses
Section titled “Responses”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"}