freem /agents /agents.json /llms.txt examples ↗

One key. Every freem product API.

One API key is the universal credential for every freem product. Create a key, send it as a Bearer token, and call any product API. A key carries a recharge balance (for the LLM gateway) and a per-product subscription level (for product daily quotas).

面向 agent:一把 API key 即通用凭证。充值余额只用于 LLM 网关(按 token 计费),per-product 订阅级别决定各产品的每日配额。机器可读清单见 /agents.json

1 · Get a key

GET https://api.clssai.com/key — anonymous, instant, with a $0.10 trial credit (no card required). Or sign in and use the panel below — your default key is bound automatically.

2 · Call any API

Send Authorization: Bearer sk-… to any product endpoint below, or the OpenAI-compatible gateway.

3 · Recharge / subscribe

Top up balance or set a per-product subscription via /api/agent/recharge · /api/agent/subscribe.

Your keys self-serve · 自助领取

Signed in: your bound keys appear here (first visit creates a default key). Not signed in: create an unbound key instantly — save it, it is shown only once here.

anonymous /key ↗

5-minute quickstart copy, paste, run · 复制即跑

# 1) Get a key
# Open https://api.clssai.com/key in a browser — anonymous, instant, and every key carries a $0.10 trial credit (no card required). Signed-in at freem.ai? GET /api/agent/my-keys auto-creates your bound default key.

# 2) Verify the key — see balance & per-product subs
curl https://freem.ai/api/agent/me -H 'Authorization: Bearer sk-YOURKEY'

# 3) First model call — OpenAI-compatible gateway
curl https://clssai.com/v1/chat/completions -H 'Authorization: Bearer sk-YOURKEY' -H 'Content-Type: application/json' -d '{"model":"claude-haiku-4-5","messages":[{"role":"user","content":"hi"}]}'

# 4) Call a product API — e.g. AI search with sources
curl -X POST https://freem.ai/api/search -H 'Authorization: Bearer sk-YOURKEY' -H 'Content-Type: application/json' -d '{"query":"what changed in AI agents this week","model":"auto"}'

The key model

Product APIs

Freem Search / Chat search

AI answer grounded in the live web, with sources. Streaming SSE or async queue.

MethodPathAuthParamsReturns
POST/api/searchBearer ✓
meter: skip_queue (instant) / privacy (private)
{ query, model: 'auto'|'pro', stream?: bool, instant?: bool, private?: bool, attachments?: [{dataUrl,mime}] }SSE: data:{delta} ... data:{done, summary(html), sources[], text}. Or async: {id,status} then poll /api/job.
POST/api/follow-upBearer ✓
meter: skip_queue / privacy
{ history:[{role,text}], query, model, stream?, instant?, private? }Same SSE/async shape as /api/search.
GET/api/job?id=Bearer ✓?id=<jobId>{ id, status, summary, sources[], text, error }

Notebooks (Cortex) notebook

Ground answers in your sources; generate audio/slides/video/infographic/docs.

MethodPathAuthParamsReturns
POST/api/notebook/createBearer ✓{ title? }{ notebook }
POST/api/notebook/source/addBearer ✓{ notebook_id, type:'url'|'youtube'|'text', content }{ source }
POST/api/notebook/chatBearer ✓{ notebook_id, query, source_ids[] }{ html, text, citations[], suggestions[] } (synchronous)
POST/api/notebook/generateBearer ✓
meter: notebook_gen
{ notebook_id, kind:'audio'|'video'|'slide_deck'|'infographic'|'report'|'quiz'|... , source_ids[], options }{ artifact:{ status:'running'|'done', request_id, url, text } } — poll GET /api/notebook/artifact?id=
GET/api/notebook/artifact?id=Bearer ✓?id=<artifactId>{ artifact }

Speak (pronunciation) speak

Text-to-speech helper for pronunciation practice. (Live scoring is an in-browser, interactive feature — not a headless agent API.)

MethodPathAuthParamsReturns
GET/api/speak/ttscookie?text=&voice=&rate=&fmt=wav|mp3audio/mpeg | audio/wav (edge-cached)

Account / membership membership

Inspect the caller's tier and per-feature daily quota.

MethodPathAuthParamsReturns
GET/api/membershipBearer ✓{ tier, features:{privacy,skip_queue,notebook_gen:{limit,used,remaining}} }
GET/api/agent/meBearer ✓{ key, balance, recharge, credit, consumption, expires_at, subs:{}, account:{user_id} }

ViaAI — AI Branch (merchant presence) via

Open a merchant's official branch in the AI world: 7-model presence audit, hosted machine-readable fact pages (JSON-LD + llms.txt + facts.json), keyword radar, publish channels. Human pages at /via; username-cookie login (/via/login), plans free/$20/$200/$2000.

MethodPathAuthParamsReturns
POST/api/via/auditcookie{ merchant, category, city, facts?, lang:'zh'|'en' }SSE: data:{stage:'start'|'result'|'judging'} ... data:{stage:'done', url:'/via/report/<id>', score:{presence,first,errors}} — what 7 AI platforms say about the merchant
POST/api/via/branchcookie{ facts:{ name, category, city, tagline, intro, address, phone, hours, price_range, services:[{name,price,desc}], faq:[{q,a}], ... }, lang }{ slug, token, url:'/via/b/<slug>' } — hosted fact page; token edits it
POST/api/via/keywordscookie{ category, city, merchant? }{ mode:'live'|'simulated', rows:[{keyword, search_volume, cpc, competition, monthly[]}] } — customer search demand
GET/via/b/<slug>/facts.jsonBearer ✓canonical merchant fact file (see also /via/b/<slug>/llms.txt)

LLM Gateway clssai.com/v1

OpenAI-compatible. Point any OpenAI SDK at the base URL with your sk- key. 100+ models (GPT, Claude, Gemini, Grok, DeepSeek, …). Billed against the key's recharge balance.

curl https://clssai.com/v1/chat/completions -H 'Authorization: Bearer sk-...' -d '{"model":"claude-haiku-4-5","messages":[{"role":"user","content":"hi"}]}'

Commerce — keys, recharge, subscribe

MethodPathParamsWhat it does
POST/api/agent/keys{ parent? }Create a fresh key (or a sub-key under a parent). Live & self-serve; signed-in creations bind to your account. IP-rate-limited.
GET/api/agent/my-keys(cookie session)List keys bound to the signed-in account; auto-creates and binds a default key on first call.
POST/api/agent/recharge{ key, amount, success_url? }Stripe one-time checkout that tops up the key's recharge balance. Disabled until AGENT_COMMERCE is enabled.
POST/api/agent/subscribe{ key, product, tier, interval }Stripe subscription that sets key.subs[product] = tier. Disabled until AGENT_COMMERCE is enabled.
Notes