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

# Nyx API Reference

> Complete reference for the Nyx adversarial audit REST API

## Overview

Nyx is Fabraix's offensive AI agent. You define the target, objective, and budget; Nyx works against it until it finds a vulnerability or exhausts the budget.

Most users interact with Nyx through the [`@fabraix/nyx`](https://github.com/fabraix/nyx) CLI. The endpoints documented here are what the CLI calls under the hood - use them directly to integrate Nyx into CI/CD pipelines or custom tooling.

<Note>
  Nyx is built on our research work, including [ACE (Adversarial Cost to Exploit)](https://fabraix.com/blog), a dynamic benchmark measuring the token expenditure an adversary must invest to breach an LLM-backed agent.
</Note>

<Note>
  Nyx is currently a small, focused API: submit a run, poll for status, download the report. Most workflows only need three endpoints.
</Note>

## Base URL

```
https://api.fabraix.com/v1
```

## Authentication

Unlike Arx (which uses `x-api-key`), Nyx authenticates with a verification token issued by `nyx login` or stored in the `NYX_TOKEN` environment variable. Pass it in the `X-Verification-Token` header:

```bash theme={null}
curl -H "X-Verification-Token: $NYX_TOKEN" https://api.fabraix.com/v1/nyx/runs
```

## Available Endpoints

<CardGroup cols={1}>
  <Card title="POST /nyx/runs" icon="play" href="/api-reference/nyx/endpoint/submit-run">
    Submit a new adversarial audit run
  </Card>

  <Card title="GET /nyx/runs/{run_id}" icon="magnifying-glass" href="/api-reference/nyx/endpoint/get-run">
    Poll run status, spend, and findings count
  </Card>

  <Card title="GET /nyx/runs/{run_id}/report" icon="file-lines" href="/api-reference/nyx/endpoint/get-report">
    Download the full markdown audit report once a run completes
  </Card>
</CardGroup>

## Install the CLI

```bash theme={null}
npm install -g @fabraix/nyx
nyx login
nyx run playground.yaml
```

See the [Nyx README](https://github.com/fabraix/nyx) for full CLI usage.
