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

# API

> MCP / Edu endpoints and response format

Example base URL:

```text theme={null}
https://edu.daven.ai/api/v1/mcp-proxy
```

OpenAPI: [`/edu/openapi.yaml`](/edu/openapi.yaml)

## Endpoints

| Method | Path                | Auth     | Description               |
| ------ | ------------------- | -------- | ------------------------- |
| `GET`  | `/health`           | none     | Health check              |
| `GET`  | `/api/account`      | required | Account / quota           |
| `POST` | `/api/quote`        | required | Pre-generation quote      |
| `POST` | `/api/upload-url`   | required | Issue upload URL          |
| `POST` | `/api/media/create` | required | Start generation job      |
| `POST` | `/api/media/get`    | required | Poll generation status    |
| `GET`  | `/api/catalog`      | required | Catalog (`kind`, `query`) |

Request body fields vary by model/tool. Use the same family as Daven Playground / `@davenai/mcp` tool schemas.

## Response format

### Success

```json theme={null}
{
  "status": "success",
  "data": {},
  "code": "",
  "message": ""
}
```

### Error

```json theme={null}
{
  "status": "error",
  "error": {
    "code": "AUTH_001",
    "message": "…",
    "detail": "optional"
  }
}
```

| HTTP  | Meaning                            |
| ----- | ---------------------------------- |
| `200` | Success (also check body `status`) |
| `401` | Auth failed                        |

## Examples

<CodeGroup>
  ```bash Account theme={null}
  curl -sS "$BASE/api/account" \
    -H "Authorization: Bearer $TOKEN" \
    -H "X-Edu-Session: $TOKEN"
  ```

  ```bash Quote theme={null}
  curl -sS -X POST "$BASE/api/quote" \
    -H "Authorization: Bearer $TOKEN" \
    -H "X-Edu-Session: $TOKEN" \
    -H "Content-Type: application/json" \
    -d '{}'
  ```

  ```bash Media create theme={null}
  curl -sS -X POST "$BASE/api/media/create" \
    -H "Authorization: Bearer $TOKEN" \
    -H "X-Edu-Session: $TOKEN" \
    -H "Content-Type: application/json" \
    -d '{}'
  ```

  ```bash Media get theme={null}
  curl -sS -X POST "$BASE/api/media/get" \
    -H "Authorization: Bearer $TOKEN" \
    -H "X-Edu-Session: $TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"id":"MEDIA_OR_JOB_ID"}'
  ```

  ```bash Catalog theme={null}
  curl -sS "$BASE/api/catalog?kind=voices" \
    -H "Authorization: Bearer $TOKEN" \
    -H "X-Edu-Session: $TOKEN"
  ```
</CodeGroup>
