API
Dokumentasi
MecutinAI adalah gateway AI OpenAI-compatible. Beli token pass, dapat API key, langsung pakai. Semua model dari provider AI terdepan.
Quick Start
Base URL
https://mecutinai.com/api/v1
Autentikasi
Semua endpoint gateway memerlukan API key. Gunakan header Authorization dengan format Bearer. API key diawali dengan sk_.
Authorization: Bearer sk_aB3xK9pQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request Pertama Anda
curl -X POST https://mecutinai.com/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_AKUN_ANDA" \
-d '{
"model": "qwen3.7-max",
"messages": [
{ "role": "user", "content": "Halo, apa kabar?" }
]
}'Model yang Tersedia
Semua model berasal dari provider AI terdepan. Katalog ini tetap — tidak berubah saat admin mengganti endpoint/key provider.
| Model ID | Nama | Tipe | Deskripsi |
|---|---|---|---|
| qwen3.7-max | Qwen 3.7 Max | Chat | Flagship — reasoning terkuat, 1M context |
| qwen3.7-plus | Qwen 3.7 Plus | Chat | Balance performa & kecepatan, 1M context |
| qwen3.8-max | Qwen 3.8 Max | Chat | Generasi terbaru — flagship reasoning |
| deepseek-v4-pro | DeepSeek V4 Pro | Chat | Reasoning model — deep thinking |
| deepseek-v4-flash | DeepSeek V4 Flash | Chat | Cepat & hemat untuk tugas ringan |
| deepseek-v4-flash-0731 | DeepSeek V4 Flash (0731) | Chat | Snapshot 31 Juli — versi tertentu |
| glm-5.1 | GLM 5.1 | Chat | Chat & function calling |
| glm-5.2 | GLM 5.2 | Chat | Generasi terbaru — chat & tools |
| kimi-k2.7-code | Kimi K2.7 Code | Chat | Spesialis coding & long context |
Chat Completions
/v1/chat/completionsMenghasilkan respons chat dari model. Mendukung streaming (SSE) dan non-streaming. Format request & response 100% OpenAI-compatible.
Parameter Body
| Field | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| model | string | Ya | ID model (lihat tabel di atas) |
| messages | array | Ya | Array of { role, content } |
| stream | boolean | Tidak | Default false. true = SSE stream |
| temperature | number | Tidak | 0.0–2.0, default 1.0 |
| max_tokens | integer | Tidak | Maksimum token output |
| tools | array | Tidak | Function calling (model-dependent) |
Contoh — Non-Streaming (curl)
curl -X POST https://mecutinai.com/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_AKUN_ANDA" \
-d '{
"model": "qwen3.7-max",
"messages": [
{ "role": "system", "content": "Kamu adalah asisten yang membantu." },
{ "role": "user", "content": "Jelaskan apa itu API gateway." }
],
"temperature": 0.7
}'Response (Non-Streaming)
{
"id": "chatcmpl-xxxxx",
"object": "chat.completion",
"model": "qwen3.7-max",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "API gateway adalah..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 150,
"total_tokens": 175
}
}Contoh — Streaming (SSE)
curl -X POST https://mecutinai.com/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_AKUN_ANDA" \
-d '{
"model": "qwen3.7-plus",
"messages": [{ "role": "user", "content": "Halo!" }],
"stream": true
}'Response berupa Server-Sent Events. Setiap chunk berisi delta.content. Stream diakhiri dengan data: [DONE].
data: {"choices":[{"delta":{"role":"assistant","content":""},"index":0}]}
data: {"choices":[{"delta":{"content":"Halo"},"index":0}]}
data: {"choices":[{"delta":{"content":"! Ada"},"index":0}]}
data: {"choices":[],"usage":{"prompt_tokens":5,"completion_tokens":10,"total_tokens":15}}
data: [DONE]Contoh — JavaScript (fetch)
const res = await fetch('https://mecutinai.com/api/v1/chat/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer sk_AKUN_ANDA',
},
body: JSON.stringify({
model: 'qwen3.7-max',
messages: [{ role: 'user', content: 'Halo!' }],
}),
});
const data = await res.json();
console.log(data.choices[0].message.content);Contoh — Python (openai SDK)
from openai import OpenAI
client = OpenAI(
api_key="sk_AKUN_ANDA",
base_url="https://mecutinai.com/api/v1",
)
response = client.chat.completions.create(
model="qwen3.7-max",
messages=[{"role": "user", "content": "Halo!"}],
)
print(response.choices[0].message.content)List Models
/v1/modelsMendapatkan daftar semua model yang tersedia. Format OpenAI-compatible.
curl https://mecutinai.com/api/v1/models \ -H "Authorization: Bearer sk_AKUN_ANDA"
{
"object": "list",
"data": [
{ "id": "qwen3.7-max", "object": "model", "created": 1754870400, "owned_by": "mecutinai" },
{ "id": "qwen3.7-plus", "object": "model", "created": 1754870400, "owned_by": "mecutinai" },
{ "id": "qwen3.8-max", "object": "model", "created": 1754870400, "owned_by": "mecutinai" },
{ "id": "deepseek-v4-pro", "object": "model", "created": 1754870400, "owned_by": "mecutinai" },
{ "id": "deepseek-v4-flash", "object": "model", "created": 1754870400, "owned_by": "mecutinai" },
{ "id": "glm-5.2", "object": "model", "created": 1754870400, "owned_by": "mecutinai" },
{ "id": "kimi-k2.7-code", "object": "model", "created": 1754870400, "owned_by": "mecutinai" },
...
]
}Embeddings
/v1/embeddingsEndpoint embeddings tersedia jika provider mendukung model embedding. Cek /v1/models untuk model yang tersedia.
curl -X POST https://mecutinai.com/api/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_AKUN_ANDA" \
-d '{
"model": "text-embedding-v3",
"input": "Ini adalah teks yang akan di-embed"
}'{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0123, -0.0456, 0.0789, ...]
}
],
"model": "text-embedding-v3",
"usage": { "prompt_tokens": 8, "total_tokens": 8 }
}Usage
/v1/usageCek sisa kuota token, status plan, dan statistik pemakaian.
curl https://mecutinai.com/api/v1/usage \ -H "Authorization: Bearer sk_AKUN_ANDA"
Response (Plan Terbatas)
{
"plan": "HARIAN_10M",
"display_name": "10M Tokens (1 Hari)",
"unlimited": false,
"token_limit": 10000000,
"remaining_tokens": 8420000,
"used_tokens": 1580000,
"rpm_limit": 60,
"expires_at": "2026-08-12T14:30:00Z",
"time_remaining_hours": 18.5,
"usage": { "requests": 42, "prompt_tokens": 510000, "completion_tokens": 1070000, "total_tokens": 1580000 }
}Response (Plan Unlimited)
{
"plan": "HARIAN_UNLIMITED",
"display_name": "Unlimited Tokens (1 Hari)",
"unlimited": true,
"token_limit": null,
"remaining_tokens": null,
"used_tokens": 2500000,
"rpm_limit": 15,
"expires_at": "2026-08-12T14:30:00Z",
"time_remaining_hours": 18.5,
"usage": { "requests": 120, "prompt_tokens": 800000, "completion_tokens": 1700000, "total_tokens": 2500000 }
}Rate Limiting & Kuota
Setiap API key memiliki batas RPM (requests per minute) dan kuota token berdasarkan plan yang dibeli. Rate limit di-enforced per API key menggunakan sliding window 60 detik.
| Plan | Kuota Token | Durasi | RPM | Harga |
|---|---|---|---|---|
| 10M Tokens (1 Hari) | 10.000.000 | 24 jam | 60 | Rp5.000 |
| Unlimited (1 Hari) | Tanpa batas | 24 jam | 15 | Rp25.000 |
| 10M Tokens | 10.000.000 | Tanpa batas waktu | 60 | Rp20.000 |
Response Headers
| Header | Deskripsi |
|---|---|
| X-RateLimit-Remaining-Requests | Sisa request dalam window 60 detik |
| X-RateLimit-Remaining-Tokens | Sisa token (di-omit untuk plan unlimited) |
| X-Plan-Expires-At | Waktu kedaluwarsa plan (di-omit untuk usage-based) |
| X-MecutinAI-Model | Model yang dipakai pada request ini |
Kode Error
Semua error mengikuti format OpenAI.
{
"error": {
"message": "Deskripsi error",
"type": "error_type",
"code": "error_code"
}
}| HTTP | Type | Code | Trigger |
|---|---|---|---|
| 401 | authentication_error | invalid_api_key | API key salah/revoked |
| 403 | permission_error | plan_expired | Plan kedaluwarsa |
| 403 | permission_error | insufficient_quota | Kuota token habis |
| 429 | rate_limit_error | rate_limit_exceeded | RPM terlampaui |
| 400 | invalid_request_error | invalid_model | Model tidak ada di katalog |
| 400 | invalid_request_error | invalid_request | Body request invalid |
| 503 | service_unavailable | provider_not_configured | Provider belum dikonfigurasi |
| 502 | api_error | provider_error | Upstream provider error |
| 504 | api_error | provider_timeout | Upstream timeout (120s) |
SDK Compatibility
MecutinAI 100% OpenAI-compatible. Ganti base_url dan api_key:
# Python
from openai import OpenAI
client = OpenAI(
api_key="sk_AKUN_ANDA",
base_url="https://mecutinai.com/api/v1",
)
# LangChain
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
openai_api_key="sk_AKUN_ANDA",
openai_api_base="https://mecutinai.com/api/v1",
model="qwen3.7-max",
)// JavaScript / TypeScript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk_AKUN_ANDA",
baseURL: "https://mecutinai.com/api/v1",
});Cara Mendapatkan API Key
- 1Kunjungi halaman /pricing dan pilih plan.
- 2Klik Beli Sekarang — Anda akan diarahkan ke halaman checkout.
- 3Scan QRIS dengan e-wallet atau mobile banking. Bayar sesuai nominal (termasuk kode unik).
- 4Tunggu admin mengonfirmasi pembayaran. Halaman order akan auto-refresh setiap 5 detik.
- 5Setelah dikonfirmasi, API key muncul di halaman order. Simpan baik-baik — key ditampilkan sekali saja.
- 6Pakai key tersebut untuk semua request ke /api/v1/*.
Cek sisa kuota: panggil GET /api/v1/usage dengan key Anda, atau lihat header X-RateLimit-Remaining-Tokens di setiap response gateway.