Skip to main content
It is highly recommended to run evals with either the Python or TypeScript SDKs. The SDKs have many optimizations and features that enhance the performance and reliability of your evals. However, if you are unable to use the SDKs, either because you are using a different language or because you are running in a restricted environment, you can use the REST API directly. This guide will show you how to run evals using the REST API, using the requests library in Python as an example. However, the same principles apply to any language. Before diving into this content, it might be helpful to read the following:

Create a dataset

Here, we are using the python SDK for convenience. You can also use the API directly use the UI, see this guide for more information.

Run a single experiment

First, pull all of the examples you’d want to use in your experiment.
Next, we’ll define a method that will create a run for a single example.
We are going to run completions on all examples using two models: gpt-3.5-turbo and gpt-4o-mini.

Run a pairwise experiment

Next, we’ll demonstrate how to run a pairwise experiment. In a pairwise experiment, you compare two examples against each other. For more information, check out this guide.

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.