DEV Community

Cover image for Cara Menggunakan DeepSeek V4 API Gratis
Walse
Walse

Posted on • Originally published at apidog.com

Cara Menggunakan DeepSeek V4 API Gratis

DeepSeek V4 dirilis pada 23 April 2026, menawarkan harga API sangat rendah sehingga kebanyakan tim tidak perlu mencari jalur gratis. Namun, tersedia beberapa opsi gratis bagi developer yang ingin mengakses V4 secara terprogram sebelum memasukkan kartu pembayaran. Anda bisa memanfaatkan gateway agregator varian :free, endpoint inferensi Hugging Face, dan kredit uji coba API resmi. Gabungkan semuanya, buat fallback chain di Apidog, dan Anda bisa membuat prototipe produk bertenaga V4 tanpa biaya sama sekali.

Coba Apidog hari ini

Panduan ini fokus pada jalur gratis API. Untuk panduan yang mencakup chat web dan self-hosting, cek cara menggunakan DeepSeek V4 secara gratis. Untuk panduan berbayar, lihat cara menggunakan API DeepSeek V4. Untuk ikhtisar produk, baca apa itu DeepSeek V4.

TL;DR

  • OpenRouter tingkat gratisdeepseek/deepseek-v4-flash:free dan kadang deepseek-v4-pro:free. Kompatibel OpenAI, ratusan request/hari/kunci.
  • Inferensi Hugging Face — endpoint public gratis di https://router.huggingface.co/hf-inference; dibatasi, sangat cocok prototyping.
  • Chutes tingkat gratis — jaringan GPU komunitas sering menawarkan endpoint DeepSeek gratis dalam minggu peluncuran.
  • Kredit uji coba DeepSeek — akun baru di platform.deepseek.com kadang dapat saldo awal kecil.
  • Self-hosted V4-Flash — gratis pada level lisensi jika punya GPU sendiri; cek cara menjalankan DeepSeek V4 secara lokal.
  • Fallback chain di Apidog — pastikan format permintaan konsisten di semua penyedia.

Mengapa Jalur API Gratis Ada

Tarif DeepSeek sudah sangat murah. Tapi jalur gratis tetap penting untuk:

  1. Prototyping sebelum bayar: Uji dari kode tanpa komitmen payment.
  2. Proyek mahasiswa/penelitian/open source: Kualitas top tanpa biaya.
  3. Bandingkan penyedia: Uji prompt yang sama di beberapa endpoint gratis; lihat beda latensi, kualitas, dan reliabilitas.

Kalau salah satu alasan di atas sesuai, gunakan panduan ini. Kalau butuh produk siap produksi, lanjut ke panduan API berbayar.

Jalur 1: OpenRouter Gratis

OpenRouter adalah gateway API kompatibel OpenAI yang mengagregasi model terbaik, dan selalu menyediakan varian :free untuk DeepSeek (termasuk V4).

Langkah Implementasi

  1. Daftar di openrouter.ai
  2. Buat API key di Settings → Keys
  3. Lihat katalog model yang ada :free (misal deepseek/deepseek-v4-flash:free)
  4. Panggil endpoint dengan SDK OpenAI

Python

from openai import OpenAI

client = OpenAI(
    api_key=OPENROUTER_API_KEY,
    base_url="https://openrouter.ai/api/v1",
)

response = client.chat.completions.create(
    model="deepseek/deepseek-v4-flash:free",
    messages=[{"role": "user", "content": "Refactor this Go function to use channels."}],
)

print(response.choices[0].message.content)
Enter fullscreen mode Exit fullscreen mode

Batasan

Permintaan gratis di OpenRouter mengantri di belakang user berbayar. Limit sekitar 50-200 permintaan/hari/kunci, concurrency ketat, varian bisa berubah/hilang sewaktu-waktu. Cocok hanya untuk prototipe.

Node.js

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.OPENROUTER_API_KEY,
  baseURL: "https://openrouter.ai/api/v1",
});

const response = await client.chat.completions.create({
  model: "deepseek/deepseek-v4-flash:free",
  messages: [{ role: "user", content: "Explain MoE routing like I'm 12." }],
});

console.log(response.choices[0].message.content);
Enter fullscreen mode Exit fullscreen mode

Jalur 2: Inferensi Hugging Face

Hugging Face menyediakan endpoint inferensi public gratis untuk DeepSeek V4 segera setelah rilis. Cukup pakai HF token; pembatasan tarif sangat ketat.

import os
from huggingface_hub import InferenceClient

client = InferenceClient(
    model="deepseek-ai/DeepSeek-V4-Flash",
    token=os.environ["HF_TOKEN"],
)

response = client.chat_completion(
    messages=[
        {"role": "user", "content": "Write a Python decorator that retries with jitter."}
    ],
    max_tokens=512,
)

print(response.choices[0].message.content)
Enter fullscreen mode Exit fullscreen mode

Token bisa diambil dari huggingface.co/settings/tokens. Latensi dan limit mengikuti trafik global. Upgrade ke HF Pro untuk limit lebih longgar jika perlu.

Jalur 3: Chutes dan Gateway Komunitas

Chutes adalah jaringan GPU terdesentralisasi yang sering meng-host model DeepSeek secara gratis/hampir gratis. Endpoint OpenAI-compatible: https://llm.chutes.ai/v1.

client = OpenAI(
    api_key=CHUTES_API_KEY,
    base_url="https://llm.chutes.ai/v1",
)

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Flash",
    messages=[{"role": "user", "content": "Compare CSA and HCA attention in two sentences."}],
)
Enter fullscreen mode Exit fullscreen mode

Ketersediaan dan model ID bisa berubah cepat, jadi cek dashboard penyedia sebelum membuat dependency.

Jalur 4: Kredit Uji Coba DeepSeek

DeepSeek kadang memberi kredit uji coba untuk akun baru (misal, $1 setelah verifikasi email). Cek dashboard billing di platform.deepseek.com setelah daftar.

Kredit $1 bisa dipakai untuk sekitar 7 juta token input di V4-Flash, atau 570K token input di V4-Pro—cukup untuk ratusan prototipe.

Membangun Rantai Gratis Agnostik Penyedia di Apidog

Manfaatkan banyak jalur gratis dengan fallback chain agar prototipe tetap jalan meski satu penyedia rate limit.

Langkah Praktis

  1. Unduh Apidog & buat project baru.
  2. Buat 4 environment: openrouter, huggingface, chutes, deepseek-trial.
  3. Simpan API key di masing-masing environment sebagai secret, set BASE_URL.
  4. Simpan 1 POST request ke {{BASE_URL}}/chat/completions dan parameterkan model.
  5. Switch environment untuk testing prompt di semua penyedia.

Metode ini juga bisa untuk jalur gratis GPT-5.5—cukup copy collection, ganti provider.

Fallback Chain dalam Kode

Fallback otomatis bisa dibuat dengan OpenAI SDK:

import os
from openai import OpenAI, RateLimitError, APIError

PROVIDERS = [
    {
        "base_url": "https://openrouter.ai/api/v1",
        "api_key": os.environ["OPENROUTER_API_KEY"],
        "model": "deepseek/deepseek-v4-flash:free",
    },
    {
        "base_url": "https://llm.chutes.ai/v1",
        "api_key": os.environ["CHUTES_API_KEY"],
        "model": "deepseek-ai/DeepSeek-V4-Flash",
    },
    {
        "base_url": "https://api.deepseek.com/v1",
        "api_key": os.environ["DEEPSEEK_API_KEY"],
        "model": "deepseek-v4-flash",
    },
]

def call_v4(messages):
    for provider in PROVIDERS:
        try:
            client = OpenAI(
                api_key=provider["api_key"],
                base_url=provider["base_url"],
            )
            return client.chat.completions.create(
                model=provider["model"],
                messages=messages,
            )
        except (RateLimitError, APIError) as e:
            print(f"{provider['base_url']} failed: {e}")
            continue
    raise RuntimeError("all providers exhausted")
Enter fullscreen mode Exit fullscreen mode

Untuk Apa Setiap Jalur Gratis Berguna

Jalur Terbaik untuk Terburuk untuk
OpenRouter gratis Prototyping, dev harian SLA ketat
Inferensi HF Eksplorasi, notebook Beban latency rendah
Chutes Komunitas, eksperimen Ketergantungan jangka panjang
Uji coba DeepSeek Pengujian fidelitas penuh Produksi berkelanjutan
V4-Flash self-hosted Kepatuhan, kontrol penuh Tanpa GPU

Perhitungan Kuota Penting

Estimasi throughput harian tiap jalur gratis:

  • OpenRouter gratis: ~100 request/hari/kunci (~50K token). Cukup untuk 30–50 call development per hari.
  • Inferensi HF gratis: ~1K request/hari/akun, rate limit global.
  • Chutes: bervariasi, treat as best effort.
  • DeepSeek trial ($1): ~700 call × 10K token input di V4-Flash.
  • Self-hosted: tergantung hardware. 4×H100 bisa 50–150 tok/detik.

Jika kebutuhan prototipe > limit di atas, biaya API resmi sangat terjangkau: 10.000 call × 2K context + 500 output token hanya sekitar $2.80 di V4-Flash.

Kapan Harus Pindah ke API Berbayar

Tiga tanda Anda perlu upgrade:

  1. Kena rate limit lebih dari sekali sehari.
  2. Harus combine beberapa jalur gratis untuk satu workload.
  3. Butuh latency/SLA stabil.

Minimal top-up di platform.deepseek.com hanya $2. Seringkali lebih hemat waktu dengan API berbayar. Cek panduan harga DeepSeek V4 untuk detail tarif.

FAQ

  • Ada jalur gratis yang permanen? Tidak. Semua bisa berubah sewaktu-waktu. Cocok hanya untuk prototipe.
  • OpenRouter :free benar-benar jalanin V4? Ya, di infrastruktur shared dengan limit rate ketat.
  • Boleh pakai output jalur gratis untuk produk komersial? Cek terms penyedia. OpenRouter dan HF umumnya izinkan (dengan batasan), DeepSeek trial ikuti T&C resmi.
  • Jalur gratis mana paling rendah latency? DeepSeek trial > OpenRouter > HF/Chutes.
  • Bisa self-host V4 gratis? Lisensi MIT, jadi iya—hardware jadi biaya. Lihat cara menjalankan DeepSeek V4 secara lokal.
  • Cara track jalur gratis yang dipakai? Gunakan Apidog, embed usage di response viewer. Mayoritas agregator punya dashboard usage.

Top comments (0)