How to get Clef: trial, API key, Workers AI and open weights
Clef and Clef-flash are Cloudflare’s open-weight decision models. You can try Clef-flash in your browser now with no account, call both through a JevStation API key alongside Jev, call Workers AI yourself with a Cloudflare account (10,000 Neurons a day free), or download the weights. Which is best depends on whether you already run on Cloudflare and whether you also want Jev.
用你自己的文本试试
修改示例后运行。无需账号,每天免费 3 次。
场景
把工单分给对应团队,评估紧急程度,并标记流失风险。
可以随意修改,Jev 会针对这里的内容回答该场景的问题。
The four ways to run Clef
Clef is a decision model: it answers typed questions — Choice, Score or Noul — about a state you send, with probabilities rather than text. It comes in two sizes, Clef (27B) and Clef-flash (9B), and you can reach them four ways:
- No-signup trial — Clef-flash in your browser, on preset use cases.
- JevStation API key — Clef, Clef-flash and Jev behind one key, billed in credits.
- Cloudflare Workers AI — your own Cloudflare account, billed per token, with a daily free allowance.
- Open weights — download from Hugging Face and run it on your own GPU.
1. No-signup trial
Steps. Open the Clef playground, pick an example, edit the text and press Run. The trial above this section works the same way, and the main playground has the same model picker.
Price. Free: 3 runs a day per visitor, on the preset question sets. The larger Clef model is not part of the trial.
Suits a first look at what a decision model returns.
2. JevStation API key
Steps. Create an account, make an API key in Settings › API Keys, and call POST https://jevstation.com/api/v1/systemone with "model": "clef-flash" or "model": "clef". Without the field, the same call runs Jev.
Price. Credits per evaluation, not per token. Clef-flash costs the same as Jev: 1 credit for a standard evaluation (up to 8,000 characters of state and five questions), 3 for a larger one. Clef costs twice that, 2 and 6, because its token price is nearly six times Jev’s. New accounts get 200 free credits; packs are $9.90 for 5,000 and $15.90 for 12,000, and a failed evaluation is refunded.
Pros. Jev and both Clef models with one key and one request format, so you can compare them side by side on your own data; a playground for designing questions, batch runs over a CSV, and MCP tools for Claude Code and Cursor.
Cons. More expensive per call than Workers AI at list price, and there is no free daily allowance beyond the trial.
Suits teams that want to test Clef against Jev, or that do not deploy on Cloudflare.
3. Cloudflare Workers AI, directly
Steps. Create a Cloudflare account. From a Worker, add an AI binding and call env.AI.run("@cf/cloudflare/clef-flash", body). From anywhere else, create an API token with the “Workers AI” template (or Workers AI read and edit permissions) and call the REST endpoint with your account ID.
Price. $0.24 per million input tokens for Clef and $0.09 for Clef-flash, output free. The first 10,000 Neurons each day are free on every account — about 1,200 typical Clef evaluations or 3,300 Clef-flash evaluations, by our token measurements. Beyond that you need the Workers Paid plan.
Pros. The cheapest hosted Clef, especially at small volumes, and the lowest latency if your code already runs on Cloudflare. Cloudflare says it does not store or train on requests.
Cons. You write and maintain the integration, the REST response is wrapped in an envelope you have to unwrap, and there is no Jev on Workers AI.
Suits developers who already deploy on Cloudflare and only need Clef.
4. Open weights
Steps. Download Cloudflare/clef or the Clef-flash weights from Hugging Face. Clef is built on Qwen3.8-27B and Clef-flash on Qwen3.5-9B; both are licensed Apache 2.0.
Price. Your hardware. Plan on a data-centre GPU for the 27B model.
Pros. Data never leaves your machines, there is no per-call bill, and you control the version — and, unlike the hosted model, the context limit.
Cons. You run the inference stack, and Cloudflare’s reinforcement-learning fine-tuning service is not part of the download.
Suits regulated data and very high, steady volume.
Call Clef through JevStation
The request is the same one the Jev guide uses, plus one field. Replace $JEVSTATION_API_KEY with your key.
curl -X POST https://jevstation.com/api/v1/systemone \
-H "Authorization: Bearer $JEVSTATION_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "clef-flash",
"state": "I have been trying to connect my Stripe account for 3 days and it keeps failing with invalid redirect. I am losing sales every hour.",
"questions": {
"category": {
"type": "choice",
"instructions": "Which team should handle this support ticket?",
"criteria": {
"billing": "Payments, invoices, refunds or plan changes",
"integrations": "Connecting or syncing a third-party service",
"bug": "The product behaves incorrectly",
"account": "Login, access or account settings"
}
},
"churn_risk": {
"type": "noul",
"instructions": "Is the customer at risk of churning?"
}
}
}'
The response has the same shape whichever model answers: data.model, data.answers, data.usage, and data.credits.charged. GET /api/v1/systemone lists the models you can pass and what each costs. To run the same check from an agent, the MCP tools take the same optional model argument.
Call Clef on Workers AI directly
From a Worker with an AI binding:
const result = await env.AI.run('@cf/cloudflare/clef-flash', {
model: 'clef-flash',
state: ticketText,
questions: {
churn_risk: {
type: 'noul',
instructions: 'Is the customer at risk of churning?',
},
},
});
// result.answers.churn_risk.noul → 0 to 1
Over REST, the same body goes to https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/run/@cf/cloudflare/clef-flash with Authorization: Bearer $CLOUDFLARE_API_TOKEN, and the answers come back under result. A model value that does not match the URL is rejected with error 5006.
Before you build on it
- Only the start of the state is read. On 2026-10-04 Workers AI read about the first 2,048 tokens of a Clef state and silently ignored the rest. Put the decisive text first. The full test.
- Retry once on 5xx. We saw one “Clef inference failed” (code 5012) in about 35 Clef calls.
- Benchmarks are the vendor’s. Cloudflare reports Clef ahead of Jev overall; no one has reproduced it yet. Jev vs Clef lists where each one leads.
Comparison at a glance
| Option | Account | Free usage | Paid price | Best for |
|---|---|---|---|---|
| JevStation trial | None | 3 runs a day, Clef-flash and Jev, presets | — | A first look |
| JevStation API key | Instant sign-up | 200 credits, valid 30 days | Clef-flash 1 credit, Clef 2 credits per standard evaluation | Comparing with Jev, no Cloudflare setup |
| Workers AI | Cloudflare account | 10,000 Neurons a day | Clef $0.24/M, Clef-flash $0.09/M input tokens | Code already on Cloudflare |
| Open weights | None | Unlimited, your hardware | Your GPU | Private data, steady high volume |
JevStation is independent and not affiliated with Cloudflare or TypeSafe. Clef is Cloudflare’s model; we run it through Workers AI.
常见问题
- Is Clef free to use?
- Partly. The weights are free under Apache 2.0. On Workers AI, every Cloudflare account gets 10,000 Neurons a day at no charge, about 1,200 typical Clef or 3,300 Clef-flash evaluations; after that Clef costs $0.24 and Clef-flash $0.09 per million input tokens. On JevStation, the no-signup trial includes Clef-flash and the 200 sign-up credits work on both models.
- What is the Clef model ID?
- On Workers AI the IDs are @cf/cloudflare/clef and @cf/cloudflare/clef-flash, and the request body must also carry "model": "clef" or "model": "clef-flash". On the JevStation API, send "model": "clef" or "clef-flash".
- How do I get a Clef API key?
- Two options. On Cloudflare, create an API token with Workers AI read and edit permissions and call the REST endpoint with your account ID. On JevStation, create an account, open Settings › API Keys, and send the key as a Bearer token to /api/v1/systemone with "model": "clef-flash" or "clef".
- Can I use Clef and Jev with the same code?
- Yes. Clef was built to accept Jev’s request format. On JevStation it is the same endpoint and the same key; you change only the model field. Calling Workers AI directly, the answers arrive inside a result object, so unwrap that first.
- How long can a Clef input be?
- Cloudflare lists a 65,536-token context, but in our test on 2026-10-04 Workers AI read only about the first 2,048 tokens of the state — a little over 12,000 characters of English prose — and ignored the rest without an error. Put the decisive part first, or use Jev for long inputs.
相关页面
把它接进你的流程
注册即送 200 点,保存自己的问题集,并通过 API 调用同样的评估。