IzziAPI
TutorialApr 10, 20265 min read

Bắt đầu với Izzi API trong 5 phút

Hướng dẫn nhanh thiết lập Izzi API và gọi API AI đầu tiên. Truy cập 38+ model qua một endpoint duy nhất.

Izzi API Team
Engineering & DevRel
bắt-đầuquickstartapi-keyhướng-dẫnizzi-api
Bắt đầu với Izzi API trong 5 phút

Bạn sẽ làm được gì sau 5 phút?

  • Có API key kết nối với 38+ model AI
  • Chạy thành công script Python gọi Claude, GPT, Gemini
  • Bật streaming cho response real-time
  • Có error handling chuẩn production

Bước 1: Tạo API Key

  1. Truy cập izziapi.com → Đăng nhập Google
  2. Vào Dashboard → API Keys → Create Key
  3. Nạp $1 → nhận +$5 bonus (tổng $6 credit)

Bước 2: Gọi API đầu tiên

Python

Python
from openai import OpenAI

client = OpenAI(
    api_key="izzi-YOUR_KEY_HERE",
    base_url="https://api.izziapi.com/v1"
)

response = client.chat.completions.create(
    model="claude-sonnet-4-20250514",
    messages=[
        {"role": "system", "content": "Bạn là lập trình viên Python giỏi."},
        {"role": "user", "content": "Viết decorator retry với exponential backoff."}
    ],
    max_tokens=1000
)
print(response.choices[0].message.content)

Node.js

TypeScript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "izzi-YOUR_KEY_HERE",
  baseURL: "https://api.izziapi.com/v1",
});

const response = await client.chat.completions.create({
  model: "claude-sonnet-4-20250514",
  messages: [{ role: "user", content: "Viết API client type-safe." }],
});
console.log(response.choices[0].message.content);

Bước 3: Bật Streaming

Python
stream = client.chat.completions.create(
    model="claude-sonnet-4-20250514",
    messages=[{"role": "user", "content": "Giải thích WebSocket vs SSE"}],
    stream=True
)
for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Bước 4: Đổi model chỉ 1 dòng

Python
# Đổi sang GPT-5
response = client.chat.completions.create(
    model="gpt-5.4",
    messages=[{"role": "user", "content": "Xin chào!"}]
)

# Hoặc dùng model MIỄN PHÍ
response = client.chat.completions.create(
    model="deepseek-r1-0528",  # Hoàn toàn miễn phí
    messages=[{"role": "user", "content": "Xin chào!"}]
)

Bảng giá tham khảo

ModelInput (1M tokens)Output (1M tokens)Miễn phí?
Claude Sonnet 4$2.10$10.50Không
GPT-5$1.75$7.00Không
DeepSeek R1$0$0✅ Có
Qwen3 235B$0$0✅ Có

Tiếp theo

Sẵn sàng bắt đầu?

Truy cập 38+ model AI qua một API duy nhất. Gói miễn phí — không cần thẻ tín dụng.

MORE

Bài viết liên quan