Use case
Support agents. One key, many models
Agents that triage, answer, and resolve customer conversations.
Why open models fit
Conversation volume is steady rather than bursty, and response latency is customer-visible, so per-request cost and tail latency both matter.
Support crosses voice, screenshots, and text, so open models cover transcription, document OCR, retrieval, reply, and speech behind one low-latency key.
The pipeline
One OpenAI-compatible key runs the whole pipeline. Swap any step's model without touching your loop.
- 1 ServingTranscribeWhisper Large V3 Turbo
Speech-to-text · $0.0002 / min
Swap for NVIDIA Parakeet TDT 0.6B v3
- 2 ServingRead attachmentsQwen3.5 9B
Chat · 256K ctx · $0.1 / $0.15 per M
Swap for Qwen3.6-27B or Qwen3.8 Flash Next
- 4 ServingRespondLlama 3.1 8B Instruct
Chat · 128K ctx · $0.05 / $0.08 per M
Swap for Llama 3.3 70B Instruct or Qwen3.5 9B
What goes wrong, and what to do
Transcription errors cascade
The transcript is the input to everything after it. Spend model quality here rather than at the response step, where a fluent model can hide a misheard word.
The agent answers confidently without grounding
Retrieve before responding and require a citation. An answer with no source is the failure this pipeline exists to prevent.
Attachments are ignored
Route image and document attachments to a vision model rather than dropping them, or the agent answers a question it cannot actually see.
Dedicated endpoints suit steady conversational traffic: you are paying for capacity you actually use, and a dedicated endpoint removes cold-start from a latency path a customer is waiting on.
Call the whole pipeline
Point the OpenAI SDK at FlexAI once. Every step names its own model on the same key: no per-model clients, endpoints, or keys to juggle.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.flex.ai/v1",
apiKey: process.env.FLEXAI_API_KEY,
});
const audio = await fetch("/call.mp3").then((r) => r.blob());
// search() → your vector store lookup (pgvector, Pinecone, …)
// 1. Transcribe: same key, swap the model anytime
const transcribe = await client.audio.transcriptions.create({
model: "whisper-large-v3-turbo",
file: audio,
});
// 2. Read attachments: same key, swap the model anytime
const readAttachments = await client.chat.completions.create({
model: "Qwen3.5-9B",
messages: [{ role: "user", content: transcribe.text }],
});
// 3. Retrieve: same key, swap the model anytime
const retrieve = await client.embeddings.create({
model: "bge-m3",
input: readAttachments.choices[0].message.content,
});
// 4. Respond: same key, swap the model anytime
const respond = await client.chat.completions.create({
model: "Meta-Llama-3.1-8B-Instruct-FP8",
messages: [{ role: "user", content: await search(retrieve.data[0].embedding) }],
});
// 5. Speak: same key, swap the model anytime
const speak = await client.audio.speech.create({
model: "Kokoro-82M",
voice: "alloy", input: respond.choices[0].message.content,
});Start serverless and pay per token. When a step becomes steady production traffic, move it to a dedicated endpoint on the same OpenAI-compatible API.
Build your support agents on FlexAI
Every model in the pipeline behind one OpenAI-compatible key, priced at the market rate.
Pay as you go, with no commitment beyond your usage.