Foreva AI
Foreva AI Developer Portal

SDK Quick Start Guide

Build your first restaurant voice agent in 5 minutes

Before You Begin

  • Python 3.8+ installed on your system
  • Your Foreva AI API key (get it from your dashboard)
  • Basic knowledge of Python programming
1

Install the SDK

Install the Foreva AI SDK using pip:

Terminal
$ pip install foreva-ai

Note: The SDK will be published to PyPI once ready. For now, you can install from our private repository.

2

Configure Your API Key

Set up your API key for authentication:

Python
from foreva_ai import ForevaClient

# Initialize the client with your API key
client = ForevaClient(api_key="your-api-key-here")

# Or set as environment variable
# export FOREVA_API_KEY="your-api-key-here"
# client = ForevaClient()  # Will use env var
3

Create Your First Voice Agent

Create a simple restaurant ordering agent:

Python
from foreva_ai import ForevaClient, Agent

# Initialize client
client = ForevaClient(api_key="your-api-key-here")

# Create a new agent
agent = client.create_agent(
    name="Mario's Pizza Assistant",
    restaurant_type="italian",
    phone_number="+1-555-PIZZA-01",
    menu_items=[
        {
            "name": "Margherita Pizza",
            "price": 18.99,
            "description": "Fresh mozzarella, basil, tomato sauce"
        },
        {
            "name": "Pepperoni Pizza", 
            "price": 21.99,
            "description": "Pepperoni, mozzarella, tomato sauce"
        }
    ],
    business_hours={
        "monday": {"open": "11:00", "close": "22:00"},
        "tuesday": {"open": "11:00", "close": "22:00"},
        # ... other days
    }
)

print(f"Agent created! ID: {agent.id}")
print(f"Phone number: {agent.phone_number}")
4

Configure Agent Behavior

Customize how your agent handles calls:

Python
# Update agent configuration
agent.update_config(
    greeting="Hello! Thank you for calling Mario's Pizza. How can I help you today?",
    voice_style="friendly",
    language="en-US",
    max_call_duration=300,  # 5 minutes
    enable_ordering=True,
    enable_reservations=False,
    custom_prompts={
        "upsell": "Would you like to add garlic bread for just $4.99?",
        "closing": "Thank you for choosing Mario's! Your order will be ready in 20-25 minutes."
    }
)

print("Agent configuration updated!")
5

Test Your Agent

Test your agent before going live:

Python
# Start a test call simulation
test_call = agent.simulate_call(
    customer_input="Hi, I'd like to order a large pepperoni pizza"
)

print(f"Agent response: {test_call.agent_response}")
print(f"Detected intent: {test_call.intent}")
print(f"Extracted order: {test_call.order_details}")

# Get call analytics
analytics = agent.get_analytics(days=7)
print(f"Total calls: {analytics.total_calls}")
print(f"Successful orders: {analytics.successful_orders}")
print(f"Average call duration: {analytics.avg_duration}")

🎉 Congratulations!

You've successfully created your first voice agent. Here's what to do next:

📞 Go Live

Ready for production? Contact sales to enable live mode and get a real phone number.

📊 Monitor Usage

Check your dashboard to monitor API usage and agent performance.

💬 Get Support

Join our community or email us at support@foreva.ai

🔧 Advanced Features

Explore integrations, webhooks, and custom voice training options.

Additional Resources

SDK Reference

Complete documentation for all SDK methods and classes.

Coming Soon →

Example Projects

Full working examples for different restaurant types.

View Examples →

Integration Guides

Connect with POS systems, payment providers, and more.

Learn More →