> ## Documentation Index
> Fetch the complete documentation index at: https://headlessagents.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart for Deployment

> Deploy an agent on Headless Agents with our quickstart guide

***

These steps will guide you through the process of deploying an agent on Headless Agents.

Before you get started, make sure you sign up for a Headless Agents account at [headlessagents.ai](https://headlessagents.ai).

***

## Navigate to the deploy module

Navigate from the dashboard to the [deploy](https://headlessagents.ai/dashboard/deploy) module.

## Select your deployment type

Select the type of agent you want to deploy:

<AccordionGroup>
  <Accordion icon="house" title="Platform Deployment" defaultOpen={true}>
    Deploy an agent built on another platform or server using webhooks or HTTP requests. Skip to our [Platform Deployment Quickstart](/quickstart_deployment#platform-deployment-quickstart) to get started.
  </Accordion>

  <Accordion icon="browser" title="Standard Deployment" defaultOpen={true}>
    Create a new agent on Headless Agents. <br />Skip to our [Standard Deployment Quickstart](/quickstart_deployment#standard-deployment-quickstart) to get started.
  </Accordion>
</AccordionGroup>

## Platform Deployment Quickstart

Deploy an agent built on another platform or server using HTTP requests. Our AI-assisted platform deployment module makes it easy to deploy from any API-based service.

### 1. Navigate to the [deploy](https://headlessagents.ai/dashboard/deploy) module and select <code>platform</code> from the deployment selector.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/platform.png" alt="Platform Selection" width="150" />

### 2. Copy the HTTP request from your platform's documentation or API reference.

For example:

```bash
curl -X POST 'https://api.yourplatform.com/v1/agent/call' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"input": {"prompt": "Hello, world!", "style": "classic"}}'
```

<Tip>
  You can leave the <code>YOUR\_API\_KEY</code> placeholder in the HTTP request. We'll use the secrets manager to handle the authentication during the setup process.
</Tip>

<Tip>
  Ensure you have the fields configured the way you want them to be called by the agent, users calling the agent will only be able to pass through a single placeholder field. <br /> <br /> In this example, <code style={{color: '#0071e6', fontWeight: 'bold'}}>prompt</code> is likley the field that you will want to map the user input to, in that case the <code style={{color: '#0071e6', fontWeight: 'bold'}}>style</code> field will be continue to be set to <code>classic</code>. <br /> <br /> This will be configured during the setup process.
</Tip>

### 3. Begin deployment with the Deployment Assistant

<Steps>
  <Step title="Paste API details">
    Paste the HTTP request from your platform into the deployment assistant. The assistant will automatically parse all necessary requirements to call your agent headlessly.

    ```bash
    curl -X POST 'https://api.yourplatform.com/v1/agent/call' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{"input": {"prompt": "Hello, world!", "style": "classic"}}'
    ```
  </Step>

  <Step title="Import an API key from the Secrets Manager">
    If your request requires authentication, the deployment assistant will ask you to import an API key from the [Secrets Manager](https://headlessagents.ai/dashboard/secrets).

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/import_api_key.png" alt="Import API Key" width="500" />
  </Step>

  <Step title="Test the connection">
    The deployment assistant will ask for permission to send a test request to verify the connection. This ensures your API key and configuration are working correctly.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/test_connection.png" alt="Test Connection" width="500" />

    You'll see a success message when the test is complete, confirming that your external agent is accessible.
  </Step>

  <Step title="Configure request placeholder mapping">
    After a successful test, the deployment assistant will ask you to map the user's input to the correct parameter in your API request.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/request_notification.png" alt="Configure Request Placeholder Mapping" width="500" />

    This is where you will specify where the user's input will be passed through.

    When the user sends a prompt to your agent, the prompt will be replace the <br />
    <code style={{color: '#FFFFFF', fontWeight: 'bold', backgroundColor: '#db5700', padding: '2px 4px'}}>User Input</code> field in your API request.

    Click the field you want to replace or drag the <code style={{color: '#FFFFFF', fontWeight: 'bold', backgroundColor: '#db5700', padding: '2px 4px'}}>User Input</code> placeholder to the correct value position in your API request.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/request_placeholder.png" alt="Configure Request Placeholder Mapping" width="500" />
  </Step>

  <Step title="Test user input">
    Next, you'll be asked to run another test, but this time with a sample user input passing through.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/test_user_input_notification.png" alt="Test User Input" width="500" />

    Enter a sample prompt to replace the <code style={{color: '#FFFFFF', fontWeight: 'bold', backgroundColor: '#db5700', padding: '2px 4px'}}>User Input</code> placeholder in the test.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/enter_user_input_box.png" alt="Test User Input" width="300" />

    The deployment assistant will send another test to ensure everything is working as expected.
  </Step>

  <Step title="Configure response handling">
    After a successful test, the deployment assistant will ask you to specify what part of the API response you want to return to the user.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/configure_response_notification.png" alt="Configure Response Handling" width="500" />

    This ensures users receive only the relevant information from your agent.

    Click the field you want to return to the user in the <code style={{color: '#00B5B5', fontWeight: 'bold'}}>response</code> field of the agents response.

    You can return a single field:

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/single_field_response.png" alt="Single Field Response" width="500" />

    Or select multiple fields to return:

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/multi_field_response.png" alt="Multi Field Response" width="500" />
  </Step>

  <Step title="Add a name and description">
    Finally, add a name and description for your agent.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/enter_name.png" alt="Enter Name" width="500" />

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/enter_description.png" alt="Enter Description" width="500" />
  </Step>

  <Step title="Deploy your agent">
    Your agent is now ready to be deployed. Click <code style={{color: '#FFFFFF', fontWeight: 'bold', backgroundColor: '#00B74A', padding: '2px 4px'}}>Deploy</code>!

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/deploy_request.png" alt="Deploy Request" width="500" />

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/deploy_success.png" alt="Deploy Success" width="500" />

    Go to the [dashboard](https://headlessagents.ai/dashboard) to view your deployed agent.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/headlessagents/images/deployed_agent.png" alt="Deployed Agent" width="500" />
  </Step>
</Steps>

**Congratulations! You've deployed your platform agent.**

Your agent is now available anywhere!

***

## Standard Deployment Quickstart

We reccomend you deploy one of our pre-built templates to get started. You can deploy the agent in just three clicks from the [deploy module](https://headlessagents.ai/dashboard/deploy).

**1. Select a template from the dropdown menu.**

**2. Test the function provided to the agent, this function will serve as a tool your agent can call if it chooses to.**

<Accordion icon="code" title="Function Notes" defaultOpen={true}>
  * Agents built on Headless Agents can call python functions. Head over to the [Function Guide](/quickstart_deployment#function-guide) to learn more about function calling on Headless Agents.
  * When the agent calls a function, it runs in a secure, cloud-based sandbox.
  * If your function requires authentication, like an API key, add it to the [Secrets Manager](https://headlessagents.ai/dashboard/secrets) and it will be used by the agent when the function is called.
  * Visit the [Secrets Manager Guide](/dashboard/secrets) to learn more about how agents work with secrets.
</Accordion>

**3. When the function test is successful, click 'Deploy Agent'!**
<br /> *Note: If the function test is not successful, you can edit the function and try again.*

**Congratulations! You've deployed your first agent.**

Head over to the [Call Agent Guide](/quickstart_deployment#call-agent-guide) to learn how to call your agent.

To learn more, read the full guide: [Standard Deployment Guide](/quickstart_deployment#standard-deployment-guide).

***
