API reference
Branch from an earlier turn and leave the original as it was.
Try another direction from any earlier response; the branch is a new line of work and the original session does not change.
Request
POST /{harness_id}/v1/responses
Content-Type: application/json
{
"input": "Try the same analysis with last year's numbers instead.",
"previous_response_id": "<an earlier response id>",
"branch": true,
"stream": true
}How it works
- The branch starts from the turn you name and continues from there. Later turns on the original are not part of it.
- The original session is left alone, so both lines of work stay open.
- You can branch only from a response that has ended. One with no restorable checkpoint answers 409 with
branch_unavailable. branchwithoutprevious_response_idanswers 400.
- Continue a sessionCarry on the same line of work instead.
Ready to run this against a live workspace?Create API key