Skip to main content
The Meliai API exposes two compatible shapes — OpenAI and Anthropic — through a single base URL, so you can migrate existing clients with a one-line change. Every request authenticates with a single sk-mel-<KEY> API key, and every inference response carries Meliai-specific fields for routing metadata, environmental impact, and billing cost alongside the standard response body.

Base URL

All paths below are relative to this base URL. There is no versioning in the base URL itself — the version prefix (/v1) is part of each path.

API Shapes

OpenAI-Compatible Endpoints

Anthropic-Compatible Endpoints

Batch & Files Endpoints

Universal Response Fields

Every inference response — regardless of API shape — includes two Meliai-specific top-level objects alongside the standard payload. Use environment_impact to track the carbon and energy footprint of each call, and billing_cost to reconcile usage against your account balance.
object
Environmental footprint of the inference request.
object
Cost breakdown for this request.

Authentication

All requests require an Authorization: Bearer sk-mel-<KEY> or x-api-key: sk-mel-<KEY> header. See the Authentication page for setup instructions, SDK examples, and key management.

Errors

All error responses share a consistent JSON shape keyed on a stable code field. See the Errors page for the full list of HTTP status codes, named error codes, and a recommended retry strategy.