OpenAI Compat API
The OpenAI Compat API is a drop-in replacement for OpenAI’s official Images API. Fully compatible with the officialopenai SDK (Python & Node.js) and the raw OpenAI REST interface — just change the base_url.
Why Use Compat API?
Official SDK Support
Works with OpenAI’s official
openai Python and Node.js SDKsSame API Shape
Same request/response format as
https://api.openai.com/v1/images/*Synchronous
Returns the generated image directly — no polling needed
Unified Billing
Single API key, unified usage tracking through Mountsea
Configuration
Base URL
Authentication
Use your Mountsea API key:- HTTP header:
Authorization: Bearer your-api-key - Or set via the SDK’s
api_key/apiKeyparameter
Supported Endpoints
Supported Models
Using the Official openai SDK
Installation
Python
Node.js / TypeScript
Using the REST API Directly
If you don’t want to use the SDK, you can call the endpoints directly.Text-to-Image (JSON)
Image Edit (multipart/form-data)
Inpainting (multipart/form-data)
Request Parameters
images/generations (JSON)
images/edits (multipart/form-data)
All fields above plus:
Response Format
Identical to OpenAI’s official response:This service honors
response_format for every channel, including gpt-image models whose upstream returns b64. Default is url (our S3). You never get both url and b64_json.Notes & Limitations
- All standard OpenAI parameters are supported; unknown parameters are ignored gracefully.
- JSON
imageon/images/generationsis a Mountsea extension (official SDK will not send it). - Both
openaiSDK and raw REST calls work identically.
Explore the API Documentation
- images.generate (Compat) — generate (JSON edit diversion)
- images.edit (Compat) — multipart edit
- models.list (Compat) — supported models