# REST API

The Stratix REST API is the underlying interface the dashboard and SDK both call. If you're building a tool in a language without a Stratix SDK (Go, TypeScript, Ruby, etc.), use the REST API directly.

## Base URL

`https://stratix.layerlens.ai/api/v1`

## Authentication

```http
X-API-Key: ll_xxxxxx...
```

Generate keys at **Premium → Settings → API keys**.

## Common endpoints

| Method | Path                   | Description            |
| ------ | ---------------------- | ---------------------- |
| GET    | `/models`              | List models            |
| GET    | `/models/{id}`         | Get a model            |
| GET    | `/benchmarks`          | List benchmarks        |
| POST   | `/evaluations`         | Create an evaluation   |
| GET    | `/evaluations/{id}`    | Get an evaluation      |
| POST   | `/traces`              | Ingest a trace         |
| GET    | `/traces/{id}`         | Get a trace            |
| POST   | `/judges`              | Create a judge         |
| POST   | `/judge-optimizations` | Run GEPA               |
| POST   | `/trace-evaluations`   | Run a trace evaluation |

Full reference: [API reference](/13.1-sdk-and-apis/api.md).

## curl example

```bash
curl -H "X-API-Key: $LAYERLENS_STRATIX_API_KEY" \
 https://stratix.layerlens.ai/api/v1/models
```

## Errors

| Status | Meaning                  |
| ------ | ------------------------ |
| 200    | Success                  |
| 400    | Bad request (validation) |
| 401    | Unauthenticated          |
| 403    | Forbidden (org/role)     |
| 404    | Not found                |
| 429    | Rate limited             |
| 500    | Server error             |

## Request IDs

Every response includes an `X-Request-ID` header and (where relevant) a `request_id` field in the body. Cite this when filing support tickets.

## Where to next

* [API reference](/13.1-sdk-and-apis/api.md)
* [Python SDK](/6.-build-wire-your-code/sdk-python.md)
* [CLI reference](/13.1-sdk-and-apis/cli.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.layerlens.ai/13.2-surfaces/rest-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
