When to use which
The console’s own conversation chat uses this route under the hood. For most integrations, invoke is enough; reach for turn when you need to inspect or persist the transcript between turns.
Request
- Header:
Authorization: Bearer $GRADIENT_API_KEY. The key needs theagents:invokescope. - Header:
content-type: application/json. - Body: a JSON object.
Each entry in
messages has this shape:
Example
Response
When the graph is parked on a timed wait, the response also carries
waiting: true, a waitUntil timestamp, and any waitConfig.
Continuing a conversation
To take the next turn, send a request with themessages, currentNodeKey, and nodeVersion from the previous response, plus the new message. Keep the same agentId and nodeVersion for the life of the conversation.