=============== LIBRARY RULES =============== From library maintainers: - Base URL is https://api.callmissed.com - Endpoints are OpenAI-compatible: use the OpenAI SDK and set base_url to https://api.callmissed.com/v1 - API keys are prefixed with cm_ and sent as the header Authorization: Bearer cm_your_key - Use sarvam-30b or sarvam-105b for Indic-language LLM tasks - Use saaras:v3 for Indian-language speech-to-text across 22 Indic languages - Use bulbul:v3 for Indian-language text-to-speech (39 voices across 11 languages) - The Anthropic Messages API is available at /v1/messages using the Anthropic SDK - Free-tier models include kimi-k2.5, sarvam-30b, sarvam-105b, saaras:v3, and bulbul:v3 ### Install livekit-client Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-sessions-api.md Install the necessary LiveKit client library for Node.js. ```bash npm install livekit-client ``` -------------------------------- ### Install OpenAI SDK for Go Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Install the official OpenAI SDK for Go using go modules. This is the recommended SDK for most use cases. ```bash go get github.com/openai/openai-go ``` -------------------------------- ### Install OpenAI SDK for PHP Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Install the official OpenAI SDK for PHP using Composer. This is the recommended SDK for most use cases. ```bash composer require openai-php/client ``` -------------------------------- ### Install OpenAI SDK for Ruby Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Install the official OpenAI SDK for Ruby using RubyGems. This is the recommended SDK for most use cases. ```bash gem install ruby-openai ``` -------------------------------- ### Install callmissed-docs-mcp Globally Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/mcp-server.md Install the server globally if you prefer to have it available system-wide. Otherwise, npx can run it on demand without installation. ```bash npm install -g callmissed-docs-mcp ``` -------------------------------- ### Install JavaScript SDK Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-sdk.md Install the CallMissed JavaScript SDK using npm. ```bash npm install @callmissed/voice ``` -------------------------------- ### Install Python SDK Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-sdk.md Install the CallMissed Python SDK using pip. ```bash pip install callmissed ``` -------------------------------- ### Install OpenAI SDK for Python Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Install the official OpenAI SDK for Python using pip. This is the recommended SDK for most use cases. ```bash pip install openai ``` -------------------------------- ### Install OpenAI SDK for JavaScript/TypeScript Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Install the official OpenAI SDK for JavaScript and TypeScript using npm. This is the recommended SDK for most use cases. ```bash npm install openai ``` -------------------------------- ### JavaScript SDK Quick Start Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-sdk.md Initialize a VoiceSession, connect to the WebSocket, and handle events like transcripts and agent text. Disconnect when finished. ```typescript import { VoiceSession } from "@callmissed/voice"; // Get wsUrl and token from your backend (POST /v1/voice/sessions) const session = new VoiceSession({ wsUrl, token }); session.on("transcript", (text) => console.log("User:", text)); session.on("agentText", (text) => console.log("Agent:", text)); session.on("stateChange", (state) => updateUI(state)); session.on("error", (msg) => console.error(msg)); await session.connect(); // Starts mic + WebSocket // Later... session.disconnect(); ``` -------------------------------- ### Install CallMissed SDK (Python) Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/quickstart.md Install the CallMissed SDK for Python using pip. Ensure you have Python and pip installed. ```bash pip install openai ``` -------------------------------- ### Full Python Example for Function Calling Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/chat-function-calling.md This Python example demonstrates the complete workflow of function calling: sending an initial request with tools, checking for tool calls in the response, executing the function, and sending the result back to the model. ```python # Step 1: Send initial request with tools response = client.chat.completions.create( model="sarvam-30b", messages=[{"role": "user", "content": "What's the weather in Mumbai?"}], tools=[ { "type": "function", "function": { "name": "get_weather", "description": "Get weather for a city", "parameters": { "type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"] } } } ], tool_choice="auto" ) # Step 2: Check if model wants to call a tool msg = response.choices[0].message if msg.tool_calls: tool_call = msg.tool_calls[0] # Execute your function here... result = get_weather(json.loads(tool_call.function.arguments)["city"]) # Step 3: Send result back final = client.chat.completions.create( model="sarvam-30b", messages=[ {"role": "user", "content": "What's the weather in Mumbai?"}, msg, # assistant message with tool_calls {"role": "tool", "tool_call_id": tool_call.id, "content": json.dumps(result)} ] ) print(final.choices[0].message.content) ``` -------------------------------- ### Python SDK Quick Start Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-sdk.md Connect to CallMissed, create a voice session, and stream audio. Handles user transcripts, agent responses, and audio playback. ```python import asyncio from callmissed import CallMissed, SessionConfig async def main(): async with CallMissed(jwt_token="your_token") as client: # Create session session = await client.voice.create_session( SessionConfig( system_prompt="You are a helpful assistant.", voice="shubh", llm_model="sarvam-30b", ) ) # Connect and stream async with client.voice.connect(session) as ws: ws.on("transcript", lambda t: print(f"User: {t}")) ws.on("agent_text", lambda t: print(t, end="")) ws.on("audio", lambda chunk: play_audio(chunk)) ws.on("error", lambda msg: print(f"Error: {msg}")) await ws.send_audio(pcm_bytes) await asyncio.sleep(60) # Get transcript turns = await client.voice.get_transcript(session.id) for turn in turns: print(f"User: {turn.user_transcript}") print(f"Agent: {turn.agent_response}") asyncio.run(main()) ``` -------------------------------- ### Configure and Use OpenAI SDK in Go Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Configure the OpenAI client with your API key and base URL, then make a chat completion request. Ensure you have the 'openai-go' package installed. ```go package main import ( "context" "fmt" "github.com/openai/openai-go" "github.com/openai/openai-go/option" ) func main() { client := openai.NewClient( option.WithAPIKey("cm_your_api_key"), option.WithBaseURL("https://api.callmissed.com/v1"), ) resp, _ := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{ Model: openai.F("sarvam-30b"), Messages: openai.F([]openai.ChatCompletionMessageParamUnion{ openai.UserMessage("Hello"), }), }, ) fmt.Println(resp.Choices[0].Message.Content) } ``` -------------------------------- ### Install CallMissed SDK (JavaScript/TypeScript) Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/quickstart.md Install the CallMissed SDK for JavaScript or TypeScript using npm. This is required for Node.js environments. ```bash npm install openai ``` -------------------------------- ### Install Anthropic SDK for JavaScript/TypeScript Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Install the Anthropic SDK for JavaScript/TypeScript using npm. This SDK is used for the /v1/messages endpoint. ```bash npm install @anthropic-ai/sdk ``` -------------------------------- ### Install Anthropic SDK for Python Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Install the Anthropic SDK for Python using pip. This SDK is used for the /v1/messages endpoint. ```bash pip install anthropic ``` -------------------------------- ### Install CallMissed SDK (PHP) Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/quickstart.md Install the CallMissed SDK for PHP using Composer. This command adds the client to your project's dependencies. ```bash composer require openai-php/client ``` -------------------------------- ### Install CallMissed SDK (Ruby) Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/quickstart.md Install the CallMissed SDK for Ruby using the gem command. This makes the library available in your Ruby project. ```bash gem install ruby-openai ``` -------------------------------- ### Upgrade OpenAI SDK for Go Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Upgrade the OpenAI SDK for Go to the latest version using go get. ```bash go get -u github.com/openai/openai-go ``` -------------------------------- ### Install CallMissed SDK (Go) Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/quickstart.md Add the CallMissed SDK for Go to your project dependencies. This command fetches the latest version. ```bash go get github.com/openai/openai-go ``` -------------------------------- ### Configure and Use OpenAI SDK in Python Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Configure the OpenAI client with your API key and base URL, then make a chat completion request. Ensure you have the 'openai' package installed. ```python from openai import OpenAI client = OpenAI( api_key="cm_your_api_key", base_url="https://api.callmissed.com/v1" ) response = client.chat.completions.create( model="sarvam-30b", messages=[{"role": "user", "content": "Hello"}] ) print(response.choices[0].message.content) ``` -------------------------------- ### Example Request with Gateway Plugins Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/gateway-plugins.md This JSON object demonstrates how to enable various gateway plugins like web search, file parsing, response healing, and context compression within a chat completion request. ```json { "model": "anthropic/claude-sonnet-4.6", "messages": [{ "role": "user", "content": "Summarize this PDF" }], "plugins": [ { "id": "web" }, "file-parser", "response-healing", "context-compression" ] } ``` -------------------------------- ### Configure and Use OpenAI SDK in PHP Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Configure the OpenAI client with your API key and base URL, then make a chat completion request. Ensure you have the 'openai-php/client' package installed. ```php withApiKey('cm_your_api_key') ->withBaseUri('https://api.callmissed.com/v1') ->make(); $response = $client->chat()->create([ 'model' => 'sarvam-30b', 'messages' => [['role' => 'user', 'content' => 'Hello']], ]); echo $response->choices[0]->message->content; ``` -------------------------------- ### Configure and Use OpenAI SDK in Ruby Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Configure the OpenAI client with your API key and base URL, then make a chat completion request. Ensure you have the 'ruby-openai' gem installed. ```ruby require "openai" client = OpenAI::Client.new( access_token: "cm_your_api_key", uri_base: "https://api.callmissed.com/v1" ) response = client.chat( parameters: { model: "sarvam-30b", messages: [{ role: "user", content: "Hello" }] } ) puts response.dig("choices", 0, "message", "content") ``` -------------------------------- ### Configure and Use OpenAI SDK in TypeScript Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/sdks.md Configure the OpenAI client with your API key and base URL, then make a chat completion request. Ensure you have the 'openai' package installed. ```typescript import OpenAI from "openai"; const client = new OpenAI({ apiKey: "cm_your_api_key", baseURL: "https://api.callmissed.com/v1", }); const response = await client.chat.completions.create({ model: "sarvam-30b", messages: [{ role: "user", content: "Hello" }], }); console.log(response.choices[0].message.content); ``` -------------------------------- ### Use kimi-k2.5 during maintenance Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/models-kimi-fast.md While kimi-k2.5-fast is under maintenance, point your code at kimi-k2.5. This example demonstrates how to make a streaming chat completion request using the OpenAI Python client. ```python from openai import OpenAI client = OpenAI( base_url="https://api.callmissed.com/v1", api_key="cm_your_api_key", ) response = client.chat.completions.create( model="kimi-k2.5", # kimi-k2.5-fast is under maintenance messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Explain quantum computing briefly."}, ], stream=True, ) for chunk in response: print(chunk.choices[0].delta.content or "", end="", flush=True) ``` -------------------------------- ### Basic Chat Completion in JavaScript Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/chat-completion.md This JavaScript example demonstrates how to interact with the Chat Completions API. Configure the `apiKey` and `baseURL` in the OpenAI client constructor. The response contains the AI's message content. ```javascript import OpenAI from "openai"; const client = new OpenAI({ apiKey: "cm_your_key", baseURL: "https://api.callmissed.com/v1", }); const response = await client.chat.completions.create({ model: "sarvam-30b", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "What is the capital of India?" }, ], }); console.log(response.choices[0].message.content); ``` -------------------------------- ### Generate Image with cURL Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/image-generation.md Make a POST request to the image generation endpoint using cURL. This example demonstrates how to send the prompt, model, and size parameters in the request body. ```Bash curl -X POST https://api.callmissed.com/v1/images/generations \ -H "Authorization: Bearer cm_your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "flux-2-klein-9b", "prompt": "A golden retriever in a sunlit library", "n": 1, "size": "1024x1024" }' ``` -------------------------------- ### List Models and Context Windows Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/chat-completion.md Demonstrates how to list available models and retrieve their context window sizes using the Python client. ```APIDOC ## List Models and Context Windows ### Description This section describes how to retrieve model information, specifically the `context_window` (token count for prompt + completion), using the `GET /v1/models` endpoint. The response includes `context_window` and `context_length` for compatibility. ### Endpoint `GET /v1/models` ### Response #### Success Response (200) - **models** (array) - A list of available models. - Each model object contains: - **id** (string) - The model identifier. - **context_window** (integer) - The canonical context window size in tokens. - **context_length** (integer) - An alias for `context_window` for OpenAI SDK compatibility. - **model_extra** (object) - Additional model-specific information. - **context_window** (integer) - The context window size. - **supports_vision** (boolean) - Indicates if the model supports vision. ### Request Example ```python from openai import OpenAI client = OpenAI(api_key="cm_your_key", base_url="https://api.callmissed.com/v1") for m in client.models.list(): extra = m.model_extra or {} print(m.id, extra.get("context_window"), extra.get("supports_vision")) ``` ``` -------------------------------- ### Connect to LiveKit Room with livekit-client SDK Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-agent.md Connect your client to the LiveKit room using the provided URL and token. This code sets up event listeners for subscribed tracks and received transcriptions, then enables the microphone. The agent joins automatically upon connection. ```javascript import { Room, RoomEvent, Track } from "livekit-client"; const room = new Room(); room.on(RoomEvent.TrackSubscribed, (track, pub, participant) => { if (track.kind === Track.Kind.Audio) { const el = track.attach(); document.body.appendChild(el); } }); room.on(RoomEvent.TranscriptionReceived, (segments, participant) => { for (const seg of segments) { if (seg.final) { const who = participant?.isLocal ? "You" : "Agent"; console.log(who + ": " + seg.text); } } }); await room.connect(session.ws_url, session.token); await room.localParticipant.setMicrophoneEnabled(true); ``` -------------------------------- ### List All Models Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/models.md Use this endpoint to retrieve a list of all available models. No authentication is required. ```bash # List all models curl https://api.callmissed.com/api/v1/models ``` -------------------------------- ### Get Session Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-sessions-api.md Retrieves details for a specific voice session by its ID. ```APIDOC ## Get Session ### Description Retrieves detailed information about a specific voice session using its unique identifier. ### Method GET ### Endpoint /v1/voice/sessions/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the voice session. ### Request Example ```bash curl https://api.callmissed.com/v1/voice/sessions/{id} \ -H "Authorization: Bearer cm_your_api_key" ``` ### Response #### Success Response (200) Returns a `VoiceSessionOut` object, excluding `ws_url` and `token`. ``` -------------------------------- ### Get Transcript Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-sessions-api.md Retrieves the transcript for a specific voice session in various formats. ```APIDOC ## Get Transcript ### Description Retrieves the transcript of a voice session. The transcript can be returned in JSON, plain text, or SRT format. ### Method GET ### Endpoint /v1/voice/sessions/{id}/transcript ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the voice session. #### Query Parameters - **format** (string) - Optional - The desired format for the transcript. Defaults to `json`. Allowed values: `json`, `txt`, `srt`. ### Request Example ```bash curl "https://api.callmissed.com/v1/voice/sessions/{id}/transcript?format=json" \ -H "Authorization: Bearer cm_your_api_key" ``` ### Response #### Success Response (200) Returns the transcript in the specified format (`json`, `txt`, or `srt`). The JSON format returns an array of turns, each containing details like user transcript, agent response, and timing information. ``` -------------------------------- ### Get conversation messages Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/conversations.md Retrieves the ordered list of messages for a specific conversation. ```APIDOC ## GET /api/v1/conversations/:id/messages ### Description Retrieves the ordered list of messages for a specific conversation. ### Method GET ### Endpoint /api/v1/conversations/:id/messages ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the conversation. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the message. - **conversation_id** (string) - The identifier of the conversation this message belongs to. - **role** (string) - The role of the sender (e.g., 'user', 'assistant'). - **content** (string) - The content of the message. - **message_type** (string) - The type of the message (e.g., 'text'). - **tokens_used** (integer) - The number of tokens used for this message (null if not applicable). - **created_at** (string) - The timestamp when the message was created. #### Response Example ```json [ { "id": "...", "conversation_id": "c0ffee00-...", "role": "user", "content": "Where is my order?", "message_type": "text", "tokens_used": null, "created_at": "2026-06-06T11:55:00Z" }, { "id": "...", "conversation_id": "c0ffee00-...", "role": "assistant", "content": "Let me check that for you.", "message_type": "text", "tokens_used": 18, "created_at": "2026-06-06T11:55:02Z" } ] ``` ``` -------------------------------- ### Token Count Response Example Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/anthropic-api.md The response from the count_tokens endpoint provides the estimated number of input tokens. ```json {"input_tokens": 15} ``` -------------------------------- ### Get Specific Model Details Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/models.md Fetch details for a particular model by providing its unique ID in the URL. ```bash # Get a specific model curl https://api.callmissed.com/api/v1/models/sarvam-30b ``` -------------------------------- ### Create Order for Credit Top-up Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/payments.md Initiates a credit top-up order. Use the returned payment_session_id with the Cashfree SDK for checkout. Authentication is via JWT. ```bash curl https://api.callmissed.com/api/v1/payments/create-order \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"type": "credit_topup", "credits": 5000}' ``` -------------------------------- ### Access Model Information with JavaScript Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/model-access.md This JavaScript example shows how to fetch and process model access data using the Fetch API. It includes logic to list free LLM models and determine if a given model is accessible on the free plan. ```typescript const resp = await fetch("https://api.callmissed.com/api/v1/models/access"); const data = await resp.json(); // List free LLM models const freeLLMs = data.plans.free.by_category.llm; console.log("Free LLM models:", freeLLMs); // Check if a model is available on free plan const model = "openai/gpt-5.4-mini"; const isFree = data.plans.free.models.includes(model); console.log(model, "on free plan:", isFree); // false ``` -------------------------------- ### Get Model Access Information Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/model-access.md Retrieves information about which models are accessible by each plan tier. This endpoint does not require authentication. ```APIDOC ## GET /api/v1/models/access ### Description Retrieves a list of models accessible by each plan tier (Free, Starter, Pro, Enterprise), categorized by LLM, STT, TTS, and Image. ### Method GET ### Endpoint /api/v1/models/access ### Parameters None ### Request Example None ### Response #### Success Response (200) - **plans** (object) - An object containing details for each plan tier. - **free** (object) - Details for the free plan. - **models** (array) - List of all model IDs available on the free plan. - **by_category** (object) - Models categorized by type (llm, stt, tts, image). - **restriction** (string) - A summary of the plan's model restrictions. - **starter** (object) - Details for the starter plan (similar structure to free). - **pro** (object) - Details for the pro plan (similar structure to free). - **enterprise** (object) - Details for the enterprise plan (similar structure to free, may include custom models). #### Response Example ```json { "plans": { "free": { "models": ["auto", "sarvam-30b", ...], "by_category": { "llm": ["auto", "sarvam-30b", ...], "stt": ["saaras:v3", ...], "tts": ["bulbul:v3", ...], "image": ["flux-2-klein-9b", ...] }, "restriction": "25 models across 4 categories" }, "starter": { "models": ["...all free models + 300+ paid models"], "by_category": { "llm": ["..."], "stt": ["..."], "tts": ["..."], "image": ["..."] }, "restriction": "All 300+ models" }, "pro": { "models": ["..."], "by_category": { "llm": ["..."], "stt": ["..."], "tts": ["..."], "image": ["..."] }, "restriction": "All 300+ models" }, "enterprise": { "models": ["..."], "by_category": { "llm": ["..."], "stt": ["..."], "tts": ["..."], "image": ["..."] }, "restriction": "All 300+ models + custom models" } } } ``` ### Error Handling - **403 Forbidden**: Returned when a free-plan user attempts to access a paid model. The response body will contain an error message specifying the model and a link to upgrade. ``` -------------------------------- ### Get Specific Model Details Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/models.md Retrieves detailed information about a single, specific AI model using its unique ID. ```APIDOC ## GET /api/v1/models/{model_id} ### Description Retrieves detailed information for a specific model identified by its ID. ### Method GET ### Endpoint /api/v1/models/{model_id} ### Path Parameters - **model_id** (string) - Required - The unique identifier of the model to retrieve (e.g., `sarvam-30b`). ### Response #### Success Response (200) Returns a single model object with all its details. ``` -------------------------------- ### Create a WhatsApp Bot Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/bots.md Use this endpoint to create a new bot. Specify the bot's name, type (e.g., 'whatsapp'), and a system prompt to guide its behavior. Ensure your API key has 'bots:write' scope. ```bash curl https://api.callmissed.com/api/v1/bots \ -H "Authorization: Bearer cm_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "Support Bot", "type": "whatsapp", "system_prompt": "You are a friendly support agent for Acme. Keep replies under 3 sentences." }' ``` ```json { "id": "b1f2c3d4-5678-90ab-cdef-1234567890ab", "tenant_id": "a0b1c2d3-4455-6677-8899-aabbccddeeff", "name": "Support Bot", "type": "whatsapp", "system_prompt": "You are a friendly support agent for Acme. Keep replies under 3 sentences.", "config": null, "is_active": true, "created_at": "2026-06-06T12:00:00Z", "updated_at": "2026-06-06T12:00:00Z", "conversation_count": 0 } ``` -------------------------------- ### Get AI Draft Reply Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/conversations.md Generate a suggested reply from the AI without sending it to the customer. This is useful for agent co-pilots. ```http POST /api/v1/conversations/:id/ai-draft ``` -------------------------------- ### Access Frontier Models Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/models-frontier.md Use the full model ID with the /v1/chat/completions endpoint. Example shows accessing a model with a user prompt. ```python response = client.chat.completions.create( model="auto", messages=[{"role": "user", "content": "Your prompt here"}] ) ``` -------------------------------- ### Usekimi-k2.5 for Fast LLM Inference Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/models.md When the fast inference tier 'kimi-k2.5-fast' is under maintenance, fall back to the 'kimi-k2.5' model for chat completions. ```python response = client.chat.completions.create( model="kimi-k2.5", messages=[{"role": "user", "content": "Hello"}] ) ``` -------------------------------- ### Get Voice Session Transcript Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-sessions-api.md Retrieve the transcript for a voice session. Supports JSON, plain text, or SubRip subtitle formats. ```bash curl "https://api.callmissed.com/v1/voice/sessions/{id}/transcript?format=json" \ -H "Authorization: Bearer cm_your_api_key" ``` -------------------------------- ### Send Image Input to Vision-Capable Model Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/anthropic-api.md This example demonstrates how to send an image along with text to a vision-capable model. Replace '' with your actual base64 encoded image data and 'cm_your_key' with your API key. The 'supports_vision' flag in the model listing indicates compatibility. ```bash curl -X POST https://api.callmissed.com/v1/messages \ -H "x-api-key: cm_your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4.6", "max_tokens": 1024, "messages": [{"role": "user", "content": [{"type": "text", "text": "What is in this image?"},{"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": ""}}]}]}' ``` -------------------------------- ### Get Specific Voice Session Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-sessions-api.md Retrieve details for a specific voice session using its ID. Excludes sensitive creation tokens. ```bash curl https://api.callmissed.com/v1/voice/sessions/{id} \ -H "Authorization: Bearer cm_your_api_key" ``` -------------------------------- ### Get Model Access Information Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/model-access.md Use this cURL command to fetch the model access information for all plan tiers. No authentication is required. ```bash curl https://api.callmissed.com/api/v1/models/access ``` -------------------------------- ### Access Model Information with Python Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/model-access.md This Python script demonstrates how to retrieve and parse model access data. It shows how to list free LLM models and check if a specific model is available on the free plan. ```python import requests resp = requests.get("https://api.callmissed.com/api/v1/models/access") data = resp.json() # List free LLM models free_llms = data["plans"]["free"]["by_category"]["llm"] print("Free LLM models:", free_llms) # Check if a model is available on free plan model = "openai/gpt-5.4-mini" is_free = model in data["plans"]["free"]["models"] print(f"{model} on free plan: {is_free}") # False ``` -------------------------------- ### Execute Full Call Analytics Workflow Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/call-analytics.md Demonstrates the complete workflow using the CallAnalytics class: analyzing an audio file, asking a question about the transcript, and retrieving a summary. Ensure the CALLMISSED_API_KEY environment variable is set. ```python import os analytics = CallAnalytics(api_key=os.environ["CALLMISSED_API_KEY"]) analytics.analyze("/path/to/your/audio/file.mp3", language="hi-IN") print(analytics.answer_question("Was the customer satisfied with the resolution?")) print(analytics.get_summary()) ``` -------------------------------- ### Anthropic API Error Format Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/anthropic-api.md Errors returned by the Anthropic API follow a specific JSON structure. This example shows a typical authentication error. ```json { "type": "error", "error": { "type": "authentication_error", "message": "Invalid API key" } } ``` -------------------------------- ### Stream Messages with JavaScript Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/anthropic-api.md This JavaScript example demonstrates how to stream responses from the Anthropic API. It iterates over the stream events, processing text deltas as they arrive. ```javascript import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ apiKey: "cm_your_key", baseURL: "https://api.callmissed.com", }); const stream = client.messages.stream({ model: "claude-sonnet-4.6", max_tokens: 1024, messages: [{ role: "user", content: "Tell me a short story." }], }); for await (const event of stream) { if (event.type === "content_block_delta" && event.delta.type === "text_delta") { process.stdout.write(event.delta.text); } } ``` -------------------------------- ### Create and Connect to a Voice Session Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/voice-sessions-api.md Create a voice session via the API and connect to it using the LiveKit client. Handles audio subscription and transcription events. ```javascript import { Room, RoomEvent, Track } from "livekit-client"; const session = await fetch("https://api.callmissed.com/v1/voice/sessions", { method: "POST", headers: { "Authorization": "Bearer cm_your_api_key", "Content-Type": "application/json", }, body: JSON.stringify({ system_prompt: "You are a helpful assistant.", voice: "shubh", language: "en-IN", llm_model: "kimi-k2.5", }), }).then(r => r.json()); const room = new Room(); room.on(RoomEvent.TrackSubscribed, (track) => { if (track.kind === Track.Kind.Audio) { document.body.appendChild(track.attach()); } }); room.on(RoomEvent.TranscriptionReceived, (segments, participant) => { for (const seg of segments) { if (!seg.final) continue; const who = participant?.isLocal ? "You" : "Agent"; console.log(who + ": " + seg.text); } }); await room.connect(session.ws_url, session.token); await room.localParticipant.setMicrophoneEnabled(true); ``` -------------------------------- ### TypeScript Chat Completion Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/quickstart.md Utilize the OpenAI TypeScript SDK for chat completions. Install the SDK, set your API key and base URL, and make the request. ```typescript import OpenAI from "openai"; const client = new OpenAI({ apiKey: "cm_your_api_key", baseURL: "https://api.callmissed.com/v1" }); const response = await client.chat.completions.create({ model: "sarvam-30b", messages: [{ role: "user", content: "Hello in Hindi" }], }); console.log(response.choices[0].message.content); ``` -------------------------------- ### Create Payment Order Source: https://github.com/callmissed/callmissed-docs/blob/main/docs/payments.md Initiates a payment order for either a credit top-up or a plan upgrade. The response contains details needed to proceed with the payment via the Cashfree SDK. ```APIDOC ## POST /api/v1/payments/create-order ### Description Initiates a payment order for credit top-up or plan upgrade. ### Method POST ### Endpoint /api/v1/payments/create-order ### Parameters #### Request Body - **type** (string) - Required - Specifies the type of order. Can be 'credit_topup' or 'plan_upgrade'. - **credits** (integer) - Optional - The number of credits to purchase (required if type is 'credit_topup'). - **plan** (string) - Optional - The plan to upgrade to (required if type is 'plan_upgrade', e.g., 'pro'). ### Request Example ```json { "type": "credit_topup", "credits": 5000 } ``` ### Response #### Success Response (200) - **order_id** (string) - The internal order ID. - **cf_order_id** (string) - The Cashfree order ID. - **payment_session_id** (string) - The session ID for Cashfree checkout. - **amount** (float) - The total amount for the order. - **currency** (string) - The currency of the amount. - **env** (string) - The environment for the Cashfree checkout (e.g., 'production'). #### Response Example ```json { "order_id": "cm_9f2a1c4e6b8d0a13", "cf_order_id": "CF...", "payment_session_id": "session_...", "amount": 5000.0, "currency": "INR", "env": "production" } ``` ```