Skip to main content
POST
Generate next user message

Authorizations

Authorization
string
header
required

API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....

Body

application/json
sessionId
string
required

The session to generate the next user message for

Example:

"session_123"

maxTurns
integer

The number of turns this run itself may add. The turns of a predefined conversation are already answered, so they widen this budget instead of spending it. Defaults to the test case's max iterations.

Required range: x >= 1
Example:

5

Response

Next user message generated successfully

nextMessage
string
required

The generated next user message. Empty when the conversation has finished.

finished
boolean
required
inferenceResultId
string
required

The pending turn that holds the generated message. Empty when the conversation has finished.

stoppingReason
string | null
simulatorVersion
string | null
creditsUsed
number | null

The credits the simulator spent on this turn. Null without evaluation.readInference on the session's product.