> ## Documentation Index
> Fetch the complete documentation index at: https://haider-5d8ca6e7.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Complete reference for the Skimming AI REST API

## Overview

The Skimming AI API lets you build **chat-with-your-content** experiences programmatically. Upload files, ingest URLs, and chat with any content type.

***

## Base URL

```
https://app.skimming.ai/back
```

For staging/testing:

```
https://staging-app.skimming.ai/back
```

***

## Authentication

All requests require a **Bearer token** in the `Authorization` header.

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

<Warning>
  Never expose your API key in client-side code. Use server-side requests only.
</Warning>

***

## Required Headers

Every API request must include these headers:

| Header          | Value                                       | Required |
| --------------- | ------------------------------------------- | -------- |
| `Authorization` | `Bearer YOUR_API_KEY`                       | ✅ Yes    |
| `Content-Type`  | `application/json` or `multipart/form-data` | ✅ Yes    |

***

## Core Workflow

<Steps>
  <Step title="Ingest">
    Upload a file or URL to get a `file_id`.

    **Endpoints:**

    * `POST /source/v1/api/document` — Documents, images, audio, video
    * `POST /source/v1/api/youtube` — YouTube videos
    * `POST /source/v1/api/website` — Websites and social posts
  </Step>

  <Step title="Chat">
    Use the `file_id` to ask questions about the content.

    **Endpoints:**

    * `POST /chat/v1/api/document/{type}` — PDF, XLSX, PPTX, TXT, EPUB
    * `POST /chat/v1/api/image/{type}` — JPG, PNG, GIF, WebP, etc.
    * `POST /chat/v1/api/video/{type}` — YouTube, MP4, MOV, etc.
    * `POST /chat/v1/api/audio/{type}` — MP3, WAV, OGG, etc.
    * `POST /chat/v1/api/website/{type}` — Website, Instagram, X, LinkedIn, Facebook
  </Step>
</Steps>

***

## Request Format

### Ingest Request (File Upload)

```bash theme={null}
curl -X POST https://app.skimming.ai/back/source/v1/api/document \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "source=@document.pdf"
```

### Chat Request (JSON)

```bash theme={null}
curl -X POST https://app.skimming.ai/back/chat/v1/api/document/pdf \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "abc123-def456-ghi789",
    "question": "What is this document about?",
    "streaming": false
  }'
```

***

## Response Format

### Success Response

```json theme={null}
{
  "success": true,
  "data": "The AI-generated answer...",
  "error": null,
  "message": {
    "content": null,
    "displayContent": true
  }
}
```

### Error Response

```json theme={null}
{
  "success": false,
  "error": {},
  "message": {
    "content": "Error description",
    "displayContent": true
  }
}
```

***

## Streaming

Set `"streaming": true` to receive responses as **Server-Sent Events (SSE)**.

```json theme={null}
{
  "file_id": "abc123",
  "question": "Summarize this",
  "streaming": true
}
```

The response will stream in `text/event-stream` format.

***

## Models

Specify the AI model with `model` and `model_type`:

| Provider  | `model_type` | Available Models                                  |
| --------- | ------------ | ------------------------------------------------- |
| OpenAI    | `openai`     | `gpt-4o-mini`, `gpt-4o`, `gpt-4`, `gpt-3.5-turbo` |
| Anthropic | `anthropic`  | `claude-3-sonnet`, `claude-3.5-sonnet`            |
| Google    | `gemini`     | `gemini-1.5-flash`, `gemini-1.5-pro`              |

***

## Rate Limits & Credits

| Feature     | Free Plan     | Paid Plans    |
| ----------- | ------------- | ------------- |
| Credits     | \~1,000/month | Based on plan |
| File Size   | 5 MB          | Up to 200 MB  |
| Video/Audio | 480 minutes   | Based on plan |

**Credit usage per model:**

* GPT-4o Mini / Gemini Flash: **1 credit**
* GPT-4o: **5 credits**
* Gemini Pro: **16 credits**
* Claude 3.5/3.7: **25 credits**
* GPT-4: **100 credits**

***

## HTTP Status Codes

| Code  | Description                         |
| ----- | ----------------------------------- |
| `200` | Success                             |
| `400` | Bad request — invalid parameters    |
| `401` | Unauthorized — invalid API key      |
| `402` | Payment required — credits exceeded |
| `500` | Server error                        |

***
