Lewati ke konten
Semua model

GPT-4.1 mini

OpenAI Chat

Model serbaguna yang cepat dan hemat untuk chat, ekstraksi data, dan asisten dengan konteks panjang.

Spesifikasi

Provider
OpenAI
Jenis model
Chat
Context window
1.047.576 token
Output maksimum
32.768 token
Input yang didukung
Teks, Gambar
Output
Teks
Kemampuan
  • Text
  • Vision
  • Tool calling
  • Streaming
  • JSON mode

Harga

Input

per 1 juta token

Rp7.920
Output

per 1 juta token

Rp31.680
Input tersimpan (cached)

per 1 juta token

Rp1.980

Harga dalam Rupiah. Tagihan dihitung dari jumlah token yang dilaporkan untuk setiap request dan dipotong dari saldo Anda.

Contoh API

Chat Completions

curl "https://www.astranesia.com/v1/chat/completions" \
  -H "Authorization: Bearer $AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4.1-mini",
    "messages": [
      { "role": "system", "content": "Jawab dengan singkat dalam Bahasa Indonesia." },
      { "role": "user", "content": "Halo!" }
    ]
  }'

Streaming

curl -N "https://www.astranesia.com/v1/chat/completions" \
  -H "Authorization: Bearer $AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4.1-mini",
    "stream": true,
    "stream_options": { "include_usage": true },
    "messages": [{ "role": "user", "content": "Ceritakan tentang Nusantara." }]
  }'

Input gambar

curl "https://www.astranesia.com/v1/chat/completions" \
  -H "Authorization: Bearer $AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4.1-mini",
    "messages": [
      {
        "role": "user",
        "content": [
          { "type": "text", "text": "Apa yang ada pada gambar ini?" },
          { "type": "image_url", "image_url": { "url": "https://example.com/foto.jpg" } }
        ]
      }
    ]
  }'

Tool calling

curl "https://www.astranesia.com/v1/chat/completions" \
  -H "Authorization: Bearer $AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4.1-mini",
    "messages": [{ "role": "user", "content": "Cuaca di Jakarta?" }],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "get_weather",
          "description": "Ambil cuaca terkini untuk sebuah kota.",
          "parameters": {
            "type": "object",
            "properties": { "city": { "type": "string" } },
            "required": ["city"]
          }
        }
      }
    ]
  }'

Batasan request

  • Context window maksimum 1.047.576 token (input dan output).
  • Output maksimum 32.768 token. Nilai max_tokens di atas batas ini ditolak.
  • Jika max_tokens tidak diisi, batas output 4.096 token diterapkan.
  • Parameter n hanya mendukung nilai 1.
  • Streaming SSE didukung dengan stream: true.
  • Gambar dikirim lewat URL https:// atau data URL base64 (png, jpeg, gif, webp).
  • Ukuran request maksimum 3,8 MB.
  • Batas 60 request per menit dan 5 request bersamaan untuk setiap akun.
  • Saldo harus mencukupi perkiraan biaya maksimum request sebelum request diproses.
GPT-4.1 mini | Astranesia AI