> ## 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.

# Commands

> Tour the mka1 CLI command tree with worked examples for Responses, Conversations, Files, Vector Stores, Extract, Speech, Agents, and more.

Every command follows the same shape:

```text theme={null}
mka1 <service> <resource> <action> [flags]
```

For example, `mka1 llm responses create` or `mka1 llm vector-stores search`.
Drill into any level with `--help` to see the flags that apply:

```bash theme={null}
mka1 --help
mka1 llm --help
mka1 llm responses --help
mka1 llm responses create --help
```

Or launch the interactive TUI to browse every command:

```bash theme={null}
mka1 explore
```

The rest of this page walks through the most common workflows.
All examples assume you have authenticated the CLI — see [authenticate the CLI](/docs/cli/authentication).

## Responses

Generate text, continue a thread, or run an agent with tools.

```bash theme={null}
mka1 llm responses create \
  --model auto \
  --input '"Write a one-sentence summary of the MKA1 API."'
```

Add `instructions` to steer the reply:

```bash theme={null}
mka1 llm responses create \
  --model auto \
  --instructions 'Reply in plain English. Keep answers under 80 words.' \
  --input '"Explain what embeddings are used for."'
```

Continue an earlier response without resending the history:

```bash theme={null}
mka1 llm responses create \
  --model auto \
  --previous-response-id resp_123 \
  --input '"Now turn that into an email subject line."'
```

Stream tokens as they are produced:

```bash theme={null}
mka1 llm responses create \
  --model auto \
  --input '"Write three release-notes bullets for the docs update."' \
  --stream \
  --output-format json
```

Offload long-running work to the background and poll later with `mka1 llm responses get`:

```bash theme={null}
mka1 llm responses create \
  --model auto \
  --input '"Produce a 1,000-word brief."' \
  --background
```

See the [Responses guide](/docs/generate-a-response) for the full resource model.

## Conversations

Wrap multi-turn exchanges in a reusable container:

```bash theme={null}
# Create a conversation
mka1 llm conversations create --metadata '{"session_id":"web-42"}'

# Use it in a response
mka1 llm responses create \
  --model auto \
  --conversation conv_123 \
  --input '"What should I ask next to refine this draft?"'

# Inspect the stored items
mka1 llm conversations list-items --conversation-id conv_123
```

See the [conversations guide](/docs/conversations) for the full lifecycle.

## Files

Upload once, then reference the file from vector stores, fine-tuning jobs, or the Extract API:

```bash theme={null}
mka1 llm files upload --file ./support-manual.pdf --purpose assistants
mka1 llm files list
mka1 llm files get --file-id file_123
mka1 llm files content --file-id file_123 --output-file ./downloaded.pdf
```

## Vector stores

Index files for semantic search and retrieval:

```bash theme={null}
# Create a store
mka1 llm vector-stores create --name support-knowledge

# Attach a file
mka1 llm vector-stores create-file \
  --vector-store-id vs_123 \
  --file-id file_123

# Search it
mka1 llm vector-stores search \
  --vector-store-id vs_123 \
  --query 'How do I reset an account password?'
```

See the [files and vector stores guide](/docs/files-and-vector-stores) for the full pattern.

## Extract structured data

Run inline extraction with a JSON Schema:

```bash theme={null}
mka1 llm extract extract \
  --model auto \
  --file ./invoice.pdf \
  --prompt 'Extract invoice number, vendor, total, and date.' \
  --schema '{
    "type": "object",
    "properties": {
      "invoice_number": { "type": "string" },
      "vendor_name": { "type": "string" },
      "total_amount": { "type": "number" },
      "date": { "type": "string", "format": "date" }
    },
    "required": ["invoice_number", "total_amount"]
  }'
```

Or save a schema once and reuse it:

```bash theme={null}
mka1 llm extract create-schema --name invoice --schema @./invoice.schema.json
mka1 llm extract extract-with-schema --schema-id sch_123 --file ./invoice.pdf
```

See the [extract structured data guide](/docs/extract-structured-data) for schema design tips.

## Speech

Transcribe audio or generate speech from text:

```bash theme={null}
# Speech to text
mka1 llm speech transcribe --file ./call.wav

# Text to speech — save to a .wav file
mka1 llm speech speak \
  --text 'Hello, welcome to our service.' \
  --language en \
  --output-file ./welcome.wav
```

See the [speech guide](/docs/speech) for language and voice options.

## Agents

Create a reusable agent definition, then run it later:

```bash theme={null}
mka1 agents create \
  --name release-research-agent \
  --model auto \
  --instructions 'Use web search when the question depends on current external information.' \
  --tools '[{"type":"web_search","search_context_size":"medium"}]'

mka1 agent-runs create \
  --agent-id agt_123 \
  --input '"What is the current stable version of Bun?"'

mka1 agent-runs list --agent-id agt_123
```

See the [managing agents guide](/docs/managing-agents) for the full resource model.

## Prompts

Save prompts centrally and version them:

```bash theme={null}
mka1 llm prompts create --name welcome-email --template @./welcome.tpl
mka1 llm prompts create-version --prompt-id prm_123 --template @./welcome.v2.tpl
mka1 llm prompts list-versions --prompt-id prm_123
mka1 llm prompts rollback --prompt-id prm_123 --version 1
```

See the [prompt repository guide](/docs/prompt-repository).

## Models and usage

List the models available to your account and check usage:

```bash theme={null}
mka1 llm models list
mka1 llm models get --model-id meetkai:functionary-pt

mka1 llm usage-stats responses --start-time 2026-04-01 --end-time 2026-04-22
mka1 llm usage-stats embeddings --start-time 2026-04-01 --end-time 2026-04-22
```

## Permissions

Grant, revoke, and check fine-grained permissions on individual resources:

```bash theme={null}
mka1 permissions llm grant \
  --resource-type completion \
  --resource-id my-completion-123 \
  --user-id user-abc456 \
  --role writer

mka1 permissions llm check \
  --resource-type completion \
  --resource-id my-completion-123 \
  --user-id user-abc456
```

See the [authorization guide](/docs/authorization) for the permission model.

## Guardrails

Inspect and test the content moderation settings applied to your traffic:

```bash theme={null}
mka1 guardrails get
mka1 guardrails test --content 'Evaluate this input.'
```

## Discover everything else

The command tree is large and most subcommands follow the same `list` / `get` / `create` / `update` / `delete` pattern.
Lean on `--help` and `mka1 explore` to find the one you need.
