# Single Message Input

> The mode that sends one prompt and ends, for jobs done in one go.

**Field:** Artificial Intelligence  
**Category:** Claude Agent SDK  
**Also known as:** single message mode, one-shot query, Claude Agent SDK Single Message Input

## Think of it like

It is like sending a letter. You write it once, and wait for the reply.

## Definition

Single message input is the way to use the Agent SDK where you pass one prompt to query and read the result. It suits one-shot jobs and places that keep no state, such as a lambda. It cannot take images, queue more messages or be stopped. If a run hits a limit, the call raises an error after the result.

## Example

Leo's nightly job asks the agent to sum up the day's commits. One prompt is all it needs, so he uses single message input.

## Why it matters

It is the simplest way to run a task, as long as the task needs no follow-up.

## Common mistake

Not wrapping it in a try block. A run that hits max turns raises an error after the result.

## Three principles

- **One prompt, one run.** Then done.
- **No images or interrupts.** Limited.
- **Raises on limits.** Use try.

## Related terms

- [Streaming Input Mode](https://learn.benibix.com/term/ai/streaming-input-mode)
- [query() Function](https://learn.benibix.com/term/ai/query-function)
- [ResultMessage](https://learn.benibix.com/term/ai/sdk-result-message)

## Told apart from

- [Streaming Input vs Single Message Input](https://learn.benibix.com/compare/streaming-input-mode-vs-single-message-input): People think the two input modes are the same thing in a different form. Single message input sends one prompt and ends. It takes no images and cannot be stopped mid-turn. Streaming input keeps a session open, so you can send more, add images and stop it. Pick single message input for one-shot jobs, and streaming input for a chat.

---

Source: https://learn.benibix.com/term/ai/single-message-input
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
