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

# Quickstart

# Quick Start

Jump into using Mountsea AI's API with our Quick Start guide. Learn how to get your API key and make your first API call!

## What You Need

* A Mountsea AI platform account ([Sign up here](https://shanhaiapi.com))
* An API key

## Get Your API Key

<Steps>
  <Step title="Sign Up">
    Sign up for Mountsea AI at [shanhaiapi.com](https://shanhaiapi.com).
  </Step>

  <Step title="Create API Key">
    Go to the **API Keys** page and click **Create New Key**. Enter a unique name for your key and click **Save**.
  </Step>

  <Step title="Copy Your Key">
    On the API Keys page, click the copy icon next to your key to copy it to your clipboard.
  </Step>
</Steps>

## Configure Your HTTP Request

All API requests require authentication via Bearer token:

```bash theme={null}
Authorization: Bearer your-api-key
```

**Base URL**: `https://api.mountsea.ai`

***

## Quick Examples

### ⚡ Hub — One Endpoint, Many Premium Models

Hub aggregates premium AI models behind a single uniform API. **Flagship-quality outputs, production-grade stability, at a discount versus the official price.** Switch models by simply changing the `model` field.

```bash theme={null}
# Generate an image with Nano Banana Pro via Hub
curl -X POST "https://api.mountsea.ai/hub/v1/image" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-pro",
    "input": {
      "prompt": "A photorealistic black labrador swimming, half above water, half underwater",
      "resolution": "2K",
      "aspect_ratio": "1:1"
    }
  }'
# → { "task_id": "hub-xxxxxxxx-..." }

# Poll the result
curl -H "Authorization: Bearer your-api-key" \
  "https://api.mountsea.ai/hub/v1/tasks/hub-xxxxxxxx-..."
```

Want a video instead? Change the endpoint + model:

```bash theme={null}
curl -X POST "https://api.mountsea.ai/hub/v1/video" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "veo-3.1-fast",
    "input": {
      "prompt": "Cinematic drone shot flying through ancient stone ruins at golden hour",
      "duration": "8s",
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "generate_audio": true
    }
  }'
```

<Tip>
  **Discover models on the fly**: `GET /hub/v1/models?capability=video` returns every available video model with full `input_schema` + a ready-to-copy `example` payload.
</Tip>

***

### 🎬 Generate Video with Gemini (Veo 3.1)

#### Step 1: Create a video generation task

```bash theme={null}
curl -X POST "https://api.mountsea.ai/gemini/video/generate" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A fluffy orange cat running through a sunny meadow",
    "action": "text2video",
    "model": "veo31_fast",
    "aspectRatio": "16:9"
  }'
```

**Response:**

```json theme={null}
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

#### Step 2: Poll for task result

Use the returned `taskId` to check the generation status:

```bash theme={null}
curl -X GET "https://api.mountsea.ai/gemini/task/result?taskId=your-task-id" \
  -H "Authorization: Bearer your-api-key"
```

**Response (completed):**

```json theme={null}
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "completed",
  "result": {
    "video_url": "https://..."
  },
  "createdAt": "2026-01-01T12:00:00Z",
  "finishedAt": "2026-01-01T12:02:30Z"
}
```

<Tip>
  Poll the task status endpoint every few seconds until `status` changes to `completed`. Possible statuses: `pending`, `ready`, `assigned`, `processing`, `completed`, `failed`, `cancelled`, `timeout`.
</Tip>

***

### 🖼️ Generate Image with Gemini (Nano Banana)

```bash theme={null}
curl -X POST "https://api.mountsea.ai/gemini/image/generate" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic city skyline at night, neon lights reflecting on wet streets",
    "action": "generate",
    "model": "nano-banana-fast",
    "aspect_ratio": "16:9"
  }'
```

**Response:**

```json theme={null}
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

Then poll `/gemini/task/result?taskId=your-task-id` to get the generated image.

<Note>
  Available image models: `nano-banana-fast`, `nano-banana-pro` (supports 1K/2K/4K resolution), `nano-banana-2` (supports extended aspect ratios).
</Note>

***

### 🚧 Sora2 — Currently Unavailable

<Warning>
  **Sora2 is currently UNAVAILABLE on Mountsea.** Endpoints `/sora/*` will be rejected at the gateway. For video generation, please use one of the alternatives:

  * [Hub — Premium AI Gateway](api-reference/hub/introduction) — Veo 3.1, Kling v3, WAN 2.7, Seedance 2.0 (recommended)
  * [Gemini Video (Veo 2 / 3 / 3.1)](api-reference/gemini/video-introduction)
  * [XAI (Grok) Video](api-reference/xai/introduction)
</Warning>

***

### 🎵 Generate Music with Suno

#### Step 1: Create a music generation task

```bash theme={null}
curl -X POST "https://api.mountsea.ai/suno/v2/generate" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "task": "create",
    "model": "chirp-v55",
    "tags": "Pop, Happy, Upbeat",
    "prompt": "[Verse]\nHello world, here I come\nShining bright like the morning sun\n\n[Chorus]\nLa la la, sing with me\nFeel the rhythm, feel the beat",
    "title": "Hello World"
  }'
```

**Response:**

```json theme={null}
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

#### Step 2: Poll for task status

```bash theme={null}
curl -X GET "https://api.mountsea.ai/suno/v2/status?taskId=your-task-id" \
  -H "Authorization: Bearer your-api-key"
```

**Response (success):**

```json theme={null}
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "success",
  "data": {
    "...": "clip data with audio URLs"
  },
  "createdAt": "2026-01-01T12:00:00Z",
  "finishAt": "2026-01-01T12:01:30Z"
}
```

***

### 🎹 Generate Music with Producer

#### Step 1: Create a music generation task

```bash theme={null}
curl -X POST "https://api.mountsea.ai/producer/audios" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "create_music",
    "model": "Lyria 3 Pro",
    "title": "Summer Vibes",
    "soundPrompt": "emotional pop with gentle piano, warm synths, and a catchy beat",
    "lyrics": "[Verse]\nSunshine on my face today\nEverything is going my way\n\n[Chorus]\nSummer vibes, feeling alive\nDancing through the day and night",
    "makeInstrumental": false
  }'
```

**Response:**

```json theme={null}
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

#### Step 2: Poll for task result

```bash theme={null}
curl -X GET "https://api.mountsea.ai/producer/tasks?taskId=your-task-id" \
  -H "Authorization: Bearer your-api-key"
```

**Response (completed):**

```json theme={null}
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "completed",
  "result": {
    "...": "audio data with download info"
  },
  "createdAt": "2026-01-01T12:00:00Z",
  "finishedAt": "2026-01-01T12:02:00Z"
}
```

***

### 💬 Chat with LLM (OpenAI Compatible)

Use the OpenAI SDK directly — just change the `base_url`:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(
        api_key="your-api-key",
        base_url="https://api.mountsea.ai/chat"
    )

    response = client.chat.completions.create(
        model="gpt-5.1",
        messages=[
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "Hello!"}
        ]
    )

    print(response.choices[0].message.content)
    ```
  </Tab>

  <Tab title="Node.js">
    ```javascript theme={null}
    import OpenAI from 'openai';

    const client = new OpenAI({
        apiKey: 'your-api-key',
        baseURL: 'https://api.mountsea.ai/chat'
    });

    const response = await client.chat.completions.create({
        model: 'gpt-5.1',
        messages: [
            { role: 'system', content: 'You are a helpful assistant.' },
            { role: 'user', content: 'Hello!' }
        ]
    });

    console.log(response.choices[0].message.content);
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.mountsea.ai/chat/v1/chat/completions" \
      -H "Authorization: Bearer your-api-key" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-5.1",
        "messages": [
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Hello!"}
        ]
      }'
    ```
  </Tab>
</Tabs>

### 💬 Use Claude Code

Configure environment variables to use Claude Code with our API:

```bash theme={null}
export ANTHROPIC_API_KEY="your-api-key"
export ANTHROPIC_BASE_URL="https://api.mountsea.ai/chat/claude"

# Launch Claude Code
claude
```

<Warning>
  **Note**: Claude Code uses Base URL `https://api.mountsea.ai/chat/claude`, which is different from other protocols that use `https://api.mountsea.ai/chat`.
</Warning>

***

## Async Task Pattern

Most generation services (Hub, Gemini, OpenAI, XAI, Suno, ElevenLabs, Producer) follow an **async task pattern**:

```
1. POST request → returns taskId
2. Poll GET endpoint with taskId → returns status + result when done
```

| Service                      | Create Task                                                                 | Poll Status                                 |
| ---------------------------- | --------------------------------------------------------------------------- | ------------------------------------------- |
| **Hub**                      | `POST /hub/v1/{image\|video\|audio\|transcribe}`                            | `GET /hub/v1/tasks/:task_id`                |
| **Gemini**                   | `POST /gemini/video/generate`                                               | `GET /gemini/task/result?taskId=xxx`        |
| **Gemini Image**             | `POST /gemini/image/generate`                                               | `GET /gemini/task/result?taskId=xxx`        |
| **🚧 Sora2** *(unavailable)* | ~~`POST /sora/video/generate`~~                                             | ~~`GET /sora/task/result?taskId=xxx`~~      |
| **XAI**                      | `POST /xai/images` or `POST /xai/videos`                                    | `GET /xai/tasks?taskId=xxx`                 |
| **OpenAI**                   | `POST /openai/images` (async) / `POST /openai/v1/images/generations` (sync) | `GET /openai/tasks?taskId=xxx` (async only) |
| **Suno**                     | `POST /suno/v2/generate`                                                    | `GET /suno/v2/status?taskId=xxx`            |
| **ElevenLabs**               | `POST /eleven/music`                                                        | `GET /eleven/tasks?taskId=xxx`              |
| **Producer**                 | `POST /producer/audios`                                                     | `GET /producer/tasks?taskId=xxx`            |

<Tip>
  **Recommended polling interval**: Every 3-5 seconds. Generated files are stored for **two weeks** — download promptly to avoid losing access.
</Tip>

***

## Next Steps

Now that you've made your first API call, explore more features:

* [API Introduction](introduction) — Full overview of all services
* [Hub Premium AI Gateway](api-reference/hub/introduction) — One endpoint, many premium models (Nano Banana, Veo 3.1, Kling v3, WAN 2.7, Seedance 2.0, ElevenLabs Music, …)
* [Gemini Video & Image](api-reference/gemini/introduction) — Veo 2/3/3.1 video & Nano Banana image generation
* [Gemini Compat (Official SDK)](api-reference/gemini/compat-introduction) — Use Google's `@google/genai` SDK with Mountsea
* [🚧 Sora2 Video](api-reference/sora/introduction) — **currently unavailable**
* [XAI (Grok)](api-reference/xai/introduction) — Grok image & video generation
* [OpenAI GPT Image](api-reference/openai/introduction) — GPT Image 2 generation & editing (async + official `openai` SDK compat)
* [Suno Music](api-reference/suno/introduction) — Music generation, voice persona, custom models, and audio processing
* [ElevenLabs Music](api-reference/eleven/introduction) — AI music with composition plans, video scoring, and stems
* [Producer Music](api-reference/producer/introduction) — AI music generation with Lyria 3 Pro
* [Chat LLM Gateway](api-reference/chat/introduction) — Multi-protocol AI chat with Claude Code support

## Need Help?

If you run into any issues:

* Check our detailed [API Documentation](api-reference/gemini/introduction) for endpoint specs
* Contact our [Support Team](https://shanhaiapi.com) for assistance
* Review the [API Introduction](introduction) for a comprehensive feature overview

***

*Ready to build amazing AI-powered applications? Start creating with Mountsea AI today!*
