Skip to main content
Generate Protocol Endpoint

Body

application/json

Request body for generating a protocol from natural language.

prompt
string
required

Plain-English description of the test to run, e.g. '1C/1C cycling for 200 cycles between 4.2 V and 2.5 V with 10-minute rests'.

Required string length: 1 - 4000
current_protocol
string | null

Optional existing protocol as UCP YAML. When supplied the prompt is treated as an edit to it rather than a fresh protocol.

Maximum string length: 100000
clarifications
ClarificationAnswer · object[]

Answers to questions a previous call returned, oldest first. Send the full history each time — the exchange is stateless.

Maximum array length: 20
cell_specification_id
string | null

Cell the test will run on. Its voltage limits, capacity and rate limits are given to the generator as facts, so it stops guessing (or asking) about them.

skip_existing
boolean
default:false

Skip the saved-protocol search and write a new protocol. Set when the user rejects the suggested matches.

allow_inputs
boolean
default:false

Allow the protocol to carry input["..."] references for values supplied per run, and offer parametric saved protocols as matches. Leave false where every value has to be pinned before the protocol can run, as it does for a scheduled test.

Response

Successful Response

A protocol, the questions needed to write one, or an existing match.

Exactly one branch is populated. Callers should check questions and matches before reading protocol_yaml — both leave it empty.

protocol_yaml
string
default:""
name
string
default:""
explanation
string
default:""
assumptions
string[]
questions
ClarifyingQuestionResponse · object[]
matches
ExistingProtocolMatchResponse · object | null

A saved protocol that already does what was asked for.