Lỏ-GPT API

OpenAI-compatible chat API cho web, app và IDE.

Public Health

GET https://llm.binhetal.com/api/health

OpenAI-Compatible Config

Base URL: https://llm.binhetal.com/v1
Chat endpoint: /chat/completions
API key: token truy cập cá nhân
Model: qwen
Aliases: binhetal, gpt-4o

Khuyến nghị dùng model: "qwen" cho app, gateway và IDE. Các alias binhetalgpt-4o vẫn được hỗ trợ để dễ tích hợp với client OpenAI-compatible.

Headers

Authorization: Bearer <USER_MEMORY_TOKEN>
Content-Type: application/json

<USER_MEMORY_TOKEN> là mã truy cập cá nhân của bạn. Dùng cùng một token trên web, app hoặc IDE để hệ thống nhận đúng người dùng và khôi phục ngữ cảnh đã lưu. Nếu bạn đổi token hoặc xóa dữ liệu trình duyệt, lịch sử/memory cũ có thể không còn được nối tiếp.

Chat Request

curl https://llm.binhetal.com/v1/chat/completions \
  -H "Authorization: Bearer $USER_MEMORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Viết một hàm Python tính Fibonacci."}
    ],
    "temperature": 0.2,
    "max_tokens": 1024,
    "stream": false
  }'

Streaming

curl -N https://llm.binhetal.com/v1/chat/completions \
  -H "Authorization: Bearer $USER_MEMORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Giải thích async/await ngắn gọn."}],
    "max_tokens": 1024,
    "stream": true
  }'

JavaScript / Web App

async function chat(messages, userToken) {
  const res = await fetch("https://llm.binhetal.com/v1/chat/completions", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${userToken}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      model: "gpt-4o",
      messages,
      temperature: 0.2,
      max_tokens: 2048
    })
  });
  if (!res.ok) throw new Error(await res.text());
  const data = await res.json();
  return data.choices[0].message.content;
}

Node.js

const API_BASE = "https://llm.binhetal.com/v1";
const USER_TOKEN = process.env.LO_GPT_USER_TOKEN;

const res = await fetch(`${API_BASE}/chat/completions`, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${USER_TOKEN}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    model: "gpt-4o",
    messages: [{ role: "user", content: "Xin chào" }],
    temperature: 0.2,
    max_tokens: 512
  })
});

const data = await res.json();
console.log(data.choices[0].message.content);

IDE / Gateway Config

{
  "provider": "openai-compatible",
  "base_url": "https://llm.binhetal.com/v1",
  "api_key": "${LO_GPT_USER_TOKEN}",
  "model": "qwen",
  "chat_endpoint": "/chat/completions",
  "supports_streaming": true,
  "max_tokens": 32768
}

OpenClaw

Dùng OpenAI-compatible provider với API online.

OPENAI_BASE_URL=https://llm.binhetal.com/v1
OPENAI_API_KEY=<USER_MEMORY_TOKEN>
OPENAI_MODEL=qwen

OPENAI_STREAM=true
OPENAI_MAX_TOKENS=32768
OPENAI_TIMEOUT_SECONDS=900

OpenClaw JSON

{
  "llm": {
    "provider": "openai-compatible",
    "base_url": "https://llm.binhetal.com/v1",
    "api_key": "${OPENAI_API_KEY}",
    "model": "qwen",
    "stream": true,
    "temperature": 0.2,
    "max_tokens": 32768,
    "timeout_seconds": 900,
    "endpoints": {
      "chat_completions": "/chat/completions",
      "completions": "/completions",
      "models": "/models"
    }
  },
  "models": {
    "default": "qwen",
    "aliases": {
      "binhetal": "qwen",
      "gpt-4o": "qwen"
    }
  }
}

Files

Bạn có thể đính kèm tài liệu, bảng tính, mã nguồn, hình ảnh hoặc file phân tích bảo mật trực tiếp trong web chat. Sau khi upload, file sẽ hiện như attachment trong cuộc trò chuyện; nhập yêu cầu của bạn rồi gửi để agent đọc, tóm tắt, chỉnh sửa, phân tích hoặc trả file kết quả dạng ZIP khi cần.

Response Shape

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1780000000,
  "model": "gpt-4o",
  "choices": [
    {
      "index": 0,
      "message": {"role": "assistant", "content": "..."},
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0
  }
}