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

# API reference

> The unified surface — Anthropic Messages, OpenAI Chat Completions and Responses, legacy Completions, embeddings, token counting, the model catalog, and batches.

One gateway, every protocol your tools already speak. Every endpoint lives under `/v1` at a single origin, authenticated with one `lx1_` key.

## Base URL

All endpoints below are relative to:

```
https://api.layerx1.com
```

Authentication is one key across the whole surface — see [Authentication](/authentication) for which header each dialect expects.

## Endpoints

| Endpoint                                              | What it does                                                                        |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [`POST /v1/chat/completions`](/api/chat-completions)  | OpenAI Chat Completions dialect — messages in, completion out. SSE streaming.       |
| [`POST /v1/messages`](/api/messages)                  | Anthropic Messages dialect — content blocks, tools, vision + PDFs. SSE streaming.   |
| [`POST /v1/responses`](/api/responses)                | OpenAI Responses dialect — the surface Codex CLI speaks. SSE streaming.             |
| [`POST /v1/completions`](/api/completions)            | Legacy text completions for older clients — prompt in, text out.                    |
| [`POST /v1/embeddings`](/api/embeddings)              | Seven embedding models, 384 to 2048 dimensions — memory and retrieval next to chat. |
| [`POST /v1/messages/count_tokens`](/api/count-tokens) | Token estimate for a Messages request body, for context budgeting.                  |
| [`POST /v1/messages/batches`](/api/batches)           | Async batches — up to 1,000 requests per submission, results as JSONL.              |
| [`GET /v1/models`](/models)                           | The self-describing model catalog: ids, capabilities, limits, list pricing.         |

<Note>
  `GET /v1/models/{id}` returns a single catalog entry. Batches also exist in an OpenAI flavor at `/v1/batches` with the same lifecycle — see [Batches](/api/batches).
</Note>

## Conventions

Errors are standard HTTP status codes with a JSON body shaped for the protocol you called ([Errors](/errors)). Responses carry a small, fixed set of `x1-` and `x-ratelimit-` headers ([Headers](/headers)). Streaming is Server-Sent Events on every chat endpoint ([Streaming](/guides/streaming)).
