← 返回文章列表 / Back to list
overview

免费大模型 API 总览:聊天、绘图、语音

Free LLM API Overview: Chat, Image, and Voice

引言

把"免费大模型 API"按能力维度切片会清晰得多。本文从文本对话、图像生成、语音合成/识别三类各取代表,给出端点、配额与适用场景。比起死记几十个模型名,按任务家族来组织能让你在面对新模型时迅速归类——比如新出的某 Llama 变体只是文本对话类的又一选项,新出的 SDXL Lightning 只是图像生成类的一员。

flowchart LR A["Free LLM APIs"] A --> T["Text / Chat"] A --> I["Image Generation"] A --> V["Voice"] T --> T1["OpenRouter :free"] T --> T2["Groq LPU"] T --> T3["DeepSeek V3/R1"] T --> T4["Mistral La Plateforme"] T --> T5["Gemini Flash"] I --> I1["Hugging Face FLUX/SDXL"] I --> I2["Pollinations URL API"] V --> V1["Whisper-large-v3 ASR"] V --> V2["Edge-TTS Free"] V --> V3["Coqui / Fish Audio Trial"]

文本对话

  • OpenRouteropenrouter.ai/api/v1:free 模型零成本,协议与 OpenAI SDK 完全兼容。
  • Groqapi.groq.com/openai/v1,LPU 推理让首 token 延迟降到几十毫秒。
  • DeepSeekapi.deepseek.com/v1deepseek-reasoner 推理路径在数学与代码任务上表现突出。
  • Geminigenerativelanguage.googleapis.com/v1beta,多模态输入,免费层 1M 上下文。
  • Mistralapi.mistral.ai/v1open-mistral-7b 与 Mixtral 8x7B 都有免费配额。

图像生成

  • Hugging Face Inference:直接调用 black-forest-labs/FLUX.1-devstabilityai/sdxl 等开源大图模型,免费层 1 RPM 起步。
  • Pollinations.aihttps://image.pollinations.ai/prompt/{prompt},URL 即出图,无需注册,适合做 demo 与占位图。
  • Together AI:FLUX schnell 在 $5 信用内可跑数百张,端点 api.together.xyz/v1/images/generations

语音

  • ASR(语音转文字)whisper-large-v3 通过 Hugging Face 或 Groq 调用,Groq 端点秒级转录 1 分钟音频。
  • TTS(文字转语音):Edge-TTS 完全免费(基于微软 Edge 在线 TTS),Coqui XTTS 自部署可克隆音色,Fish Audio 有试用额度。

代码示例

from openai import OpenAI

# 文本对话:OpenRouter 调 Llama 3.3 70B 免费
client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key="sk-or-...")
r1 = client.chat.completions.create(
    model="meta-llama/llama-3.3-70b-instruct:free",
    messages=[{"role": "user", "content": "用 100 字介绍向量数据库"}],
)

# 图像:Pollinations URL API(无需 key)
import requests
url = "https://image.pollinations.ai/prompt/" + requests.utils.quote("cyberpunk city at night")
img = requests.get(url, timeout=120).content

# ASR:Groq 调 Whisper
gclient = OpenAI(base_url="https://api.groq.com/openai/v1", api_key="gsk_...")
with open("audio.mp3", "rb") as f:
    r3 = gclient.audio.transcriptions.create(model="whisper-large-v3", file=f)
print(r3.text)

选型建议

文本对话首选 OpenRouter(覆盖最广)+ Groq(延迟最低)做双备份;图像生成首选 Hugging Face(可控)+ Pollinations(无 key 降级);语音 ASR 用 Groq Whisper,TTS 用 Edge-TTS 起步、需要音色克隆时切到 Coqui 自部署。三类各有兜底后,单家 provider 停服不会让产品停转。

相关文章 / Related

免费 AI 编程智能体 Freebuff:零成本调用前沿大模型Groq 免费极速推理 API:13 个免费模型实测盘点免费视频生成 API 盘点OpenRouter 免费模型清单免费图像生成 API 盘点