> For the complete documentation index, see [llms.txt](https://vayl.gitbook.io/vayl-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vayl.gitbook.io/vayl-docs/api-reference/vayl-http-api.md).

# Vayl HTTP API

The routes vayl-server serves, the transport your agents connect to, and how requests are authenticated.

`vayl-server` serves Vayl's MCP tools over the Model Context Protocol's **streamable HTTP** transport at `POST /mcp`, plus health probes and Prometheus metrics. There is no separate REST route per tool: every memory operation is an MCP `tools/call`. The tools themselves are documented in [MCP tools](https://vayl.gitbook.io/vayl-docs/documentation/reference/mcp-tools).

| Route          | Auth                          | Purpose                                                |
| -------------- | ----------------------------- | ------------------------------------------------------ |
| `POST /mcp`    | API key or OIDC token         | MCP JSON-RPC: `initialize`, `tools/list`, `tools/call` |
| `GET /healthz` | none                          | Liveness                                               |
| `GET /readyz`  | none                          | Readiness (checks the database)                        |
| `GET /metrics` | none, or `VAYL_METRICS_TOKEN` | Prometheus counters                                    |

## Authenticate

Send `Authorization: Bearer <credential>` on every `/mcp` request:

* **API key** (`vayl_sk_…`), created with the `create_principal` tool and shown once.
* **OIDC ID token**, with an Enterprise license granting `sso`.

The server speaks plain HTTP. Terminate TLS at a reverse proxy or ingress.

## Try it

```bash
curl -s -X POST http://127.0.0.1:8080/mcp \
  -H "Authorization: Bearer $VAYL_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"license_status","arguments":{}}}'
```

The response is a server-sent-events stream; its `data:` line holds the JSON-RPC result.

{% hint style="info" %}
This reference is generated from [`openapi/vayl-server.yaml`](https://github.com/vayl-dev/vayl/blob/main/openapi/vayl-server.yaml) in the repository, which a test keeps in step with the server's routes.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://vayl.gitbook.io/vayl-docs/api-reference/vayl-http-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
