Skip to main content

Introduction to OpenAI

Welcome to the OpenAI service documentation! Mountsea’s OpenAI service provides GPT Image generation and editing, available in two flavors:

Async Task API

Single unified endpoint /openai/images that handles both text-to-image and image editing asynchronously. Returns a taskId; poll via /openai/tasks.

OpenAI Compat (Official SDK)

Drop-in replacement for OpenAI’s official Images API. Works with the official openai SDK — just change base_url to https://api.mountsea.ai/openai/v1.

Supported Models

ModelDescription
gpt-image-2Latest OpenAI image model — supports generation, editing, inpainting (mask), and high input fidelity

Service Overview

⚡ Async Task API (/openai/images)

A single unified endpoint that auto-detects the operation based on whether the image field is present:
  • Without image → Text-to-image (maps to /v1/images/generations)
  • With image → Image editing (maps to /v1/images/edits) — supports URL or base64 data URL
  • With mask → Inpainting (transparent areas in mask will be repainted)
Returns a taskId immediately; poll GET /openai/tasks?taskId=... until the task reaches a terminal state. Explore Async API Documentation →

🔌 OpenAI Compat (Official SDK)

Fully compatible with OpenAI’s official Images API:
  • Text-to-ImagePOST /openai/v1/images/generations (identical to https://api.openai.com/v1/images/generations)
  • Image EditingPOST /openai/v1/images/edits (multipart/form-data, identical to OpenAI)
  • Synchronous — returns the generated image(s) directly in the response (no polling needed)
  • Official SDK support — use Python/Node.js openai SDK with base_url override
Explore Compat Documentation →

When to Use Which?

Use CaseRecommended
You already have code using the openai SDK and want to switch providers without changesCompat API
You want a unified endpoint for both generate & edit, with consistent async behavior across Mountsea servicesAsync Task API
You need to process many requests in the background and track them by IDAsync Task API
You want synchronous request/response (single HTTP call → image)Compat API

Base URL

https://api.mountsea.ai
For the Compat SDK endpoint, set your OpenAI SDK base_url to:
https://api.mountsea.ai/openai/v1

Authentication

All endpoints require Bearer token authentication:
Authorization: Bearer your-api-key