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
| Model | Description |
|---|---|
gpt-image-2 | Latest 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)
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-Image —
POST /openai/v1/images/generations(identical tohttps://api.openai.com/v1/images/generations) - Image Editing —
POST /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
openaiSDK withbase_urloverride
When to Use Which?
| Use Case | Recommended |
|---|---|
You already have code using the openai SDK and want to switch providers without changes | Compat API |
| You want a unified endpoint for both generate & edit, with consistent async behavior across Mountsea services | Async Task API |
| You need to process many requests in the background and track them by ID | Async Task API |
| You want synchronous request/response (single HTTP call → image) | Compat API |
Base URL
base_url to: