Clef Docs
Playground + Workers AI examples. For production keys and POST /v1/clef-omni/run/, use the API Doc.
Start here
Clef Omni API Doc
Auth, curl, JSON schema, errors, and billing for the hosted decide API.
Open API Doc →Short notes for the Clef Playground: build a System One–compatible payload from state + typed questions, then read per-option probabilities. Guides: What is Clef Omni?, Clef decision model, example code.
Playground JSON example
json
{
"model": "clef-omni",
"state": "Checkout 5xx for 45 minutes. Payments team paging.",
"questions": {
"next": {
"type": "choice",
"instructions": "Next action?",
"criteria": {
"rollback": "Roll back the last deploy",
"page_oncall": "Page on-call now",
"wait": "Watch and wait"
}
},
"urgent": {
"type": "noul",
"instructions": "Should we page on-call immediately?"
}
}
}Workers AI binding (sketch)
ts
const model = "@cf/cloudflare/clef-omni"; // or clef / clef-flash
const result = await env.AI.run(model, {
model: "clef-omni",
state: "Checkout 5xx for 45 minutes. Payments team paging.",
questions: {
urgent: {
type: "noul",
instructions: "Should we page on-call immediately?",
},
},
});
// map result.answers → option probabilities → agent policyPrefer Clef Omni for audio/video. Compare sizes in Clef-flash vs Clef.
Quick steps
- Describe the environment in State (plain text or JSON; optional media on Omni).
- Add typed questions (noul, choice, or score) as an object map.
- Prototype in the playground, then ship with a sk_live_ API key.