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

# Load-test a runtime or Harness

Run a bounded test against a deployed runtime or Harness Infra Harness using Python and Locust. Defaults are 10 virtual users, one new user per second and a 30-second duration. Runtime mode takes a name, ID or direct endpoint and probes /invoke and /run\_sse. Harness mode uses the Environment Key over session events and SSE. CSV, HTML and JSON reports include throughput, latency and failures. Request logs include time to first token. Pass additional Locust arguments after --.

> [!WARNING]
>
> Tests send live traffic and can incur model and runtime charges. Use a target approved for load testing.

## loadtest runtime

`agentkit loadtest runtime [locustArgs...]`

| Option | Description | Default |
| - | - | - |
| `--runtime <id\|name>` | Runtime id (r-...) or name | — |
| `--rev <n>` | Runtime version to test (default: current released version) | — |
| `--region <region>` | cloud region (default: auto-detect) | — |
| `-e, --endpoint <url>` | direct Runtime endpoint (mutually exclusive with --runtime) | — |
| `--apikey <key>` | API key for a direct endpoint | — |
| `--api-key-name <name>` | named API key header/query parameter for a direct endpoint | — |
| `--api-key-location <location>` | API key location: header (default) or query | — |
| `--use-login` | use a saved OIDC session for a compatible custom\_jwt Runtime | Off |
| `--profile <name>` | OIDC profile to use with --use-login (default: active profile) | — |
| `--headers <json>` | extra request headers as a JSON object | — |
| `-u, --users <n>` | concurrent virtual users | 10 |
| `-r, --spawn-rate <n>` | users started per second | 1 |
| `-t, --run-time <duration>` | run duration, e.g. 30s, 5m, 1h | 30s |
| `--timeout <seconds>` | per-request timeout in seconds | 120 |
| `--prompt <text>` | prompt used by the built-in scenario | — |
| `--transport <transport>` | auto, invoke, or run\_sse | auto |
| `--app-name <name>` | ADK app name for run\_sse (default: from /list-apps) | — |
| `--session-mode <mode>` | ADK session mode: per-user, per-request, or fixed | per-user |
| `--session-id <id>` | session id used with --session-mode fixed | — |
| `--payload <json>` | JSON request body for the built-in scenario | — |
| `--path <path>` | request path for the built-in invoke scenario | /invoke |
| `--method <method>` | HTTP method for the built-in invoke scenario | POST |
| `-f, --script <file>` | custom Locust script to run instead of the built-in scenario | — |
| `--locust <bin>` | path to an existing Locust executable | — |
| `--python <bin>` | Python interpreter for Locust and the managed venv | — |
| `--no-install` | do not create the managed Locust venv | — |
| `--keep-script` | keep the generated locustfile and config in the output directory | Off |
| `--output-dir <dir>` | artifact directory (default: ./loadtest-results/`<run-id>`) | — |
| `--csv <prefix>` | CSV path prefix (default: `<output-dir>`/run) | — |
| `--html <file>` | HTML report path (default: `<output-dir>`/report.html) | — |
| `--summary <file>` | summary JSON path (default: `<output-dir>`/summary.json) | — |
| `--no-export` | do not write CSV/HTML/JSON artifacts | — |
| `--max-failure-ratio <ratio>` | exit non-zero when the failure ratio exceeds this value (0..1) | — |
| `--request-log` | write per-request agent metrics to requests.`<pid>`.jsonl | Off |
| `--ttft-include-thought` | count thought tokens as the first token for TTFT | Off |
| `--json` | print only the summary JSON on stdout. progress goes to stderr | Off |
| `--quiet` | reduce Locust's live statistics output | Off |
| `--dry-run` | resolve the target and print the Locust command without running it | Off |

```bash theme={null}
agentkit loadtest runtime --runtime "$RUNTIME_ID" --users 2 --run-time 30s --max-failure-ratio 0.05
```

## loadtest harness

`agentkit loadtest harness [locustArgs...]`

| Option | Description | Default |
| - | - | - |
| `--harness-id <id>` | Harness Infra HarnessId (default: from config state) | — |
| `--environment-id <id>` | Harness Infra Environment ID (default: from config state) | — |
| `--runtime-id <id>` | Harness Infra Runtime ID (default: from config state) | — |
| `--config <path>` | Harness Infra YAML config (default: .agentkit/harness-infra/config.yaml) | — |
| `--state <path>` | workflow state JSON (default: next to the config) | — |
| `--base-url <url>` | Harness Infra data-plane BaseUrl | — |
| `--api-key-env <name>` | environment variable that holds the Environment Key | — |
| `--ark-key-name <name>` | Ark API Key name used for agentkit\_runtime Sessions | — |
| `--agent-loop <loop>` | adk, codex, dsh, or piagent (default: from config) | — |
| `--session-mode <mode>` | Harness session mode: per-user or per-request | per-user |
| `--keep-sessions` | keep Harness Infra Sessions instead of archiving them | Off |
| `--headers <json>` | extra request headers as a JSON object | — |
| `-u, --users <n>` | concurrent virtual users | 10 |
| `-r, --spawn-rate <n>` | users started per second | 1 |
| `-t, --run-time <duration>` | run duration, e.g. 30s, 5m, 1h | 30s |
| `--timeout <seconds>` | per-request timeout in seconds | 120 |
| `--prompt <text>` | prompt used by the built-in scenario | — |
| `--locust <bin>` | path to an existing Locust executable | — |
| `--python <bin>` | Python interpreter for Locust and the managed venv | — |
| `--no-install` | do not create the managed Locust venv | — |
| `--keep-script` | keep the generated locustfile and config in the output directory | Off |
| `--output-dir <dir>` | artifact directory (default: ./loadtest-results/`<run-id>`) | — |
| `--csv <prefix>` | CSV path prefix (default: `<output-dir>`/run) | — |
| `--html <file>` | HTML report path (default: `<output-dir>`/report.html) | — |
| `--summary <file>` | summary JSON path (default: `<output-dir>`/summary.json) | — |
| `--no-export` | do not write CSV/HTML/JSON artifacts | — |
| `--max-failure-ratio <ratio>` | exit non-zero when the failure ratio exceeds this value (0..1) | — |
| `--request-log` | write per-request agent metrics to requests.`<pid>`.jsonl | Off |
| `--ttft-include-thought` | count thought tokens as the first token for TTFT | Off |
| `--json` | print only the summary JSON on stdout. progress goes to stderr | Off |
| `--quiet` | reduce Locust's live statistics output | Off |
| `--dry-run` | resolve the target and print the Locust command without running it | Off |

```bash theme={null}
agentkit loadtest harness --harness-id "$HARNESS_ID" --users 2 --run-time 30s
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.