> ## Documentation Index
> Fetch the complete documentation index at: https://www.getmaxim.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# HTTP Endpoint Quickstart

> Run your first test on an AI application via HTTP endpoint with ease, no code changes needed.

export const MaximPlayer = ({url}) => {
  return <iframe className="border-background-highlight-secondary h-full w-full rounded-md border-2 aspect-video" src={url} allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>;
};

## Create a Public HTTP Endpoint

Connect your application's API endpoint to Maxim. Enter your API URL and add any necessary headers and parameters.

Configure the payload for your API request. Include all data your backend needs to process requests. When running tests, attach a dataset to your endpoint.

Reference column values from your dataset using `{{column_name}}` variables. These resolve during test runtime. Use variables in headers and parameters for flexible endpoint configuration.

See it in action:

<MaximPlayer url="https://drive.google.com/file/d/12c3B1TWifq4cAa-43lF2enCLoN7PO0JX/preview" />

## Variables in HTTP Endpoints

Variables let you parameterize requests and manage dynamic values. Maxim provides two ways to work with them.

### Using Variables in Request Body and Headers

Use `{{variable_name}}` syntax to substitute dataset column values directly in your endpoint configuration:

```json theme={null}
{
  "query": "{{input}}",
  "user_name": "{{user_name}}",
  "temperature": "{{temp}}"
}
```

Variables resolve at runtime from your dataset columns. This works in both the request body and headers.

### Using Variables in Scripts

In workflow scripts, access and manage variables programmatically using the `maxim` API:

```javascript theme={null}
function prescript(request) {
  // Get variables from dataset or simulation context
  var inputQuery = maxim.getVariable("input");
  var userName = maxim.getVariable("user_name");
  
  // Set or modify variables during execution
  maxim.setVariable("sessionId", "unique-session-123");
  
  // Use variables in request modifications
  request.data = {
    query: inputQuery,
    metadata: {
      user: userName,
      timestamp: Date.now()
    }
  };
  
  return request;
}
```

### Managing Variables in the Editor

Configure and preview variables in the **Variables** tab of the HTTP endpoint editor. This tab shows all variables and lets you add values for single-turn tests and verify their usage in the endpoint.

<img src="https://mintcdn.com/maximai/s8BpyfQgbH5nrEFc/images/docs/evaluate/how-to/evaluate-workflows-via-api-endpoint/variable-editor/variable-editor.png?fit=max&auto=format&n=s8BpyfQgbH5nrEFc&q=85&s=c30388844bb5f3ba29a1051b352272af" alt="Variables in http endpoint" width="2022" height="730" data-path="images/docs/evaluate/how-to/evaluate-workflows-via-api-endpoint/variable-editor/variable-editor.png" />

## Test Your Endpoint

Send messages to your API from the **Messages** panel to test your endpoint with a conversational experience. See this demonstrated at the end of the video above.

## Map the Output for Evaluation

Before running tests, tell us what part of your response to evaluate by mapping an `output` from the response payload.

Click the `Test` button in the top right corner to open the **Test run** configuration panel. Select your **Output** from the dropdown of mappable response fields. View the full response payload by clicking `Show response`. Optionally, map the **Context to Evaluate** field using the **Context field** selector.

See how to map outputs for evaluation:

<MaximPlayer url="https://drive.google.com/file/d/1gQz4zF_Mmy-l10pyOStM-8wuxTbW6ms4/preview" />

<Warning>
  **Important**

  * The `Test` button remains disabled until you send messages to your endpoint. The system requires a response payload structure for `output` mapping.
  * When mapping without triggering a test run, save your endpoint explicitly. Map in the configuration sheet, click outside to close it, then click **Save endpoint**
</Warning>

## Test Multi-Turn Conversations

Real conversations create fascinating puzzles because:

* Testing single responses doesn't reveal the complete interaction pattern
* Just like human conversations, AI chats can take unexpected turns
* When something goes wrong, you need to replay the conversation - but what if you could change history?

These intriguing challenges make it crucial to test your AI's conversational abilities thoroughly before it faces real users.
Maxim solves this with an interactive Messages panel that lets you simulate, manipulate, and debug multi-turn conversations in real-time. Bring your application endpoint to create and test multi-turn conversations without any code integration.

### Configure Your Endpoint for Conversations

Before testing conversations, you need to configure your endpoint:

1. Enter your AI endpoint URL (e.g., `https://astronomy-ai.example.com/chat`)
2. Configure the request body
   ```json theme={null}
   {
     "query": "{{input}}"
   }
   ```
   Your application receives and processes messages correctly with this configuration.

### Start a Conversation

1. Type your initial message in the input field
2. Click Send to start the conversation

### Edit and Modify Conversations

You can manipulate the conversation to test different scenarios:

* **Delete Messages**: Remove any message from the conversation history to test how your AI handles modified contexts
* **Edit History**: Change previous messages to simulate different conversation paths

<img src="https://mintcdn.com/maximai/YdQNCf1tftKyYOR4/images/docs/evaluate/how-to/evaluate-workflows-via-api-endpoint/test-multi-turn-conversations-manually/manual-multi-turn-simulation.png?fit=max&auto=format&n=YdQNCf1tftKyYOR4&q=85&s=c2ee722b7d097b070f961842a99bb613" alt="Manual simulation" width="2312" height="1568" data-path="images/docs/evaluate/how-to/evaluate-workflows-via-api-endpoint/test-multi-turn-conversations-manually/manual-multi-turn-simulation.png" />

### Example Usage

Here's a typical endpoint for testing multi-turn conversations:

1. Start with a simple query:
   ```
   User: "How old is the universe?"
   AI: "The universe is estimated to be around 13.8 billion years old..."
   ```

2. Follow up with related questions:
   ```
   User: "What's the Big Bang theory?"
   AI: "The Big Bang theory explains the origin of the universe..."
   ```

By using the Messages panel effectively, you can ensure your AI endpoint handles multi-turn conversations reliably and maintains appropriate context throughout the interaction.

<Note>[Schedule a demo](https://getmaxim.ai/demo) to see how Maxim AI helps teams ship reliable agents.</Note>
