API reference
Every Melious endpoint, grouped by API shape.
Two API shapes, one base URL, one API key. The OpenAI-compatible endpoints live under /v1/… with the shapes you'd expect from the OpenAI SDK. The Anthropic-compatible endpoints — /v1/messages and /v1/messages/count_tokens — accept the shapes the Anthropic SDK sends.
Base URL
https://api.melious.aiSend either Authorization: Bearer <KEY> or x-api-key: <KEY> — both work on every endpoint. See Authentication.
Endpoints
OpenAI-compatible
| Method | Path | What it does |
|---|---|---|
POST | /v1/chat/completions | Chat, with tools, vision, structured output, streaming |
POST | /v1/embeddings | Vector embeddings from text |
POST | /v1/rerank | Reorder documents by relevance to a query |
POST | /v1/images/generations | Generate images from text |
POST | /v1/audio/speech | Text to speech |
POST | /v1/audio/transcriptions | Speech to text |
GET | /v1/models | List models |
GET | /v1/models/{id} | Retrieve one model |
Anthropic-compatible
| Method | Path | What it does |
|---|---|---|
POST | /v1/messages | Chat in the Messages API shape |
POST | /v1/messages/count_tokens | Preflight token count |
Batch
| Method | Path | What it does |
|---|---|---|
POST | /v1/batches | Create an asynchronous batch job |
GET | /v1/batches | List batches |
GET | /v1/batches/{id} | Retrieve a batch |
POST | /v1/batches/{id}/cancel | Cancel a batch |
POST | /v1/files | Upload a batch input file |
GET | /v1/files | List uploaded files |
GET | /v1/files/{id} | Retrieve file metadata |
GET | /v1/files/{id}/content | Download raw file content |
DELETE | /v1/files/{id} | Delete a file |
Tools and MCP endpoints (/v1/tools, /v1/mcp, /v1/documents/convert) have their own section — see Tools.
Every response carries
Two Melious-specific objects ride on every inference response alongside the OpenAI/Anthropic shape:
{
"environment_impact": {
"energy_kwh": 0.00015,
"carbon_g_co2": 0.06,
"water_liters": 0.0002,
"renewable_percent": 85,
"pue": 1.18,
"provider_id": "ovhcloud",
"location": "FR"
},
"billing_cost": {
"energy": "0.0008",
"credits": "0.0",
"paid_with": "energy"
}
}OpenAI and Anthropic SDKs ignore unknown fields, so nothing breaks — but the data is there when you want it. See Environmental impact and Pricing.
Errors
All error responses use the same shape:
{
"error": {
"code": "INFERENCE_3207",
"message": "Input exceeds the model's context window",
"details": { "context_length": 131072, "input_tokens": 164228 }
}
}Match on code — it's stable. Full list in Errors.