DOCUMENTATION

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

endpoint
https://mecutinai.com/api/v1

Autentikasi

Semua endpoint gateway memerlukan API key. Gunakan header Authorization dengan format Bearer. API key diawali dengan sk_.

auth
Authorization: Bearer sk_aB3xK9pQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Request Pertama Anda

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": "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 IDNamaTipeDeskripsi
qwen3.7-maxQwen 3.7 MaxChatFlagship — reasoning terkuat, 1M context
qwen3.7-plusQwen 3.7 PlusChatBalance performa & kecepatan, 1M context
qwen3.8-maxQwen 3.8 MaxChatGenerasi terbaru — flagship reasoning
deepseek-v4-proDeepSeek V4 ProChatReasoning model — deep thinking
deepseek-v4-flashDeepSeek V4 FlashChatCepat & hemat untuk tugas ringan
deepseek-v4-flash-0731DeepSeek V4 Flash (0731)ChatSnapshot 31 Juli — versi tertentu
glm-5.1GLM 5.1ChatChat & function calling
glm-5.2GLM 5.2ChatGenerasi terbaru — chat & tools
kimi-k2.7-codeKimi K2.7 CodeChatSpesialis coding & long context

Chat Completions

POST/v1/chat/completions

Menghasilkan respons chat dari model. Mendukung streaming (SSE) dan non-streaming. Format request & response 100% OpenAI-compatible.

Parameter Body

FieldTipeWajibDeskripsi
modelstringYaID model (lihat tabel di atas)
messagesarrayYaArray of { role, content }
streambooleanTidakDefault false. true = SSE stream
temperaturenumberTidak0.0–2.0, default 1.0
max_tokensintegerTidakMaksimum token output
toolsarrayTidakFunction calling (model-dependent)

Contoh — Non-Streaming (curl)

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)

json
{
  "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
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].

sse
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)

js
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)

python
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

GET/v1/models

Mendapatkan daftar semua model yang tersedia. Format OpenAI-compatible.

curl
curl https://mecutinai.com/api/v1/models \
  -H "Authorization: Bearer sk_AKUN_ANDA"
json
{
  "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

POST/v1/embeddings

Endpoint embeddings tersedia jika provider mendukung model embedding. Cek /v1/models untuk model yang tersedia.

curl
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"
  }'
json
{
  "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

GET/v1/usage

Cek sisa kuota token, status plan, dan statistik pemakaian.

curl
curl https://mecutinai.com/api/v1/usage \
  -H "Authorization: Bearer sk_AKUN_ANDA"

Response (Plan Terbatas)

json
{
  "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)

json
{
  "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.

PlanKuota TokenDurasiRPMHarga
10M Tokens (1 Hari)10.000.00024 jam60Rp5.000
Unlimited (1 Hari)Tanpa batas24 jam15Rp25.000
10M Tokens10.000.000Tanpa batas waktu60Rp20.000

Response Headers

HeaderDeskripsi
X-RateLimit-Remaining-RequestsSisa request dalam window 60 detik
X-RateLimit-Remaining-TokensSisa token (di-omit untuk plan unlimited)
X-Plan-Expires-AtWaktu kedaluwarsa plan (di-omit untuk usage-based)
X-MecutinAI-ModelModel yang dipakai pada request ini

Kode Error

Semua error mengikuti format OpenAI.

json
{
  "error": {
    "message": "Deskripsi error",
    "type": "error_type",
    "code": "error_code"
  }
}
HTTPTypeCodeTrigger
401authentication_errorinvalid_api_keyAPI key salah/revoked
403permission_errorplan_expiredPlan kedaluwarsa
403permission_errorinsufficient_quotaKuota token habis
429rate_limit_errorrate_limit_exceededRPM terlampaui
400invalid_request_errorinvalid_modelModel tidak ada di katalog
400invalid_request_errorinvalid_requestBody request invalid
503service_unavailableprovider_not_configuredProvider belum dikonfigurasi
502api_errorprovider_errorUpstream provider error
504api_errorprovider_timeoutUpstream timeout (120s)

SDK Compatibility

MecutinAI 100% OpenAI-compatible. Ganti base_url dan api_key:

python
# 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
// JavaScript / TypeScript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "sk_AKUN_ANDA",
  baseURL: "https://mecutinai.com/api/v1",
});

Cara Mendapatkan API Key

  1. 1Kunjungi halaman /pricing dan pilih plan.
  2. 2Klik Beli Sekarang — Anda akan diarahkan ke halaman checkout.
  3. 3Scan QRIS dengan e-wallet atau mobile banking. Bayar sesuai nominal (termasuk kode unik).
  4. 4Tunggu admin mengonfirmasi pembayaran. Halaman order akan auto-refresh setiap 5 detik.
  5. 5Setelah dikonfirmasi, API key muncul di halaman order. Simpan baik-baik — key ditampilkan sekali saja.
  6. 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.