Developer Docs

Use your FreeLLMAPI key with OpenAI-compatible clients or Anthropic Messages-compatible clients.

Quickstart

OpenAI Base URL: https://api.freellmapi.ai/v1
Anthropic Base URL: https://api.freellmapi.ai
Recommended model: glm-5.2
Fallback model: glm-4.7
Available OpenAI-format models: glm-5.2, glm-5.1, glm-4.7
New models: qwen3.8-max-preview, kimi-k3
API key: sk_live_xxx

OpenAI Python

from openai import OpenAI

client = OpenAI(
    api_key="sk_live_xxx",
    base_url="https://api.freellmapi.ai/v1",
)

resp = client.chat.completions.create(
    model="glm-5.2",
    messages=[{"role": "user", "content": "Write a Python script"}],
)

print(resp.choices[0].message.content)

OpenAI Node.js

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "sk_live_xxx",
  baseURL: "https://api.freellmapi.ai/v1",
});

const resp = await client.chat.completions.create({
  model: "glm-5.2",
  messages: [{ role: "user", content: "Write a TypeScript helper" }],
});

console.log(resp.choices[0].message.content);

Anthropic Messages compatibility

Use this endpoint for clients that speak the Anthropic Messages API, including Claude-style coding clients. Supported model IDs such as kimi-k3 are routed to their native provider.

curl https://api.freellmapi.ai/v1/messages   -H "x-api-key: sk_live_xxx"   -H "anthropic-version: 2023-06-01"   -H "content-type: application/json"   -d '{
    "model": "kimi-k3",
    "max_tokens": 512,
    "messages": [
      {"role": "user", "content": "Write a Python helper"}
    ]
  }'
# Claude-style clients
ANTHROPIC_BASE_URL=https://api.freellmapi.ai
ANTHROPIC_AUTH_TOKEN=sk_live_xxx

Current scope: text messages with Anthropic SSE streaming support. Tool use is not enabled yet. Unknown Anthropic model names continue to use the configured GLM compatibility target.

Endpoints

EndpointDescription
GET /v1/modelsList supported models.
POST /v1/chat/completionsOpenAI-compatible chat completion endpoint. Use Authorization: Bearer sk_live_xxx. Streaming is not enabled yet.
POST /v1/messagesAnthropic Messages-compatible endpoint for Claude-style clients. SSE streaming is supported; tool use is not enabled yet.
GET /v1/billing/usageCheck token balance and recent usage for your API key.

Chinese model providers

ProviderModel lineStatus on FreeLLMAPINotes
Z.ai / 智谱GLM-5.2, GLM-5.1, GLM-4.7Available nowUse glm-5.2 as the latest verified route. Use glm-4.7 as a fallback if upstream capacity is busy.
Alibaba Cloud / QwenQwen 3.8 Max PreviewAvailable nowUse qwen3.8-max-preview for reasoning, coding agents, and long-context work.
DeepSeekDeepSeek V3.2, DeepSeek V4 familyRoadmapCandidate provider for reasoning, coding, and price-sensitive workloads.
Moonshot AI / KimiKimi K3Available nowUse kimi-k3 with either OpenAI Chat Completions or Anthropic Messages.
Prompt logging: for abuse prevention and support, FreeLLMAPI records user email, API key, IP address, token usage, and a limited prompt preview up to 1000 characters.