Best Practices
Guidelines for building reliable, low-latency, and compliant integrations on the Voicebip platform.
Webhook Response Time
For BYOM (Bring Your Own Model) integrations, keep your webhook response time under 300ms. Your handler’s latency directly affects the caller’s experience.
- Pre-warm LLM connections. Initialize clients at startup, not per-request. Use connection pooling.
- Use streaming if your LLM supports it. Return the first sentence immediately rather than waiting for the full completion.
- Avoid database writes in the critical path. Respond first, then log asynchronously.
- Co-locate your server close to Voicebip’s API — EU or Africa regions are recommended for Nigerian traffic.
If your webhook handler takes more than 10 seconds to respond, Voicebip considers the delivery failed and begins the retry sequence. The caller hears a fallback message.
Nigerian Network Tips
Voicebip operates on NCC-licensed Nigerian carrier infrastructure. Understanding the MNO landscape helps you build more reliable voice and SMS integrations.
- MTN is the most reliable primary trunk. It has the highest call completion and SMS delivery rates nationwide.
- MNO failover is automatic with a 5-second budget. The failover chain is: MTN -> Glo -> Airtel -> 9mobile. Unknown prefixes default to MTN.
- Test with numbers from each MNO to ensure your application handles all carriers correctly.
DLR (delivery receipt) timing varies by MNO: MTN is typically under 5 seconds, while others can take up to 60 seconds. For time-sensitive notifications, prefer voice calls over SMS.
NDPR Compliance
Voicebip operates under Nigeria’s Data Protection Regulation (NDPR). Follow these practices to stay compliant.
Recording Consent
- Obtain consent before recording. When
recording_enabledis set totrueon an agent, Voicebip automatically plays a consent prompt and uses a DTMF flow: press 1 to consent, press 2 to opt out. No response within 10 seconds defaults to no recording. - Never enable
recording_enabledwithout a consent flow. Recording calls without consent violates NDPR.
STOP Opt-Outs
- Honor STOP opt-outs. When a recipient sends
STOPvia SMS or WhatsApp, Voicebip automatically adds them to the workspace opt-out list. This is automatic — subsequent message attempts return422 OPT_OUT_ENFORCED.
Data Retention
- Configure
retention_dayson your workspace to control how long call recordings and transcripts are stored across all agents. After the retention period, recordings and transcripts are permanently deleted.
Data Processing Agreement
- Accept the DPA. Under NDPR, processing Nigerian personal data requires adequate safeguards, explicit user consent, and a documented Data Protection Impact Assessment. Voicebip handles infrastructure-level safeguards; you are responsible for obtaining user consent in your application.
Error Handling
Check error_code in Responses
Every Voicebip API error response includes a structured error envelope. Always check error_code rather than parsing the message string.
Idempotent Webhook Handlers
Every webhook event includes a unique event_id. Use it to deduplicate events, since Voicebip’s retry mechanism (7 attempts with exponential backoff) may deliver the same event multiple times. The same event_id is used across all retries.
Handle 429 with Retry-After
When you receive an HTTP 429 response, read the Retry-After header and wait before retrying.
Latency Optimization
Use Hosted AI Mode for Sub-500ms Turns
If sub-500ms turn times are critical (e.g., interactive IVR, real-time customer support), use hosted AI mode. Voicebip runs the AI provider inside its own infrastructure, eliminating the webhook round-trip.
Minimize Webhook Handler Processing
For BYOM integrations, the voice pipeline is:
Every millisecond in your webhook handler adds to the caller’s wait time. Optimize by pre-warming LLM connections, using the conversation_history field (Voicebip sends the last 20 turns so you do not need a database lookup), and setting aggressive timeouts on your LLM calls.
Keep conversation_history Under 20 Turns
Voicebip automatically trims conversation history to the last 20 turns in every BYOM webhook event. This keeps payloads small and LLM context windows efficient. You do not need to manage history trimming yourself.
Consider Gemini Live for Real-Time Audio Streaming
For the absolute lowest latency, consider using Voicebip’s hosted AI mode with Gemini 2.0 Flash Live. This mode streams audio bidirectionally, bypassing the traditional STT -> LLM -> TTS pipeline entirely, enabling near-real-time conversational AI.