Overview
Stimulus (stim) generation creates questions, tasks, or prompts based on the target’s generator configuration and teacher prompt. Stim generates scenarios where the expert behavior would be applied. Stim jobs execute asynchronously and their output is used as input for rollout jobs.Endpoints
Run Stim Job
Start a stim job for the target. Endpoint:POST /v1/repo/{repo_name}/targets/{target_name}/stim
Request:
Target name
Repository name
- Target must have stim configuration (generators, teacher prompt, student prompt)
- Idempotent: repeated calls return current state (no duplicate jobs)
- Asynchronous: returns immediately, job runs in background
Python SDK: The
repo_name parameter must be passed as a keyword argument (not positional). This is intentional for API clarity and consistency.Polling: By default, poll=True automatically waits for the job to complete. Manual polling loops are no longer needed unless you set poll=False.200 OK
status:string- Job status ('not_started','running','complete', or'failed')lines:number- Number of output lines generatedparameters:object- Job parameters
Get Stim Status
Get stim job status. Endpoint:GET /v1/repo/{repo_name}/targets/{target_name}/stim
Request:
Target name
Repository name
200 OK
status:string-'not_started','running','complete', or'failed'lines:number- Number of generated stimuliparameters:object- Job configuration
Get Stim Output
Get paginated stim output data. Endpoint:GET /v1/repo/{repo_name}/targets/{target_name}/stim/output
Request:
Target name
Repository name
Number of lines to return (max 1000)
Starting line number (0-indexed)
200 OK
status:string- Job statuslines:number- Total number of output linesoffset:number- Starting line offsetlimit:number- Page sizehas_more:boolean- Whether more data is availableoutput:Array<string>- List of generated stimuliparameters:object- Stim configuration
Complete Workflow Example
1
Start Stim Job
2
Poll Status
3
Fetch Output
Pagination Example
Fetch all stim output with pagination:Job Status States
not_started
Job has not begun execution
running
Job is currently executing
complete
Job finished successfully
Best Practices
Poll Responsibly
Poll Responsibly
Wait at least 5-10 seconds between status checks to avoid unnecessary API calls
Use Pagination
Use Pagination
Use pagination when fetching output to handle large datasets efficiently
Check Before Running
Check Before Running
Check job status before starting a new run to avoid conflicts
Handle Incomplete Jobs
Handle Incomplete Jobs
Implement proper error handling for jobs that fail or stall
Error Handling
Not Found (404)
Target doesn’t exist:404 Not Found
Missing Configuration (400)
Target missing required stim configuration: Response:400 Bad Request