How to Call 4 Free LLM Models from One OpenAI-Compatible Endpoint (Tested October 2026)
Описание и применение
Автор описывает, как использовать один OpenAI‑совместимый шлюз apishare.cc для вызова четырёх бесплатных LLM‑моделей, меняя только строку модели, без изменения кода, с мгновенной видимостью стоимости вызова.
Задача
Free LLM APIs frequently become unavailable or degrade, forcing developers to re‑integrate code for each provider.
Результат
The setup allows developers to switch between four free LLM models—qwen3.8-max, Hunyuan-MT-7B, GLM-Z1-9B, and agnes-3.0-flash—by changing only the model string, with zero code changes and immediate per‑call cost visibility.
Рабочий процесс
- Obtain an API key from apishare.cc
- Set the key in the environment (e.g., export APISHARE_KEY="your-key-here")
- Choose a model ID for the task (e.g., ApiShare/alibaba/qwen3.8-max:free for general chat)
- Send a POST request to https://apishare.cc/v1/chat/completions with the chosen model and messages
- Use the response, which includes an apishare_usage block with per‑call cost
Доказательства
Grab a key from apishare.cc. The gateway speaks the standard /v1/chat/completions protocol, so if your code already talks to OpenAI, zero code changes are needed:
One OpenAI-compatible endpoint + one key.
The billing answer nobody gives you: per-call cost in the response
- Дата записи: 2026-10-07T02:41:07.337Z