provider experiments POST
/api/projects/{project_id}/experiments/create_from_prompt/ @utdk/posthog
/api/projects/{project_id}/experiments/create_from_prompt/ experiments_create_from_prompt_create
Create an experiment that compares N versions of an LLM prompt using a metric template.
The user picks 2+ versions of an existing LLMPrompt and 1+ metric templates
(cost / latency / eval_pass_rate). The endpoint builds the matching variants
(control + test-N, each named after its prompt version) and attaches one
metric per selected template, each scoped to the prompt's $ai_prompt_name.
Resulting experiment is in draft state.
- project_id path required
- Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
- string
Try it
Authentication
Configure credentials for PostHog API
Code snippet
Updates live as you fill in the form above.
TypeScript
import posthog from '@utdk/posthog';
await posthog.experimentsCreateFromPromptCreate()