APIFleet Sign in

Voice agent prompt: what to write and what APIFleet adds

A voice agent prompt is the written brief an agent follows on every call: its role, what it may answer, which tools to use and when to hand the caller to a person. On APIFleet it is one layer of a longer prompt, so you write the business part and the runtime supplies the call mechanics.

APIFleet team · · 8 min read

What is a voice agent prompt?

A voice agent prompt is the instruction block a voice agent reads before the first word of a call. It names the agent's role, the facts it may state, the tools it may call and when to hand the caller to a person. It does not need to teach the model how to behave on a phone line.

That last sentence is the point of this guide. A hosted platform already holds rules about tools, unclear audio and closing a call, and repeating them in your text adds noise without adding control.

What does APIFleet add around your prompt?

On APIFleet your text sits inside a longer prompt. The runtime adds a role line, your knowledge documents, conversation style and rules for tools, unclear audio, exact values and closing the call. Per-call details come last: the caller's number on inbound Telnyx and Twilio calls, then the date and time.

The table lists the layers in reading order. The assembled prompt is one string, and the table describes each layer rather than showing its text.

Prompt layers in reading order
LayerWhat it holdsWho writes it
Role lineA live agent that follows your textAPIFleet
Your instructionsThe business brief you sendYou
KnowledgeYour documents, if any, as writtenYou
Conversation styleTone, language, answer lengthAPIFleet
Runtime rulesTools, unclear audio, exact values, closingAPIFleet
Voicemail ruleOutbound calls with a voicemail actionAPIFleet
Caller numberInbound Telnyx or Twilio calls onlyAPIFleet
Date and timeDate, time, business time zoneAPIFleet

What belongs in your instructions, and what can you leave out?

Write what only your business knows: who the agent speaks for, what it may answer, which tool to call for which request, when to hand the caller to a person and what it must never say. Leave out call mechanics the runtime already states.

The table pairs six topics with what the runtime already says in its own words and what you still add. If your text restates the left column, delete it; if it is missing the right column, add it.

Already in the runtime, and what you still add
TopicRuntime already saysYou still add
Tool resultsReport success only after the tool doesWhich tool, and its trigger
Exact valuesOne at a time, read back digit by digitWhich values your job needs
Unclear audioOne short clarification, no guessingHard words, like product names
ClosingOne closing question, then end the callAnything said before ending
Answer lengthAbout one short sentence by defaultExceptions, like a read-back
A human requestTransfer if possible, else take detailsWhen a transfer is allowed

How do you write a voice agent prompt for the ear?

A caller hears one sentence at a time and cannot scroll back. OpenAI's Realtime prompting guide makes the same point in its own terms: prefer bullets over paragraphs, guide with sample phrases, and be precise, because conflicting instructions degrade performance.

Apply those habits to the business part of your text and keep each line to one rule.

  1. Start with one line for role and scope: who the agent speaks for and the two or three jobs it does. Anything outside them gets a message taken, not an improvised answer.
  2. Write rules as short bullets, one rule per line. If two lines could pull in different directions on the same call, merge or remove one.
  3. Add one sample phrase for each moment that matters, such as the hand-over line. The model follows sample phrases closely, so write the ones you want to hear.
  4. Name each tool and say when to call it. APIFleet lists the attached tool names for the model, but it cannot know your trigger, so state it.
  5. Write long flows as steps across turns. The runtime keeps answers to about one short sentence by default, even when your text describes many steps, so name any moment that needs a longer reply.
  6. Put stable facts such as hours and services in knowledge documents, and keep the prompt for behaviour. Re-read the finished text and cut every line that restates the runtime table above.

What does a worked voice agent prompt look like?

Here is a prompt for a fictional shop, Northside Bike Repair, shown as six numbered parts so you can see the shape. The tool names are ones the shop would define itself as HTTP tools; they are not built in.

Each step is the idea of one block of your text, not a script to copy word for word.

  1. Role and scope: you answer calls for Northside Bike Repair. You help with repair status and booking a drop-off slot, and nothing else.
  2. Facts: answer opening hours and services from the knowledge documents. If the answer is not there, take the caller's name, number and question for the team.
  3. Tools: when a caller gives a repair number, call check_repair_status. When they want a drop-off time, confirm the day and time, then call book_slot.
  4. Hand-over: if a caller asks for a person during opening hours, use transfer_call. Outside opening hours, take a message instead.
  5. Do-not lines: never quote a price that is not in the documents, and never promise a callback time.
  6. Keypad, on a Telnyx or Twilio call: the text "[Caller pressed keypad: 2]" means the caller chose repairs, and "3" means they chose bookings.

Where do the date, time and language come from?

The runtime appends the current date and time, the business time zone and what "today" and "tomorrow" mean to every call, so never hard-code a date or a clock in your instructions. If your text contains a "DATE AND TIME CONTEXT:" or "CURRENT CONTEXT:" label in any case, APIFleet adds no date block of its own.

The style layer starts the agent in the assistant's language. It switches only when the caller asks or clearly speaks another language, and English examples, tool names or tool results never authorise a switch back; if you still see unwanted switching, OpenAI's guide suggests pinning the output language.

Keep the greeting out of the instructions. Put it in first_message: greeting_mode "natural" varies phrasing and keeps the facts, and "exact" speaks the text verbatim, and the docs list "natural" as the default for new assistants.

Where do your instructions go on each model type?

The same assembled string reaches the model in a different place on each pipeline. The layers, knowledge and date block hold for every provider.

The caller-number block, keypad text, transfer and voicemail lines are claims about Telnyx and Twilio calls, so check a call on your own carrier before relying on them. Web tests carry no keypad.

APIFleet puts the part that never changes first and the per-call data last. OpenAI's prompt caching guide says reuse needs the entire prefix to match and a minimum cacheable prefix length, so whether a provider turns that order into a discount depends on the model and the prompt size.

This is an inference, not a documented rule: editing your instructions or a knowledge document changes the start of the prompt, so make prompt edits deliberately and not mid-experiment.

Where the prompt goes, by pipeline
PipelineWhere your text goesOne thing to know
OpenAI RealtimeSession instructionsOne string at session start
CascadingModel stage system messageOnly the language model reads it
Gemini LiveSystem instructionA short control note follows
GPT-LiveBackend modelThe speaking model gets its own brief

How do you test a voice agent prompt change?

Treat each prompt edit as an experiment with a before and an after. The assistant API takes any subset of the create fields on PATCH, so one request can change only the instructions.

Send the current revision in an If-Match header; a stale write returns 409 ASSISTANT_REVISION_CONFLICT instead of overwriting a teammate's edit. Simulations then run the same scenarios against each version, in chat mode first and voice mode after.

  1. Change one thing in the instructions and keep a copy of the old text.
  2. PATCH the assistant with the If-Match revision, and fix a 409 by re-reading the assistant first.
  3. Run the same chat-mode scenarios you ran before: they drive the assistant's real pipeline as text with the same instructions, tools and model, which is fast and cheap enough for CI. Give each scenario evaluations and tool mocks so a pass or fail is not a matter of opinion.
  4. Read the transcript and the tool events of each run, not only the verdict.
  5. Place real calls once chat mode is clean. One call is noise, so run 20 or more calls per variant before judging a change, as the evaluation noise guide explains.
  6. Keep the version that wins, and keep the old text so you can go back.
Diagram of one conversation: caller audio, speech and model, tools and context, then the spoken reply, with carrier charges listed separately

Continue with a practical next step

Frequently asked questions

What is a voice agent prompt?

It is the instruction block a voice agent reads before a call starts: its role, the facts it may state, the tools it may call and when to hand over to a person. On APIFleet it is one layer of a longer prompt that the runtime assembles.

How long should a voice agent prompt be?

As short as the job allows. Move stable facts such as hours and services into knowledge documents, and keep the prompt for behaviour, tool triggers and hand-overs. Cut any line that restates what the runtime already says.

Should I use the prompt or knowledge documents?

Use the prompt for behaviour and knowledge documents for facts. The docs say knowledge documents are sent verbatim with no embeddings, which suits small, stable sets of facts such as hours, prices and scripts.

Does APIFleet add its own rules to my prompt?

Yes. Around your text the runtime adds a role line, conversation style and rules for tools, unclear audio, exact values and closing the call. Do not paste those rules again; add only your business-specific behaviour.

Should the voice agent prompt hold today's date?

No. The runtime appends the current date, time and business time zone on every call, and a hard-coded date goes stale. Describe the rule instead, for example which days you are open.

Where does the greeting go?

Put it in first_message, not in the instructions. With greeting_mode set to natural the model varies the phrasing and keeps the facts; with exact it speaks your text verbatim.

How do I test a prompt change?

Change one thing, update the assistant with the If-Match revision, run the same chat-mode simulation scenarios, read the transcripts and tool events, then place 20 or more real calls per variant, because a single call is noise.

What is a voice prompt?

The name covers two things. In a classic phone menu it is a recorded message such as a greeting or menu option. For an AI voice agent it is the written instruction block the model follows on each call, which is what this guide covers.

Sources and evidence

Prepared with AI assistance and checked against the linked evidence. Examples are illustrative unless explicitly documented as measured results.

Bring your next conversation.

Explore the API, or sign in to your existing workspace. New workspace access is currently limited; contact us to discuss your project.