Skip to main content

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

Get Your API Key

1

Sign Up

Sign up for Mountsea AI at shanhaiapi.com.
2

Create API Key

Go to the API 密钥管理 page and click 创建新密钥 (Create New Key). Enter a unique name for your key and click Save.
3

Copy Your Key

On the API Keys page, click the copy icon next to your key to copy it to your clipboard.

Configure Your HTTP Request

All API requests require authentication via Bearer token:
Authorization: Bearer your-api-key
Base URL: https://api.mountsea.ai

Quick Examples

🎬 Generate Video with Gemini (Veo 3.1)

Step 1: Create a video generation task

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:
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Step 2: Poll for task result

Use the returned taskId to check the generation status:
curl -X GET "https://api.mountsea.ai/gemini/task/result?taskId=your-task-id" \
  -H "Authorization: Bearer your-api-key"
Response (completed):
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "completed",
  "result": {
    "video_url": "https://..."
  },
  "createdAt": "2026-01-01T12:00:00Z",
  "finishedAt": "2026-01-01T12:02:30Z"
}
Poll the task status endpoint every few seconds until status changes to completed. Possible statuses: pending, ready, assigned, processing, completed, failed, cancelled, timeout.

🖼️ Generate Image with Gemini (Nano Banana)

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:
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Then poll /gemini/task/result?taskId=your-task-id to get the generated image.
Available image models: nano-banana-fast, nano-banana-pro (supports 1K/2K/4K resolution), nano-banana-2 (supports extended aspect ratios).

🎥 Generate Video with Sora2

Step 1: Create a video generation task

curl -X POST "https://api.mountsea.ai/sora/video/generate" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A cat running on the road, cinematic lighting",
    "model": "sora-2",
    "orientation": "landscape",
    "duration": 10,
    "removeWatermark": true
  }'
Response:
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Step 2: Poll for task result

curl -X GET "https://api.mountsea.ai/sora/task/result?taskId=your-task-id" \
  -H "Authorization: Bearer your-api-key"
Response (success):
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "success",
  "result": {
    "video_url": "https://...",
    "editId": "xxxxxxxxxx"
  },
  "createdAt": "2026-01-01T12:00:00Z",
  "finishedAt": "2026-01-01T12:03:00Z"
}

🎵 Generate Music with Suno

Step 1: Create a music generation task

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-v50",
    "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:
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Step 2: Poll for task status

curl -X GET "https://api.mountsea.ai/suno/v2/status?taskId=your-task-id" \
  -H "Authorization: Bearer your-api-key"
Response (success):
{
  "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

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": "FUZZ-2.0 Pro",
    "title": "Summer Vibes",
    "sounds": [
      { "text": "emotional pop with gentle piano, warm synths, and a catchy beat", "strength": 0.5 }
    ],
    "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",
    "lyricsStrength": 0.5,
    "weirdness": 0.5,
    "makeInstrumental": false
  }'
Response:
{
  "taskId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Step 2: Poll for task result

curl -X GET "https://api.mountsea.ai/producer/tasks?taskId=your-task-id" \
  -H "Authorization: Bearer your-api-key"
Response (completed):
{
  "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:
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)

💬 Use Claude Code

Configure environment variables to use Claude Code with our API:
export ANTHROPIC_API_KEY="your-api-key"
export ANTHROPIC_BASE_URL="https://api.mountsea.ai/chat/claude"

# Launch Claude Code
claude
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.

Async Task Pattern

Most generation services (Gemini, Sora2, Suno, Producer) follow an async task pattern:
1. POST request → returns taskId
2. Poll GET endpoint with taskId → returns status + result when done
ServiceCreate TaskPoll Status
GeminiPOST /gemini/video/generateGET /gemini/task/result?taskId=xxx
Gemini ImagePOST /gemini/image/generateGET /gemini/task/result?taskId=xxx
Sora2POST /sora/video/generateGET /sora/task/result?taskId=xxx
SunoPOST /suno/v2/generateGET /suno/v2/status?taskId=xxx
ProducerPOST /producer/audiosGET /producer/tasks?taskId=xxx
Recommended polling interval: Every 3-5 seconds. Generated files are stored for two weeks — download promptly to avoid losing access.

Next Steps

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

Need Help?

If you run into any issues:
Ready to build amazing AI-powered applications? Start creating with Mountsea AI today!