MDX.org.ai
UI ComponentsContent

API

API documentation with endpoints, schemas, and interactive examples

Interactive API documentation with endpoint explorer, request builder, and schema viewer.

Structure

┌───────────┬─────────────────────────────────────────┐
│ nav       │ header                                  │
│ ┌───────┐ │ ┌─────────────────────────────────────┐ │
│ │Endpts │ │ │ title          v2.0  [server ▾]    │ │
│ │       │ │ │ description                        │ │
│ │ GET / │ │ └─────────────────────────────────────┘ │
│ │ POST  │ ├─────────────────────────────────────────┤
│ │ GET   │ │ auth                                    │
│ │ ...   │ │ ┌─────────────────────────────────────┐ │
│ │       │ │ │ Bearer Token                        │ │
│ │Schemas│ │ │ Authorization: Bearer <token>       │ │
│ │       │ │ └─────────────────────────────────────┘ │
│ │ User  │ ├─────────────────────────────────────────┤
│ │ Post  │ │ endpoint                                │
│ │ ...   │ │ ┌─────────────────────────────────────┐ │
│ └───────┘ │ │ GET  /users/{id}                    │ │
│           │ │ Get user by ID                       │ │
│           │ ├─────────────────────────────────────┤ │
│           │ │ Parameters                           │ │
│           │ │ ┌─────────────────────────────────┐ │ │
│           │ │ │ id  string  required  User ID   │ │ │
│           │ │ └─────────────────────────────────┘ │ │
│           │ ├─────────────────────────────────────┤ │
│           │ │ Responses                            │ │
│           │ │ 200  User object                     │ │
│           │ │ 404  Not found                       │ │
│           │ ├─────────────────────────────────────┤ │
│           │ │ Example                              │ │
│           │ │ ┌─────────────────────────────────┐ │ │
│           │ │ │ { "id": "123", "name": "..." }  │ │ │
│           │ │ └─────────────────────────────────┘ │ │
│           │ │                        [Try it] │ │ │
│           │ └─────────────────────────────────────┘ │
└───────────┴─────────────────────────────────────────┘

Usage

<API
  title="Users API"
  description="Manage users in your application"
  version="2.0"
  baseUrl="https://api.example.com"
  servers={[
    { url: 'https://api.example.com', description: 'Production' },
    { url: 'https://staging.api.example.com', description: 'Staging' },
  ]}
  auth={{
    type: 'bearer',
    description: 'Use your API key in the Authorization header',
  }}
  endpoints={[
    {
      method: 'GET',
      path: '/users',
      summary: 'List all users',
      params: [
        { name: 'limit', in: 'query', type: 'integer', default: 20 },
        { name: 'offset', in: 'query', type: 'integer', default: 0 },
      ],
      responses: [
        { status: 200, description: 'List of users', schema: 'User[]' },
      ],
    },
    {
      method: 'GET',
      path: '/users/{id}',
      summary: 'Get user by ID',
      params: [
        { name: 'id', in: 'path', type: 'string', required: true },
      ],
      responses: [
        { status: 200, description: 'User object', schema: 'User' },
        { status: 404, description: 'User not found' },
      ],
    },
  ]}
  schemas={[
    {
      name: 'User',
      properties: {
        id: { type: 'string', description: 'Unique identifier' },
        name: { type: 'string', description: 'Display name' },
        email: { type: 'string', format: 'email' },
      },
    },
  ]}
/>

On this page