Skip to main content

Getting Started

Follow these steps to start using Headless Agents in your application.

1. Get Your API Key

Sign up for a Headless Agents account at headlessagents.ai. Once registered, you’ll be able to access api keys on the profile page.
  1. Navigate to the API Keys section in your dashboard
  2. Click “Create New API Key”
  3. Save your API key securely - you won’t be able to see it again!
# Example of using your API key
curl -H "X-API-Key: your_api_key" https://api.headlessagents.ai/health

2. Make Your First API Call

Start by testing the health check endpoint to ensure everything is working:
curl https://api.headlessagents.ai/health
You should receive:
{
  "status": "healthy"
}
Now let’s make your first call to an agent:
curl -X POST \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"request": "Hello, how are you?"}' \
  https://api.headlessagents.ai/call/your_agent_id
You should receive a response like:
{
  "thread_id": "50cc9455b84d48ffad6b4c9fd41b561e",
  "conversation_id": "bc8e506e4a6f49ad",
  "agent_id": "your_agent_id",
  "success": true,
  "response": "Hi there! How can I help you today?",
  "function_result": null
}

3. Integration Examples

Python

import requests

API_KEY = 'your_api_key'
AGENT_ID = 'your_agent_id'

response = requests.post(
    f'https://api.headlessagents.ai/call/{AGENT_ID}',
    headers={'X-API-Key': API_KEY},
    json={'request': 'Hello!'}
)
print(response.json())

JavaScript

const response = await fetch(
  `https://api.headlessagents.ai/call/${agentId}`,
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'your_api_key',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      request: 'Hello!'
    }),
  }
);
const data = await response.json();

Next Steps

Now that you’ve made your first API call, explore these resources to learn more: