Skip to main content
The ThreeTone API provides a simple interface to state-of-the-art voice AI capabilities. Follow this guide to learn how to create your first voice agent with our Voice Agents API. See the developer guides for more examples with our other features.

Authentication

All API requests require authentication using an API key in the x-api-key header.

Get your API key

  1. Create an account: Sign up at dashboard.threetone.com
  2. Generate API key: Navigate to Settings → API Keys and create a new key
  3. Store securely: Save your API key securely - it will only be shown once

Using the Voice Agents API

Create your first agent

cURL
curl --request POST \
  --url https://api.threetone.com/v1/voiceai/agents \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Customer Support Agent",
    "agent_type": "business",
    "system_prompt": "You are a helpful customer support representative.",
    "temperature": 0.7
  }'
Python
import requests

url = "https://api.threetone.com/v1/voiceai/agents"
headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "name": "Customer Support Agent",
    "agent_type": "business",
    "system_prompt": "You are a helpful customer support representative.",
    "temperature": 0.7
}

response = requests.post(url, headers=headers, json=data)
agent = response.json()
print(f"Created agent: {agent['id']}")
JavaScript
const response = await fetch("https://api.threetone.com/v1/voiceai/agents", {
  method: "POST",
  headers: {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Customer Support Agent",
    agent_type: "business",
    system_prompt: "You are a helpful customer support representative.",
    temperature: 0.7,
  }),
});

const agent = await response.json();
console.log(`Created agent: ${agent.id}`);

Response

{
  "id": "agent_abc123xyz",
  "name": "Customer Support Agent",
  "agent_type": "business",
  "status": "active",
  "created_at": "2024-01-15T10:30:00Z"
}

Next steps

Explore our developer guides

Additional resources

Security best practices

  • Always use HTTPS endpoints for API requests
  • Store API keys securely using environment variables
  • Never commit API keys to version control
  • Rotate API keys regularly for enhanced security