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

# API Reference Overview

> Overview of Muxx APIs for gateway and programmatic access.

Muxx provides two main APIs:

## Gateway API

The gateway is an OpenAI-compatible and Anthropic-compatible proxy:

* **Base URL:** `https://gateway.muxx.dev/v1`
* **Authentication:** `X-Muxx-Api-Key` header
* **Endpoints:** Standard provider endpoints

<CardGroup cols={2}>
  <Card title="Chat Completions" href="/api-reference/chat-completions">
    OpenAI-compatible chat endpoint
  </Card>

  <Card title="Messages" href="/api-reference/messages">
    Anthropic-compatible messages endpoint
  </Card>
</CardGroup>

## Management API

Programmatically access logs, analytics, and settings:

* **Base URL:** `https://api.muxx.dev/v1`
* **Authentication:** Bearer token with Muxx API key

### Endpoints

| Endpoint              | Description         |
| --------------------- | ------------------- |
| `GET /logs`           | List request logs   |
| `GET /logs/{id}`      | Get log details     |
| `GET /analytics`      | Get usage analytics |
| `GET /prompts`        | List prompts        |
| `GET /prompts/{name}` | Get prompt content  |

## Authentication

All API requests require authentication:

```bash theme={null}
# Gateway
curl https://gateway.muxx.dev/v1/chat/completions \
  -H "X-Muxx-Api-Key: muxx_sk_live_xxxxxxxxxxxx"

# Management API
curl https://api.muxx.dev/v1/logs \
  -H "Authorization: Bearer muxx_sk_live_xxxxxxxxxxxx"
```

## Rate Limits

| Plan       | Requests/min | Requests/day |
| ---------- | ------------ | ------------ |
| Free       | 60           | 1,000        |
| Pro        | 600          | 100,000      |
| Enterprise | Custom       | Custom       |

## Errors

All APIs return standard error responses:

```json theme={null}
{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}
```

| Status | Meaning               |
| ------ | --------------------- |
| 400    | Bad request           |
| 401    | Authentication failed |
| 403    | Permission denied     |
| 429    | Rate limited          |
| 500    | Server error          |
