### Install and Run Mintlify CLI for Local Preview
Source: https://github.com/openmicai/mintlify-docs/blob/main/quickstart.mdx
This snippet shows how to install the Mintlify CLI globally using npm and then run the development server to preview documentation changes locally. Ensure you are in the root of your documentation directory where 'mint.json' is located.
```bash
npm i -g mintlify
mintlify dev
```
--------------------------------
### Start Local Development Server
Source: https://github.com/openmicai/mintlify-docs/blob/main/development.mdx
Starts the Mintlify local development server. Navigate to your docs directory (containing mint.json) and run this command. The documentation will be available at http://localhost:3000.
```bash
mintlify dev
```
--------------------------------
### Install Mintlify CLI (npm/yarn)
Source: https://github.com/openmicai/mintlify-docs/blob/main/development.mdx
Installs the Mintlify CLI globally using either npm or yarn package managers. Ensure Node.js version 18.10.0 or higher is installed.
```bash
npm i -g mintlify
```
```bash
yarn global add mintlify
```
--------------------------------
### Start Local Development Server on Custom Port
Source: https://github.com/openmicai/mintlify-docs/blob/main/development.mdx
Starts the Mintlify local development server on a custom port. Use the --port flag followed by the desired port number. This is useful if the default port 3000 is already in use.
```bash
mintlify dev --port 3333
```
--------------------------------
### Embed Arcade Demo for Warm Call Transfer Setup (Simple Agents)
Source: https://github.com/openmicai/mintlify-docs/blob/main/tutorials/features/warm-call-transfer.mdx
Embeds an interactive demo from Arcade Software to showcase the setup of a warm call transfer with custom handoff in OpenMic Bot. This is specifically for users setting up simple agents.
```jsx
import { ArcadeEmbed } from '/snippets/ArcadeEmbed.jsx'
```
--------------------------------
### Embed Arcade Demo for Warm Call Transfer Setup (Workflow Agents)
Source: https://github.com/openmicai/mintlify-docs/blob/main/tutorials/features/warm-call-transfer.mdx
Embeds an interactive demo from Arcade Software to demonstrate configuring a warm transfer step within an AI workflow. This is intended for users working with workflow agents.
```jsx
import { ArcadeEmbed } from '/snippets/ArcadeEmbed.jsx'
```
--------------------------------
### Example JSON Response for Empty Dynamic Variables
Source: https://github.com/openmicai/mintlify-docs/blob/main/pre-call-webhook.mdx
This JSON structure represents an example response to be sent when a webhook fails on its final attempt. By returning an empty object for `dynamic_variables`, the call can continue without injected variables, preventing conversation termination due to missing data.
```json
{
"call": {
"dynamic_variables": {}
}
}
```
--------------------------------
### Get Call Details (Bash)
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Retrieves detailed information about a specific call, including transcript, recording URL, latency metrics, cost breakdown, and AI analysis. Requires an API key for authorization.
```bash
curl -X GET "https://api.openmic.ai/v1/call/cmbbvrg8wzi487w02m2bc7dji" \
-H "Authorization: Bearer YOUR_API_KEY"
```
--------------------------------
### Get Bot Details - REST API
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Retrieves the detailed configuration of a specific AI voice agent using its unique identifier (UID). Requires an API key for authentication.
```bash
curl -X GET "https://api.openmic.ai/v1/bots/bvrg8wzi487w02m2bc7dh0ev" \
-H "Authorization: Bearer YOUR_API_KEY"
```
--------------------------------
### Pre-tool Webhook Failure Handling (JavaScript)
Source: https://github.com/openmicai/mintlify-docs/blob/main/pre-tool-webhook.mdx
This JavaScript example demonstrates how to handle failures in a pre-tool webhook. It includes a function to look up transfer numbers and an Express.js route handler that manages successful responses and graceful degradation on error. The webhook returns dynamic variables for tool customization or an empty object if an error occurs.
```javascript
async function getTransferNumber(fromNumber) {
// Pretend we're fetching from a transfer number lookup API
console.log(`Looking up transfer number for: ${fromNumber}`);
return {
transfer_number: '+1234567890' // match variable name from docs
};
}
app.post('/webhook/pre-tool', async (req, res) => {
const { tool_name, tool } = req.body;
console.log(`🔧 Pre-tool webhook for: ${tool_name}`, tool);
try {
if (tool_name === 'transfer_call') {
const transferNumber = await getTransferNumber(tool.from_number);
return res.json({
tool: {
dynamic_variables: transferNumber
}
});
}
// Default: no customization for other tools
return res.json({
tool: {
dynamic_variables: {}
}
});
} catch (err) {
console.error('❌ Failed to fetch tool data', err);
// Graceful degradation: return empty vars if lookup fails
return res.json({
tool: {
dynamic_variables: {}
}
});
}
});
```
--------------------------------
### Pre-Call Webhook Success Response Example (JSON)
Source: https://github.com/openmicai/mintlify-docs/blob/main/pre-call-webhook.mdx
This JSON response is what your webhook should return to Openmic upon successful processing of a pre-call webhook request. It includes a customer ID and dynamic variables to personalize the call.
```json
{
"call": {
"customer_id": "cus_001",
"dynamic_variables": {
"customer_name": "John Doe",
"account_balance": "1,250.50",
"subscription_status": "premium",
"last_purchase_date": "2024-07-15",
"support_tier": "gold",
"preferred_language": "english"
}
}
}
```
--------------------------------
### Initialize Client and Create Bot (Python SDK)
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Demonstrates how to initialize both synchronous and asynchronous clients using the OpenMic Python SDK and create a new bot with extensive configuration options. This includes setting up voice, LLM, STT, call settings, and advanced agent behaviors.
```python
from openmic import OpenmicApi, AsyncOpenmicApi
from openmic.types import CreateBotRequest, CallSettings, AdvancedSettings, PostCallSettings
# Initialize synchronous client
client = OpenmicApi(token="YOUR_API_KEY")
# Create a new bot with full configuration
bot = client.bots.create(
name="Sales Assistant",
prompt="""You are a professional sales assistant for Acme Corp.
Help customers understand our products and schedule consultations.
Be friendly, knowledgeable, and helpful.""",
first_message="Hi there! Thanks for calling Acme Corp. How can I help you today?",
voice_provider="OpenAI",
voice="alloy",
voice_model="tts-1",
voice_speed=1.0,
llm_model_name="gpt-4",
llm_model_temperature=0.7,
stt_provider="Deepgram",
stt_model="nova-2",
call_settings=CallSettings(
max_call_duration=15,
silence_timeout=20,
silence_timeout_max_retries=3,
call_recording_enabled=True,
voicemail_detection_enabled=True,
voicemail_action="leave_message",
voicemail_message="Hi, this is Acme Corp calling. Please call us back at your convenience."
),
advanced_settings=AdvancedSettings(
agent_personality="friendly",
humanize_conversation=True,
allow_interruptions=True,
agent_response_length="normal"
),
post_call_settings=PostCallSettings(
summary_prompt="Summarize the key points discussed and any follow-up actions needed.",
success_evaluation_prompt="Rate how well the sales conversation went.",
success_evaluation_rubric_type="DESCRIPTIVE_SCALE"
)
)
print(f"Created bot: {bot.uid}")
# List all bots
bots_response = client.bots.list(limit=10)
for b in bots_response.bots:
print(f"Bot: {b.name} (ID: {b.uid})")
# Async example
async def create_bot_async():
async_client = AsyncOpenmicApi(token="YOUR_API_KEY")
bot = await async_client.bots.create(
name="Async Support Bot",
prompt="You are a helpful support assistant."
)
return bot
```
--------------------------------
### Initialize Client, Create, List, Update, and Delete Bots (TypeScript)
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Demonstrates how to initialize the OpenmicApiClient in TypeScript, create a new bot with various configuration options (voice, LLM, STT, call settings), list existing bots with pagination, update a bot's configuration, and delete a bot. Requires the @openmic/sdk package.
```typescript
import { OpenmicApiClient } from "@openmic/sdk";
const client = new OpenmicApiClient({
token: "YOUR_API_KEY",
});
// Create a new bot
const bot = await client.bots.create({
name: "Customer Service Bot",
prompt: `You are a helpful customer service representative for TechCorp.
Help customers with product inquiries, troubleshooting, and account questions.
Be patient, empathetic, and solution-oriented.`,
firstMessage: "Hello! Thank you for calling TechCorp. How may I assist you today?",
voiceProvider: "OpenAI",
voice: "nova",
voiceModel: "tts-1",
voiceSpeed: 1.0,
llmModelName: "gpt-4",
llmModelTemperature: 0.7,
sttProvider: "Deepgram",
sttModel: "nova-2",
callSettings: {
maxCallDuration: 15,
silenceTimeout: 20,
silenceTimeoutMaxRetries: 3,
callRecordingEnabled: true,
voicemailDetectionEnabled: true,
voicemailAction: "leave_message",
voicemailMessageType: "static",
voicemailMessage: "Hi, this is TechCorp. Please call us back when you're available."
},
advancedSettings: {
agentPersonality: "friendly",
humanizeConversation: true,
allowInterruptions: true,
agentResponseLength: "normal"
},
postCallSettings: {
summaryPrompt: "Summarize the customer issue and resolution provided.",
successEvaluationPrompt: "Rate customer satisfaction on a scale of 1-10.",
successEvaluationRubricType: "NUMERIC_SCALE"
}
});
console.log(`Created bot: ${bot.uid}`);
// List bots with pagination
const botsResponse = await client.bots.list({ limit: 10, offset: 0 });
for (const b of botsResponse.bots) {
console.log(`Bot: ${b.name} (${b.uid})`);
}
// Update bot configuration
const updatedBot = await client.bots.update("bvrg8wzi487w02m2bc7dh0ev", {
name: "Updated Service Bot",
llmModelTemperature: 0.8
});
// Delete bot
await client.bots.delete("bvrg8wzi487w02m2bc7dh0ev");
```
--------------------------------
### API Reference: Initiate Call (Bash)
Source: https://github.com/openmicai/mintlify-docs/blob/main/introduction.mdx
This snippet demonstrates how to initiate a call using the Openmic API via a `curl` command. It requires an API key for authentication and specifies the endpoint for initiating a call.
```bash
curl -X POST https://api.openmic.com/v1/initiate-call \
-H "Authorization: Bearer YOUR_API_KEY"
```
--------------------------------
### Get Bot
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Retrieves detailed configuration of a specific bot by its unique identifier.
```APIDOC
## GET /v1/bots/{bot_uid}
### Description
Retrieves detailed configuration of a specific bot by its unique identifier.
### Method
GET
### Endpoint
/v1/bots/{bot_uid}
### Parameters
#### Path Parameters
- **bot_uid** (string) - Required - The unique identifier of the bot to retrieve.
### Response
#### Success Response (200 OK)
- **uid** (string) - The unique identifier for the bot.
- **name** (string) - The name of the bot.
- **prompt** (string) - The system prompt for the AI agent.
- **first_message** (string) - The initial message the bot will say.
- **voice_provider** (string) - The provider for the text-to-speech service.
- **voice** (string) - The specific voice to use.
- **voice_model** (string) - The TTS model used.
- **voice_speed** (number) - The speaking speed of the voice.
- **llm_model_name** (string) - The name of the large language model used.
- **llm_model_temperature** (number) - The temperature setting for the LLM.
- **call_settings** (object) - Configuration for call behavior.
- **advanced_settings** (object) - Advanced AI agent settings.
- **post_call_settings** (object) - Settings for post-call analysis.
- **created_at** (string) - Timestamp of creation.
- **updated_at** (string) - Timestamp of last update.
#### Response Example
```json
{
"uid": "bvrg8wzi487w02m2bc7dh0ev",
"name": "Customer Support Bot",
"prompt": "You are a helpful customer support assistant...",
"first_message": "Hello! I'm here to help you...",
"voice_provider": "OpenAI",
"voice": "alloy",
"voice_model": "tts-1",
"voice_speed": 1.0,
"llm_model_name": "gpt-4",
"llm_model_temperature": 0.7,
"call_settings": { ... },
"advanced_settings": { ... },
"post_call_settings": { ... },
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
```
```
--------------------------------
### Make Outbound Calls (Python SDK)
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Shows how to initiate outbound calls using the OpenMic Python SDK. This includes specifying sender and receiver numbers, an agent to handle the call, customer information, dynamic variables for personalization, and a callback URL for status updates.
```python
from openmic import OpenmicApi
client = OpenmicApi(token="YOUR_API_KEY")
# Create an outbound call with dynamic variables
call = client.calls.create(
from_number="+15551234567", # Your OpenMic number
to_number="+15559876543", # Destination number
override_agent_id="bvrg8wzi487w02m2bc7dh0ev",
customer_id="cust_12345",
dynamic_variables={
"name": "Sarah Johnson",
"appointment_date": "March 15th at 3 PM",
"service_type": "Premium Consultation"
},
callback_url="https://yourapp.com/webhooks/call-status"
)
print(f"Call initiated: {call.call_id}")
print(f"Status: {call.call_status}")
```
--------------------------------
### Get Call
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Retrieves detailed information about a specific call including transcript, recording URL, latency metrics, cost breakdown, and AI analysis.
```APIDOC
## GET /v1/call/{call_id}
### Description
Retrieves detailed information about a specific call including transcript, recording URL, latency metrics, cost breakdown, and AI analysis.
### Method
GET
### Endpoint
`/v1/call/{call_id}`
### Parameters
#### Path Parameters
- **call_id** (string) - Required - The unique identifier of the call to retrieve.
### Response
#### Success Response (200 OK)
- **call_type** (string) - The type of call.
- **from_number** (string) - The originating phone number.
- **to_number** (string) - The destination phone number.
- **direction** (string) - The direction of the call.
- **call_id** (string) - The unique identifier for the call.
- **agent_id** (string) - The ID of the bot used for the call.
- **call_status** (string) - The final status of the call.
- **customer_id** (string) - The customer identifier, if provided.
- **start_timestamp** (integer) - The Unix timestamp when the call started.
- **end_timestamp** (integer) - The Unix timestamp when the call ended.
- **duration_ms** (integer) - The duration of the call in milliseconds.
- **transcript** (array) - An array of conversation turns, each with a speaker and their utterance.
- **recording_url** (string) - URL to the call recording.
- **latency** (object) - Latency metrics for the call.
- **e2e_min_latency** (number) - Minimum end-to-end latency.
- **e2e_median_latency** (number) - Median end-to-end latency.
- **e2e_p90_latency** (number) - 90th percentile end-to-end latency.
- **llm_min_latency** (number) - Minimum LLM processing latency.
- **llm_median_latency** (number) - Median LLM processing latency.
- **tts_min_latency** (number) - Minimum TTS processing latency.
- **tts_median_latency** (number) - Median TTS processing latency.
- **call_analysis** (object) - AI analysis of the call.
- **summary** (string) - A summary of the conversation.
- **is_successful** (boolean) - Whether the call was considered successful.
- **success_evaluation** (string) - An evaluation of the call's success.
- **call_cost** (object) - Cost breakdown for the call.
- **total_cost** (number) - Total cost of the call.
- **llm_cost** (number) - Cost attributed to LLM processing.
- **tts_cost** (number) - Cost attributed to Text-to-Speech.
- **stt_cost** (number) - Cost attributed to Speech-to-Text.
#### Response Example
```json
{
"call_type": "phonecall",
"from_number": "+15551234567",
"to_number": "+15559876543",
"direction": "outbound",
"call_id": "cmbbvrg8wzi487w02m2bc7dji",
"agent_id": "bvrg8wzi487w02m2bc7dh0ev",
"call_status": "ended",
"customer_id": "customer_12345",
"start_timestamp": 1678886400000,
"end_timestamp": 1678886700000,
"duration_ms": 300000,
"transcript": [
["assistant", "Hello John! How can I help you today?"],
["user", "I'd like to schedule an appointment."],
["assistant", "I'd be happy to help you schedule an appointment. What date works for you?"]
],
"recording_url": "https://recordings.openmic.ai/call_98765.mp3",
"latency": {
"e2e_min_latency": 0.5,
"e2e_median_latency": 1.2,
"e2e_p90_latency": 2.1,
"llm_min_latency": 0.3,
"llm_median_latency": 0.8,
"tts_min_latency": 0.2,
"tts_median_latency": 0.4
},
"call_analysis": {
"summary": "Customer called to schedule an appointment and was successfully assisted.",
"is_successful": true,
"success_evaluation": "excellent"
},
"call_cost": {
"total_cost": 0.0822,
"llm_cost": 0.0053,
"tts_cost": 0.0242,
"stt_cost": 0.0527
}
}
```
```
--------------------------------
### Create Bot
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Creates a new AI voice agent with specified configuration including voice provider, LLM model, call settings, and post-call analysis options.
```APIDOC
## POST /v1/bots
### Description
Creates a new AI voice agent with specified configuration including voice provider, LLM model, call settings, and post-call analysis options.
### Method
POST
### Endpoint
/v1/bots
### Parameters
#### Request Body
- **name** (string) - Required - The name of the bot.
- **prompt** (string) - Required - The system prompt for the AI agent.
- **first_message** (string) - Optional - The initial message the bot will say.
- **voice_provider** (string) - Required - The provider for the text-to-speech service (e.g., "OpenAI").
- **voice** (string) - Required - The specific voice to use from the provider (e.g., "alloy").
- **voice_model** (string) - Optional - The TTS model to use (e.g., "tts-1").
- **voice_speed** (number) - Optional - The speaking speed of the voice (default: 1.0).
- **llm_model_name** (string) - Required - The name of the large language model to use (e.g., "gpt-4").
- **llm_model_temperature** (number) - Optional - The temperature setting for the LLM (default: 0.7).
- **stt_provider** (string) - Optional - The provider for the speech-to-text service (e.g., "Deepgram").
- **stt_model** (string) - Optional - The STT model to use (e.g., "nova-2").
- **call_settings** (object) - Optional - Configuration for call behavior.
- **max_call_duration** (integer) - Optional - Maximum duration of the call in seconds.
- **silence_timeout** (integer) - Optional - Timeout in seconds for detecting silence.
- **silence_timeout_max_retries** (integer) - Optional - Maximum retries for silence timeout.
- **silence_timeout_message** (string) - Optional - Message to play when silence is detected.
- **call_recording_enabled** (boolean) - Optional - Whether to enable call recording.
- **voicemail_detection_enabled** (boolean) - Optional - Whether to enable voicemail detection.
- **voicemail_action** (string) - Optional - Action to take when voicemail is detected (e.g., "leave_message").
- **voicemail_message_type** (string) - Optional - Type of voicemail message (e.g., "static").
- **voicemail_message** (string) - Optional - The static voicemail message.
- **advanced_settings** (object) - Optional - Advanced AI agent settings.
- **agent_personality** (string) - Optional - Personality of the agent (e.g., "friendly").
- **humanize_conversation** (boolean) - Optional - Whether to humanize the conversation.
- **allow_interruptions** (boolean) - Optional - Whether to allow interruptions.
- **agent_response_length** (string) - Optional - Desired length of agent responses (e.g., "normal").
- **post_call_settings** (object) - Optional - Settings for post-call analysis.
- **summary_prompt** (string) - Optional - Prompt for generating call summaries.
- **success_evaluation_prompt** (string) - Optional - Prompt for evaluating call success.
- **success_evaluation_rubric_type** (string) - Optional - Type of rubric for success evaluation (e.g., "NUMERIC_SCALE").
### Request Example
```json
{
"name": "Customer Support Bot",
"prompt": "You are a helpful customer support assistant. Be polite, professional, and always try to resolve customer issues.",
"first_message": "Hello! I'm here to help you with any questions or concerns. How can I assist you today?",
"voice_provider": "OpenAI",
"voice": "alloy",
"voice_model": "tts-1",
"voice_speed": 1.0,
"llm_model_name": "gpt-4",
"llm_model_temperature": 0.7,
"stt_provider": "Deepgram",
"stt_model": "nova-2",
"call_settings": {
"max_call_duration": 10,
"silence_timeout": 15,
"silence_timeout_max_retries": 3,
"silence_timeout_message": "I didn't hear anything. Are you still there?",
"call_recording_enabled": true,
"voicemail_detection_enabled": true,
"voicemail_action": "leave_message",
"voicemail_message_type": "static",
"voicemail_message": "Hey, sorry we couldn't reach you directly. Please give us a callback."
},
"advanced_settings": {
"agent_personality": "friendly",
"humanize_conversation": true,
"allow_interruptions": true,
"agent_response_length": "normal"
},
"post_call_settings": {
"summary_prompt": "Provide a brief summary of the customer interaction and any action items.",
"success_evaluation_prompt": "Rate the success of this call based on customer satisfaction.",
"success_evaluation_rubric_type": "NUMERIC_SCALE"
}
}
```
### Response
#### Success Response (201 Created)
- **uid** (string) - The unique identifier for the created bot.
- **name** (string) - The name of the bot.
- **prompt** (string) - The system prompt for the AI agent.
- **created_at** (string) - Timestamp of creation.
- **updated_at** (string) - Timestamp of last update.
#### Response Example
```json
{
"uid": "bvrg8wzi487w02m2bc7dh0ev",
"name": "Customer Support Bot",
"prompt": "You are a helpful customer support assistant...",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
```
```
--------------------------------
### Pre-Call Webhook Request Payload Example (JSON)
Source: https://github.com/openmicai/mintlify-docs/blob/main/pre-call-webhook.mdx
This JSON payload represents the data sent by Openmic to your webhook endpoint when a pre-call webhook is triggered. It includes details about the call event and its properties.
```json
{
"event": "call",
"call": {
"direction": "outbound",
"bot_id": "cmdx5w8oc0005q671s3cbg063",
"from_number": "+16167948654",
"to_number": "+916297653534",
"attempt": "2"
}
}
```
--------------------------------
### Failed Call Payload Example (JSON)
Source: https://github.com/openmicai/mintlify-docs/blob/main/post-call-webhook.mdx
This JSON object illustrates a failed call report payload. It contains essential information but may have an empty transcript and a summary indicating the reason for failure.
```json
{
"type": "end-of-call-report",
"sessionId": "cmdx5ozq60001q671n1vyoepy",
"toPhoneNumber": "+916297653534",
"fromPhoneNumber": "+16167948654",
"callType": "phonecall",
"disconnectionReason": "user_ended_call",
"direction": "outbound",
"createdAt": "2025-08-04T13:38:48.414Z",
"endedAt": "2025-08-04T13:39:38.816Z",
"transcript": [],
"summary": "Call failed: user_ended_call",
"dynamicVariables": {
"customerName": "Soumyadip Moni"
}
}
```
--------------------------------
### Create Phone Call (Bash)
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Initiates an outbound phone call using a specified bot. Supports optional dynamic variables for personalization and a callback URL for event notifications. Requires an API key for authorization.
```bash
curl -X POST "https://api.openmic.ai/v1/create-phone-call" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from_number": "+15551234567",
"to_number": "+15559876543",
"override_agent_id": "bvrg8wzi487w02m2bc7dh0ev",
"customer_id": "customer_12345",
"dynamic_variables": {
"name": "John Smith",
"appointment_date": "Tuesday at 2 PM",
"order_id": "ORD-98765"
},
"callback_url": "https://yourapp.com/webhook/call-events"
}'
```
--------------------------------
### Create Calls and Access Analytics with Openmic API
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Demonstrates how to initiate outbound calls, retrieve detailed call data including transcripts and analytics, and list calls with filtering options using the Openmic API client. Requires an API token for authentication.
```typescript
import { OpenmicApiClient } from "@openmic/sdk";
const client = new OpenmicApiClient({
token: "YOUR_API_KEY",
});
// Create an outbound call
const call = await client.calls.create({
fromNumber: "+15551234567",
toNumber: "+15559876543",
overrideAgentId: "bvrg8wzi487w02m2bc7dh0ev",
customerId: "customer_001",
dynamicVariables: {
name: "Michael Chen",
orderNumber: "ORD-2024-001",
deliveryDate: "January 20th"
},
callbackUrl: "https://yourapp.com/webhooks/calls"
});
console.log(`Call ID: ${call.callId}`);
console.log(`Status: ${call.callStatus}`);
// Retrieve call details with full analytics
const callDetails = await client.calls.get(call.callId);
// Access transcript
if (callDetails.transcript) {
console.log("\n--- Call Transcript ---");
for (const [speaker, message] of callDetails.transcript) {
console.log(`${speaker}: ${message}`);
}
}
// Access latency metrics
if (callDetails.latency) {
console.log("\n--- Latency Metrics ---");
console.log(`E2E Median: ${callDetails.latency.e2eMedianLatency}s`);
console.log(`LLM Median: ${callDetails.latency.llmMedianLatency}s`);
console.log(`TTS Median: ${callDetails.latency.ttsMedianLatency}s`);
}
// Access call analysis
if (callDetails.callAnalysis) {
console.log("\n--- Call Analysis ---");
console.log(`Summary: ${callDetails.callAnalysis.summary}`);
console.log(`Successful: ${callDetails.callAnalysis.isSuccessful}`);
console.log(`Evaluation: ${callDetails.callAnalysis.successEvaluation}`);
}
// Access cost breakdown
if (callDetails.callCost) {
console.log("\n--- Cost Breakdown ---");
console.log(`Total: $${callDetails.callCost.totalCost.toFixed(4)}`);
console.log(`LLM: $${callDetails.callCost.llmCost.toFixed(4)}`);
console.log(`TTS: $${callDetails.callCost.ttsCost.toFixed(4)}`);
console.log(`STT: $${callDetails.callCost.sttCost.toFixed(4)}`);
}
// List calls with filters
const callsResponse = await client.calls.list({
limit: 50,
callStatus: "ended",
fromDate: "2024-01-01T00:00:00Z",
toDate: "2024-01-31T23:59:59Z"
});
for (const c of callsResponse.calls) {
console.log(`${c.callId}: ${c.callStatus} (${c.durationMs}ms)`);
}
```
--------------------------------
### Create Bot - REST API
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Creates a new AI voice agent with specified configuration. Requires an API key for authentication and accepts a JSON payload with bot settings.
```bash
curl -X POST "https://api.openmic.ai/v1/bots" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Customer Support Bot",
"prompt": "You are a helpful customer support assistant. Be polite, professional, and always try to resolve customer issues.",
"first_message": "Hello! I\'m here to help you with any questions or concerns. How can I assist you today?",
"voice_provider": "OpenAI",
"voice": "alloy",
"voice_model": "tts-1",
"voice_speed": 1.0,
"llm_model_name": "gpt-4",
"llm_model_temperature": 0.7,
"stt_provider": "Deepgram",
"stt_model": "nova-2",
"call_settings": {
"max_call_duration": 10,
"silence_timeout": 15,
"silence_timeout_max_retries": 3,
"silence_timeout_message": "I didn\'t hear anything. Are you still there?",
"call_recording_enabled": true,
"voicemail_detection_enabled": true,
"voicemail_action": "leave_message",
"voicemail_message_type": "static",
"voicemail_message": "Hey, sorry we couldn\'t reach you directly. Please give us a callback."
},
"advanced_settings": {
"agent_personality": "friendly",
"humanize_conversation": true,
"allow_interruptions": true,
"agent_response_length": "normal"
},
"post_call_settings": {
"summary_prompt": "Provide a brief summary of the customer interaction and any action items.",
"success_evaluation_prompt": "Rate the success of this call based on customer satisfaction.",
"success_evaluation_rubric_type": "NUMERIC_SCALE"
}
}'
```
--------------------------------
### Accessing Asian Timezones
Source: https://github.com/openmicai/mintlify-docs/blob/main/dynamic-variables.mdx
Provides examples of accessing current time, date, and time using specific Asian timezone suffixes like IST, JST, KST, CST_ASIA, SGT, and HKT. These variables are useful for localized time-based operations.
```text
{{now.ist}}
{{date.ist}}
{{time.ist}}
{{now.jst}}
{{date.jst}}
{{time.jst}}
{{now.kst}}
{{date.kst}}
{{time.kst}}
{{now.cst_asia}}
{{date.cst_asia}}
{{time.cst_asia}}
{{now.sgt}}
{{date.sgt}}
{{time.sgt}}
{{now.hkt}}
{{date.hkt}}
{{time.hkt}}
```
--------------------------------
### Mintlify LaTeX Component
Source: https://github.com/openmicai/mintlify-docs/blob/main/essentials/markdown.mdx
Illustrates the usage of the custom Mintlify `` component to render mathematical equations using LaTeX syntax. This allows for complex scientific and mathematical notation.
```markdown
8 x (vk x H1 - H2) = (0,1)
```
--------------------------------
### Successful Call Payload Example (JSON)
Source: https://github.com/openmicai/mintlify-docs/blob/main/post-call-webhook.mdx
This JSON object represents a successful call report payload sent by Openmic. It includes details like session ID, phone numbers, call duration, transcript, summary, and extracted data.
```json
{
"type": "end-of-call-report",
"sessionId": "cmdx5w8oc0005q671s3cbg063",
"toPhoneNumber": "+916297653534",
"fromPhoneNumber": "+16167948654",
"callDuration": "0:00:45.723362",
"callType": "phonecall",
"disconnectionReason": "user_ended_call",
"direction": "outbound",
"createdAt": "2025-08-04T13:44:26.604Z",
"endedAt": "2025-08-04T13:45:03.325Z",
"callPickup": "yes",
"sessionType": "voice",
"transcript": [
["assistant", "Hello I am Jay."],
["user", "Yeah. Hi."],
[
"assistant",
"Hey Soumyadip! Great to hear from you. How can I help you today? Want me to reserve some raisins for you?"
],
["user", "Gotcha."],
[
"assistant",
"Awesome! I'll go ahead and reserve a pack of raisins for you at Shri Balaji Traders. Just let me know when you want to pick them up or if you'd like me to help with an online order. Cheers!"
]
],
"summary": "Jay greeted Soumyadip and offered to reserve a pack of raisins at Shri Balaji Traders. The conversation focused on confirming the reservation, with options for pickup or online order.",
"isSuccessful": false,
"successEvaluation": true,
"extractedData": {
"product": "Raisins",
},
"dynamicVariables": {
"customerName": "Soumyadip Moni"
}
}
```
--------------------------------
### Get Call Details and List Recent Calls (Python)
Source: https://context7.com/openmicai/mintlify-docs/llms.txt
Retrieves detailed information about a completed call, including duration, recording URL, transcript, call analysis, and cost breakdown. It also demonstrates how to list recent calls with filtering by status and date range. This requires an initialized OpenmicApi client.
```python
from openmic import OpenmicApi
# Assuming 'client' is an initialized OpenmicApi instance and 'call' is an object with 'call_id'
# client = OpenmicApi(token="YOUR_API_KEY")
# call = ...
call_details = client.calls.get(id=call.call_id)
print(f"Duration: {call_details.duration_ms / 1000} seconds")
print(f"Recording: {call_details.recording_url}")
# Access transcript
if call_details.transcript:
for speaker, message in call_details.transcript:
print(f"{speaker}: {message}")
# Access call analysis
if call_details.call_analysis:
print(f"Summary: {call_details.call_analysis.summary}")
print(f"Successful: {call_details.call_analysis.is_successful}")
# Access cost breakdown
if call_details.call_cost:
print(f"Total cost: ${call_details.call_cost.total_cost:.4f}")
# List recent calls with filters
calls_response = client.calls.list(
limit=50,
call_status="ended",
from_date="2024-01-01T00:00:00Z",
to_date="2024-01-31T23:59:59Z"
)
for c in calls_response.calls:
print(f"Call {c.call_id}: {c.call_status} - {c.duration_ms}ms")
```