Skip to content

nextgenswitch/voice_agent

Repository files navigation

Voice Agent API

A multi-tenant Voice AI platform API built with Laravel and SQLite.

Requirements

  • PHP 8.2+
  • Composer
  • SQLite

Installation

composer install
cp .env.example .env
php artisan key:generate
php artisan migrate --seed

Getting Started

Organizations, users, and API keys are managed from the command line.

1. Create an Organization

php artisan org:create "My Company"

With options:

php artisan org:create "My Company" --plan=pro --billing=postpaid --region=us-east-1
Option Values Default
--plan free, starter, pro, enterprise free
--billing prepaid, postpaid prepaid
--region any string (none)

On success you'll see the organization ID — copy it for the next step.

2. Create a User

php artisan user:create admin@example.com "Admin User" --password=secret123

Attach the user to an organization:

php artisan user:create admin@example.com "Admin User" \
  --password=secret123 \
  --organization=<organization_id> \
  --role=owner

With options:

Option Values Default
--password any string, minimum 8 chars (prompt)
--status active, inactive, suspended active
--organization existing organization UUID (none)
--role owner, admin, member member
--member-status active, invited, disabled active

3. Generate an API Key

php artisan apikey:generate <organization_id>

Example:

php artisan apikey:generate 019cf778-2b49-73be-96af-3b126fb61e9c

With options:

php artisan apikey:generate <organization_id> --scope=read
Option Values Default
--scope full, read, sub_account full
--user_id existing user UUID (auto)

Store the token securely — it cannot be retrieved again.

4. Use the API

All API endpoints require the Authorization header:

curl -H "Authorization: Bearer va_xxxxx_xxxxx" \
     http://localhost:8000/api/v2/providers/catalog

5. List Organizations

php artisan tinker --execute="App\Models\Organization::all(['id','name','plan_code'])->toJson(JSON_PRETTY_PRINT)"

API Documentation

Start the dev server and visit the interactive docs:

php artisan serve

Open http://localhost:8000/docs/api in your browser.

The docs UI includes a Try It panel — paste your Bearer token to test endpoints directly.

Database Browser (phpMiniAdmin-like)

A built-in Adminer UI is available to browse tables/columns and edit rows.

You can change route/autologin with env variables:

ADMINER_ROUTE_PREFIX=db-admin
ADMINER_AUTO_LOGIN=true
ADMINER_ENABLED=true

About

AI voice Agent platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors