# keryn api compile

Describes Keryn 0.5.2 and keryn-rules 0.8.0.

> keryn api compile: author API security regressions from OpenAPI or HAR

Source: https://keryn.dev/docs/reference/cli/api-compile/

> **Caution: Next release: keryn api compile**
> On main; not in Keryn 0.5.2, the latest release.

Author API security regressions from OpenAPI or HAR.

```text
keryn api compile <review.json> --out <new-directory> [--json]
```

## Options

```text
Usage: keryn api import <file> --format openapi|har --target <origin> --application <id> --revision <revision> --out <new-directory>
       keryn api compile <review.json> --out <new-directory> [--json]
       keryn api validate <suite.json> [--json]
       keryn api run <suite.json> --out <new-directory> [--suite-sha256 <digest>] [--timeout <seconds>] [--json]
       keryn api review <receipt.json> --suite <suite.json> --baseline <receipt.json> --baseline-suite <suite.json> --out <new-directory>
Import OpenAPI 3.0/3.1 JSON/YAML or HAR locally. No references are fetched; drafts cannot execute.
Compile an explicitly authored api-suite-review/v1 into the existing AI security suite contract.
Validate and compile send no requests. Run executes reviewed requests and may change target state.
The browser API Workbench authors these reviews. Existing ai-test packs/init/verify remain available.
```

## Examples

```sh
# Sends no requests.
keryn api compile review.json --out out/suite
```

## Exit codes

| Code | Meaning |
|---|---|
| 0 | pass |
| 1 | findings or a requested change gate |
| 2 | usage error or invalid input |
| 3 | incomplete or unknown completion |
| 4 | execution or normalization failure |
