Google Chat

Gemini 4 Carbon

gemini-4-carbon-high
Đầu vào Văn bản Ảnh Audio Video Đầu ra Văn bản

Thông số

Nhà cung cấp
Google
Loại
Chat
Đầu vào
Văn bản, Ảnh, Audio, Video
Đầu ra
Văn bản
Ngữ cảnh
1,05M
Output tối đa
66K
Định dạng API
Chat Completions, Gemini

Giá

MụcVNĐCreditĐơn vị
Input~1.000đ1.000 credit/ 1M token
Output~4.000đ4.000 credit/ 1M token
Đọc bộ nhớ đệm~100đ100 credit/ 1M token

1 credit = 1đ. Credit trừ theo usage thực tế sau mỗi request. Xem bảng giá và gói nạp

Bắt đầu nhanh

  1. Tạo API key tại trang API key (cần đăng ký trước).
  2. Lưu key vào biến môi trường WIROUTER_API_KEY.
  3. Gọi API với base URL https://api.wirouter.store/v1 và model gemini-4-carbon-high.
Terminal
export WIROUTER_API_KEY="your-api-key"
curl -s https://api.wirouter.store/v1/models -H "Authorization: Bearer $WIROUTER_API_KEY"

Gọi API

Chat Completions POST /v1/chat/completions

curl -s https://api.wirouter.store/v1/chat/completions \
  -H "Authorization: Bearer $WIROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'EOF'
{
  "model": "gemini-4-carbon-high",
  "messages": [
    {
      "role": "user",
      "content": "Giới thiệu ngắn gọn về WiRouter trong 2 câu."
    }
  ]
}
EOF

Gemini POST /v1beta/models/gemini-4-carbon-high:generateContent

curl -s https://api.wirouter.store/v1beta/models/gemini-4-carbon-high:generateContent \
  -H "x-goog-api-key: $WIROUTER_API_KEY" \
  -H "content-type: application/json" \
  --data @- <<'EOF'
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Giới thiệu ngắn gọn về WiRouter trong 2 câu."
        }
      ]
    }
  ]
}
EOF

Mức suy luận

Chat Completions · reasoning_effort POST /v1/chat/completions

reasoning_effort nhận low | medium | high (auto: model tự quyết). low trả lời nhanh nhất, high suy nghĩ kỹ hơn nhưng chậm hơn; token suy luận tính tiền như token output. Bản Lite và gemini-3-flash mặc định không suy luận, chỉ suy luận khi có trường này.

curl -s https://api.wirouter.store/v1/chat/completions \
  -H "Authorization: Bearer $WIROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'EOF'
{
  "model": "gemini-4-carbon-high",
  "messages": [
    {
      "role": "user",
      "content": "Một con ốc sên leo cột 10 m, ngày leo 3 m, đêm tụt 2 m. Sau bao nhiêu ngày thì lên tới đỉnh?"
    }
  ],
  "reasoning_effort": "low"
}
EOF

Gemini · thinkingLevel POST /v1beta/models/gemini-4-carbon-high:generateContent

Định dạng Gemini đặt mức suy luận bằng generationConfig.thinkingConfig.thinkingLevel (low | medium | high), cùng ý nghĩa với reasoning_effort.

curl -s https://api.wirouter.store/v1beta/models/gemini-4-carbon-high:generateContent \
  -H "x-goog-api-key: $WIROUTER_API_KEY" \
  -H "content-type: application/json" \
  --data @- <<'EOF'
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Một con ốc sên leo cột 10 m, ngày leo 3 m, đêm tụt 2 m. Sau bao nhiêu ngày thì lên tới đỉnh?"
        }
      ]
    }
  ],
  "generationConfig": {
    "thinkingConfig": {
      "thinkingLevel": "low"
    }
  }
}
EOF

Gửi ảnh

Ví dụ đọc ảnh từ file photo.jpg.

Chat Completions · ảnh base64 POST /v1/chat/completions

Model này không tải ảnh từ URL: ảnh gửi qua URL bị bỏ qua mà không báo lỗi. Hãy gửi ảnh dạng base64 như ví dụ dưới.

IMG=$(base64 < photo.jpg | tr -d '\n')
curl -s https://api.wirouter.store/v1/chat/completions \
  -H "Authorization: Bearer $WIROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "model": "gemini-4-carbon-high",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Mô tả bức ảnh này trong một câu."
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/jpeg;base64,${IMG}"
          }
        }
      ]
    }
  ]
}
EOF

Gemini · inlineData POST /v1beta/models/gemini-4-carbon-high:generateContent

IMG=$(base64 < photo.jpg | tr -d '\n')
curl -s https://api.wirouter.store/v1beta/models/gemini-4-carbon-high:generateContent \
  -H "x-goog-api-key: $WIROUTER_API_KEY" \
  -H "content-type: application/json" \
  --data @- <<EOF
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Mô tả bức ảnh này trong một câu."
        },
        {
          "inlineData": {
            "mimeType": "image/jpeg",
            "data": "${IMG}"
          }
        }
      ]
    }
  ]
}
EOF

Gửi video

Chat Completions · video_url POST /v1/chat/completions

Gửi video inline nên nhỏ (khuyến nghị dưới 20 MB); request quá 100 giây sẽ bị cắt.

VID=$(base64 < clip.mp4 | tr -d '\n')
curl -s https://api.wirouter.store/v1/chat/completions \
  -H "Authorization: Bearer $WIROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "model": "gemini-4-carbon-high",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Tóm tắt nội dung video này trong một câu."
        },
        {
          "type": "video_url",
          "video_url": {
            "url": "data:video/mp4;base64,${VID}"
          }
        }
      ]
    }
  ]
}
EOF

Gemini · inlineData video/mp4 POST /v1beta/models/gemini-4-carbon-high:generateContent

Gửi video inline nên nhỏ (khuyến nghị dưới 20 MB); request quá 100 giây sẽ bị cắt.

VID=$(base64 < clip.mp4 | tr -d '\n')
curl -s https://api.wirouter.store/v1beta/models/gemini-4-carbon-high:generateContent \
  -H "x-goog-api-key: $WIROUTER_API_KEY" \
  -H "content-type: application/json" \
  --data @- <<EOF
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Tóm tắt nội dung video này trong một câu."
        },
        {
          "inlineData": {
            "mimeType": "video/mp4",
            "data": "${VID}"
          }
        }
      ]
    }
  ]
}
EOF

Dùng với công cụ

Claude Code
export ANTHROPIC_BASE_URL="https://api.wirouter.store"
export ANTHROPIC_AUTH_TOKEN="$WIROUTER_API_KEY"
claude --model claude-fable-5-dd-hgih-nobrac-4-inimeg
Cursor / Cline / OpenWebUI
Base URL: https://api.wirouter.store/v1
API key: $WIROUTER_API_KEY
Model: gemini-4-carbon-high

Lỗi thường gặp

401
API key sai, đã bị thu hồi hoặc tài khoản hết credit. Kiểm tra key và số dư.
429
Model tạm hết quota hoặc đang cooldown. Thử lại sau số giây trong header Retry-After.
400
Request không hợp lệ, thường do sai model ID. Dùng đúng ID gemini-4-carbon-high.
524
Request chạy quá 100 giây nên bị cắt. Dùng stream hoặc rút gọn yêu cầu.