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

# API Introduction

> Learn about What The LLM API and how to integrate our content and services

# What The LLM API

Welcome to the What The LLM API documentation. Our API allows developers and partners to integrate our AI content, tools, and services into their applications.

<Note>
  The What The LLM API is currently in beta. Contact us at [hello@myllm.news](mailto:hello@myllm.news) for access and partnership opportunities.
</Note>

## Overview

The What The LLM API provides programmatic access to:

<CardGroup cols={2}>
  <Card title="Content Access" icon="book">
    Retrieve articles, tutorials, and magazine content
  </Card>

  <Card title="AI Tools" icon="robot">
    Access our curated AI tools and services
  </Card>

  <Card title="Community Data" icon="users">
    Get community insights and engagement metrics
  </Card>

  <Card title="Learning Resources" icon="graduation-cap">
    Access our educational content and progress tracking
  </Card>
</CardGroup>

## Getting Started

### Authentication

All API requests require authentication using an API key:

```bash theme={null}
curl -H "Authorization: Bearer YOUR_API_KEY" \
     https://api.myllm.news/v1/content
```

### Base URL

```
https://api.myllm.news/v1/
```

### Rate Limits

* **Free tier**: 100 requests per hour
* **Subscriber tier**: 1,000 requests per hour
* **Partner tier**: 10,000 requests per hour

## Available Endpoints

### Content Endpoints

<AccordionGroup>
  <Accordion title="GET /content/articles">
    Retrieve published articles and blog posts

    **Parameters:**

    * `limit`: Number of articles to return (default: 10, max: 100)
    * `offset`: Pagination offset
    * `category`: Filter by content category
    * `date_from`: Filter articles from specific date
    * `date_to`: Filter articles to specific date
  </Accordion>

  <Accordion title="GET /content/magazines">
    Access magazine issues and content

    **Parameters:**

    * `issue`: Specific issue number
    * `year`: Filter by publication year
    * `subscriber_only`: Include subscriber-only content (requires subscription)
  </Accordion>

  <Accordion title="GET /content/tutorials">
    Retrieve tutorial content and guides

    **Parameters:**

    * `difficulty`: Filter by difficulty level (beginner, intermediate, advanced)
    * `topic`: Filter by AI topic or technology
    * `format`: Content format (text, video, interactive)
  </Accordion>
</AccordionGroup>

### AI Tools Endpoints

<AccordionGroup>
  <Accordion title="GET /tools">
    List available AI tools and services

    **Parameters:**

    * `category`: Tool category (nlp, vision, audio, etc.)
    * `pricing`: Filter by pricing model (free, paid, freemium)
    * `rating`: Minimum rating threshold
  </Accordion>

  <Accordion title="GET /tools/{tool_id}">
    Get detailed information about a specific AI tool

    **Response includes:**

    * Tool description and features
    * Pricing information
    * User ratings and reviews
    * Integration examples
    * Alternative tools
  </Accordion>

  <Accordion title="POST /tools/recommend">
    Get AI tool recommendations based on requirements

    **Request body:**

    ```json theme={null}
    {
      "use_case": "content creation",
      "budget": "under_50",
      "experience_level": "beginner",
      "features_required": ["text_generation", "editing"]
    }
    ```
  </Accordion>
</AccordionGroup>

### Community Endpoints

<AccordionGroup>
  <Accordion title="GET /community/stats">
    Get community engagement statistics

    **Response includes:**

    * Total community members
    * Active discussions
    * Popular topics
    * Engagement metrics
  </Accordion>

  <Accordion title="GET /community/discussions">
    Retrieve community discussions and topics

    **Parameters:**

    * `topic`: Filter by discussion topic
    * `popularity`: Sort by engagement level
    * `recent`: Show recent discussions only
  </Accordion>
</AccordionGroup>

## Response Format

All API responses follow a consistent JSON format:

```json theme={null}
{
  "success": true,
  "data": {
    // Response data here
  },
  "meta": {
    "total": 150,
    "limit": 10,
    "offset": 0,
    "has_more": true
  },
  "timestamp": "2025-01-09T12:00:00Z"
}
```

### Error Responses

```json theme={null}
{
  "success": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The provided API key is invalid or expired",
    "details": "Please check your API key and ensure it's correctly formatted"
  },
  "timestamp": "2025-01-09T12:00:00Z"
}
```

## Common Error Codes

<AccordionGroup>
  <Accordion title="Authentication Errors">
    * `INVALID_API_KEY`: API key is invalid or expired
    * `MISSING_API_KEY`: No API key provided
    * `INSUFFICIENT_PERMISSIONS`: API key lacks required permissions
  </Accordion>

  <Accordion title="Rate Limiting">
    * `RATE_LIMIT_EXCEEDED`: Too many requests in time window
    * `QUOTA_EXCEEDED`: Monthly quota limit reached
  </Accordion>

  <Accordion title="Request Errors">
    * `INVALID_PARAMETERS`: Request parameters are invalid
    * `RESOURCE_NOT_FOUND`: Requested resource doesn't exist
    * `VALIDATION_ERROR`: Request data failed validation
  </Accordion>
</AccordionGroup>

## SDK and Libraries

### Official SDKs

<CardGroup cols={2}>
  <Card title="Python SDK" icon="python">
    ```bash theme={null}
    pip install myllm-api
    ```

    Full Python integration with async support
  </Card>

  <Card title="JavaScript SDK" icon="js">
    ```bash theme={null}
    npm install @myllm/api
    ```

    Works in Node.js and browser environments
  </Card>
</CardGroup>

### Community Libraries

* **PHP**: `composer require myllm/api-client`
* **Ruby**: `gem install myllm-api`
* **Go**: `go get github.com/myllm/go-api`

## Example Usage

### Python Example

```python theme={null}
import myllm

# Initialize client
client = myllm.Client(api_key="your_api_key")

# Get recent articles
articles = client.content.articles(limit=5, category="ai-tools")

for article in articles:
    print(f"{article.title} - {article.published_date}")
```

### JavaScript Example

```javascript theme={null}
import { MyllmAPI } from '@myllm/api';

const client = new MyllmAPI('your_api_key');

// Get AI tool recommendations
const recommendations = await client.tools.recommend({
  use_case: 'content creation',
  budget: 'under_50',
  experience_level: 'beginner'
});

console.log(recommendations);
```

## Webhooks

Subscribe to real-time updates about new content and community activity:

### Available Events

* `content.published`: New article or tutorial published
* `magazine.released`: New magazine issue available
* `tool.added`: New AI tool added to database
* `community.milestone`: Community reaches engagement milestone

### Webhook Setup

```bash theme={null}
curl -X POST https://api.myllm.news/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-app.com/webhooks/myllm",
    "events": ["content.published", "magazine.released"]
  }'
```

## Support and Resources

<CardGroup cols={2}>
  <Card title="API Documentation" icon="book">
    Detailed endpoint documentation and examples
  </Card>

  <Card title="Developer Community" icon="users">
    Connect with other developers using our API
  </Card>

  <Card title="Status Page" icon="chart-line">
    Monitor API uptime and performance
  </Card>

  <Card title="Support" icon="headset">
    Get help from our technical support team
  </Card>
</CardGroup>

## Getting API Access

<Steps>
  <Step title="Contact Us">
    Email [hello@myllm.news](mailto:hello@myllm.news) to request API access
  </Step>

  <Step title="Use Case Review">
    Tell us about your intended use case and integration plans
  </Step>

  <Step title="API Key Generation">
    Receive your API key and access credentials
  </Step>

  <Step title="Integration Support">
    Get help with implementation and best practices
  </Step>
</Steps>

<Warning>
  The API is currently in beta. Features and endpoints may change. We'll provide advance notice of any breaking changes.
</Warning>

***

*Ready to integrate What The LLM into your application? Contact us to get started with API access.*
