> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mka1.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pass request bodies

> Build mka1 CLI requests with individual flags, the --body JSON shortcut, or stdin piping — and understand how the three inputs combine.

Every command that accepts a request body supports three ways of supplying it:

1. Individual flags (highest priority)
2. The `--body` flag with a JSON string
3. Stdin piping

They can be combined — the CLI merges them and higher-priority sources overwrite lower-priority ones at the field level.

## Individual flags

Use a dedicated flag for each field. This is the most discoverable option and the easiest to use with shell tab-completion:

```bash theme={null}
mka1 llm responses create \
  --model auto \
  --input '"Summarize the support queue for yesterday."'
```

`--help` shows every flag the command accepts, along with required ones and enum options.

## The `--body` flag

Send the full request body as a single JSON string. Useful when you already have the body formed — for example, from another tool or a test fixture:

```bash theme={null}
mka1 llm responses create --body '{
  "model": "auto",
  "input": "Summarize the support queue for yesterday."
}'
```

Individual flags still override the body at the field level:

```bash theme={null}
# Final body: {"model":"auto","input":"A different prompt"}
mka1 llm responses create \
  --body '{"model":"auto","input":"Original prompt"}' \
  --input '"A different prompt"'
```

## Stdin piping

Pipe JSON into any command that accepts a body. This is the right pick for scripting, chaining commands, or reading bodies out of files:

```bash theme={null}
# From a JSON file
mka1 llm responses create < request.json

# From another command
curl -s https://example.com/prompt.json | mka1 llm responses create

# Generated inline
echo '{"model":"auto","input":"Hello"}' | mka1 llm responses create
```

Individual flags override stdin values as well:

```bash theme={null}
# Final body: {"model":"auto","input":"Overridden"}
echo '{"model":"auto","input":"From stdin"}' \
  | mka1 llm responses create --input '"Overridden"'
```

## Priority chain

When more than one source supplies the same field, the higher-priority source wins:

| Priority    | Source           | Typical use                         |
| ----------- | ---------------- | ----------------------------------- |
| 1 (highest) | Individual flags | One-off tweaks, scripted parameters |
| 2           | `--body` flag    | Inline-formed JSON body             |
| 3 (lowest)  | Stdin            | Piped or file-sourced JSON          |

The CLI merges object keys, so you can mix and match: pipe the bulk of the body through stdin, then override a single field with a flag.

## Chain commands together

Because each command prints JSON to stdout (when you pass `--output-format json`), you can feed one call into the next:

```bash theme={null}
mka1 llm files upload \
  --file ./support-manual.pdf \
  --purpose assistants \
  --output-format json \
  --jq '{file_id: .id, purpose: .purpose}' \
  | mka1 llm vector-stores create-file --vector-store-id vs_123
```

See [format and filter output](/docs/cli/output-formats) for more on `--output-format` and `--jq`.

## File inputs

File-upload commands (`llm files upload`, `llm speech transcribe`, `llm extract extract`, and similar) take a path with `--file`.
The CLI reads the file and sends it as multipart form data:

```bash theme={null}
mka1 llm files upload --file ./dataset.jsonl --purpose fine-tune
```

Binary responses (for example, `llm speech speak`) support `--output-file` to write the payload to a path instead of printing it:

```bash theme={null}
mka1 llm speech speak \
  --text 'Hello, welcome to our service.' \
  --output-file ./welcome.wav
```

Use `--output-b64` when you want the binary base64-encoded on stdout instead.
