Skip to main content
This guide takes you from zero to a working AI agent answering and making real phone calls. You’ll need:

Step 1 - Get your API key

1

Sign in to the dashboard

Open dashboard.nixflex.com and sign in. An API key is created for your account automatically.
2

Reveal your key

Go to API Keys, click Reveal, and copy the full credential. It looks like:
nxf_a1b2c3...:nxfs_x1y2z3...
3

Use it in requests

Authenticate every API call with:
Authorization: Bearer nxf_xxx:nxfs_xxx
Treat your full credential like a password. Never commit it to source control or expose it in client-side code. If it leaks, rotate immediately from the dashboard.

Step 2 - Create an agent

An agent is the AI personality that answers calls. Each agent has a prompt, voice, language, and behaviour settings.
curl -X POST https://api.nixflex.com/v1/agents \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Test Receptionist",
    "system_prompt": "You are a friendly receptionist for Acme Dental. Greet callers, answer questions about opening hours (Mon-Fri 9am-5pm), and book appointments by collecting name and preferred date.",
    "welcome_message": "Hello, Acme Dental, how can I help?"
  }'
The response contains your agent_id:
{
  "agent_id": "agent_125207e452f8714a",
  "name": "Test Receptionist",
  "voice_id": "Ashley",
  "language": "multi",
  "is_active": true
}
Save the agent_id - you’ll attach a phone number to it next.
The default voice is Ashley and the default language is multi (auto-detects 15+ languages including Arabic, French, Spanish, German). Change them later via the dashboard or the Create agent reference.

Step 3 - Connect a Twilio number

Nixflex uses a BYO Twilio model. You import a number you already own in Twilio, and Nixflex configures the webhooks automatically.
curl -X POST https://api.nixflex.com/v1/phone-numbers \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+447446466847",
    "twilio_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "twilio_token": "your_twilio_auth_token",
    "agent_id": "agent_125207e452f8714a"
  }'
Nixflex points all webhooks on this Twilio number at the engine. The agent now answers when this number rings, and can use it to make outbound calls.

Step 4 - Test inbound

Call your Twilio number from any phone. The agent will:
  1. Pick up
  2. Say your welcome message
  3. Listen, respond, handle interruptions naturally
  4. Hang up when the conversation ends or when the caller stops talking

Step 5 - Test outbound

Have the agent call you. Replace the to_number with your mobile.
curl -X POST https://api.nixflex.com/v1/calls/outbound \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agent_125207e452f8714a",
    "to_number": "+44YOUR_MOBILE"
  }'
Your phone rings within seconds. Pick up and talk to your agent.
You don’t pass a from_number. The engine uses the Twilio number you assigned to the agent in Step 3.

Step 6 - Read the call back

After the call ends, pull the details:
curl https://api.nixflex.com/v1/calls?limit=1 \
  -H "Authorization: Bearer YOUR_KEY"
The response includes the transcript, recording URL, post-call summary, caller sentiment, and any custom data the agent extracted.

What’s next

Outbound calls

Trigger AI calls programmatically with one API request.

Agent actions

Let your agent transfer calls, send SMS, and end calls using prompt tags.

Webhooks

Receive post-call data in your own systems automatically.

Custom functions

Let the agent call your APIs mid-call (lookup, booking, payments).