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

# Connect Cloud AI APIs and Integrations to Origami AI

> Connect OpenAI-compatible providers, authenticate with Pollinations for Shorts visuals, and configure Gemini for in-app video analysis.

Origami AI works with **zero API keys** out of the box. Local WebLLM handles narration and chat, Kokoro.js handles speech synthesis, and FFmpeg.wasm handles video rendering—all entirely in your browser. Cloud providers are optional, letting you extend capabilities, increase model quality, or use Origami AI as a powerful front-end on providers you already pay for.

***

## OpenAI-Compatible APIs

Open **⚙️ Settings → API** to connect any OpenAI-compatible cloud provider.

### Configuration Fields

| Field                 | Description                                                                                    |
| --------------------- | ---------------------------------------------------------------------------------------------- |
| **Endpoint base URL** | The root URL for the provider's OpenAI-compatible API                                          |
| **Model name**        | The model identifier sent with each request (e.g. `gpt-4o`, `gemini-2.0-flash`)                |
| **API key**           | Your provider secret key — stored in your browser's IndexedDB, never sent to Origami's servers |

**Common endpoint URLs:**

```text theme={null}
# OpenAI
https://api.openai.com/v1

# Google Gemini (OpenAI-compatible path)
https://generativelanguage.googleapis.com/v1beta/openai/

# OpenRouter
https://openrouter.ai/api/v1

# Groq
https://api.groq.com/openai/v1

# Ollama (self-hosted, local)
http://localhost:11434/v1
```

### Supported Providers

| Provider          | Notes                                                                 |
| ----------------- | --------------------------------------------------------------------- |
| **OpenAI**        | GPT-4o, GPT-4o-mini, and any OpenAI-hosted model                      |
| **Google Gemini** | Gemini 2.0 Flash, Gemini 1.5 Pro, etc. via the OpenAI-compatible path |
| **Groq**          | Extremely fast inference for Llama and Mixtral models                 |
| **OpenRouter**    | Unified access to hundreds of open and proprietary models             |
| **Ollama**        | Run models locally with a self-hosted OpenAI-compatible server        |

### Use Cases

Once connected, enable the cloud API for specific features using the per-feature checkboxes:

| Checkbox                  | What it controls                           |
| ------------------------- | ------------------------------------------ |
| **Use for OCR**           | PDF text extraction via the cloud model    |
| **Use for script fixing** | AI-assisted narration script repair        |
| **Use for slide gen**     | Narration script generation for each slide |
| **Use for Assistant**     | AI Assistant chat sessions                 |

***

## Pollinations (Shorts Visual Generation)

The [Shorts generator](/features/shorts-generator) produces AI images and video clips for each scene using [Pollinations](https://pollinations.ai). Connect your own Pollinations account for higher rate limits, or use the free public tier without any account.

### Connecting Your Account

<Steps>
  <Step title="Open Settings → API">
    Click **⚙️ Settings** in the header, then select the **API** tab.
  </Step>

  <Step title="Connect with Pollinations">
    Under **Pollinations Account**, click **Connect with Pollinations**. An OAuth window opens—sign in and grant token access.
  </Step>

  <Step title="Confirm the connection">
    After authorizing, your account name appears next to the button. Origami AI stores your OAuth token (`sk_...`) locally in your browser and uses it for all Shorts generation requests.
  </Step>
</Steps>

If your token expires, the button changes to **Reconnect**—click it to refresh authorization.

### Free Fallback

If you don't have a Pollinations account, select the **free** model option in the Shorts composer's model dropdown. This uses Pollinations' rate-limited public tier—generation is slower but requires no account or key.

### Available Image Models

| Model        | Style                                           |
| ------------ | ----------------------------------------------- |
| `flux`       | High-quality photorealistic and artistic images |
| `zimage`     | Fast, stylized image generation                 |
| `nanobanana` | Lightweight model for quick thumbnails          |
| `krea`       | Creative and illustrative output                |

### Available Video Models

| Model               | Notes                                      |
| ------------------- | ------------------------------------------ |
| `wan-fast`          | Fast text-to-video clips for Shorts scenes |
| `seedance-2.0-fast` | High-quality short video generation        |

***

## Video Analysis (Gemini)

The **Analyze Video** feature uploads an MP4 to a vision-capable model and returns a timestamped scene breakdown. Gemini's multimodal API is the recommended backend for this feature.

### Setting Up Gemini for Video Analysis

<Steps>
  <Step title="Get a Gemini API key">
    Visit [Google AI Studio](https://aistudio.google.com/app/apikey) and create a free API key.
  </Step>

  <Step title="Configure the endpoint in Settings → API">
    Set your **Endpoint base URL** to the Gemini OpenAI-compatible path:

    ```text theme={null}
    https://generativelanguage.googleapis.com/v1beta/openai/
    ```

    Enter your API key in the **API key** field and set a vision-capable model name such as `gemini-2.0-flash` or `gemini-1.5-pro`.
  </Step>

  <Step title="Enable video analysis">
    Navigate to the AI Assistant or Video Analysis feature and upload your MP4. Origami AI routes the request through your configured Gemini endpoint.
  </Step>
</Steps>

***

<Note>
  All API keys are stored exclusively in your browser's local IndexedDB. They are never transmitted to Origami AI's servers and are not included in any analytics, telemetry, or error reports.
</Note>

<Warning>
  Keep your API keys private. Never share them in public repositories, screenshots, or support tickets. If a key is exposed, rotate it immediately in your provider's dashboard. Leaked keys can result in unexpected charges or quota exhaustion on your account.
</Warning>
