Comparez et testez des modèles open weight pour le texte, le code, la voix et la vision, sans inscription. Passez ensuite en production avec la même API compatible OpenAI.
Clef-Flash is a decision model from Cloudflare: it answers typed questions (choice, score, yes/no) about a text, with calibrated probabilities, following the System One request shape. Text only.
The Decision API answers typed questions about a text, with calibrated probabilities.
A decision model reads a state (a message, an e-mail, a ticket, a JSON document...) and a set of questions, and returns for each question a typed answer together with the probability of every possible outcome. Unlike a chat model, it does not generate text: it reads the state once and gives a structured, reproducible answer, which makes it a good fit for routing, triage, moderation or any step of an agent that has to decide how to act.
clef-flash takes text only.
There are three types of questions:
Several questions can be asked in a single request: the state is read once. The order matters: the model labels the options A, B, C... and the levels 0, 1, 2... in the order received, so keep the order of the questions, options and levels stable. The API follows the System One format introduced by TypeSafe, so its clients only need a new base URL.
First install the requests library:
pip install requestsNext, export your access token to the OVH_AI_ENDPOINTS_ACCESS_TOKEN environment variable:
export OVH_AI_ENDPOINTS_ACCESS_TOKEN=<your-access-token>If you do not have an access token key yet, follow the instructions in the AI Endpoints – Getting Started.
Finally, run the following Python code:
import os
import requests
url = "https://oai.endpoints.kepler.ai.cloud.ovh.net/api/v1/systemone"
headers = {
"Authorization": f"Bearer {os.getenv('OVH_AI_ENDPOINTS_ACCESS_TOKEN')}",
"Content-Type": "application/json"
}
payload = {
"model": "clef-flash",
"state": "Hi, I just deployed my first Public Cloud instance and I would like to enable automatic backups before launching my website next week. How can I set this up, and what does it cost?",
"questions": {
"department": {
"type": "choice",
"criteria": {
"billing": "Invoice, payment or subscription issues",
"technical": "Outages, bugs or infrastructure problems",
"sales": "Pricing, offers or account questions"
}
},
"frustration": {
"type": "score",
"criteria": [
"Calm, just stating facts",
"Frustrated but civil",
"Very angry, strong language"
]
},
"is_urgent": {
"type": "noul",
"instructions": "The message conveys urgency or time-sensitivity"
}
}
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
for question, answer in response.json()["answers"].items():
print(question, answer)
else:
print("Error:", response.status_code, response.text)curl https://oai.endpoints.kepler.ai.cloud.ovh.net/api/v1/systemone \
-H "Authorization: Bearer $OVH_AI_ENDPOINTS_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "clef-flash",
"state": "Hello, I would like to download the invoice of the previous month for my Public Cloud project. Where can I find it?",
"questions": {
"department": {
"type": "choice",
"criteria": {"billing": "Payments and invoices", "technical": "Bugs", "sales": null}
}
}
}'The request and the response follow the System One format, so its clients only need this base URL.
Want to explore the full capabilities of the Decision API? Dive into our dedicated Decision Models guide to discover the question types in detail and ready to run code examples in Python, JavaScript, and cURL.
{
"model": "clef-flash",
"answers": {
"department": {
"type": "choice",
"choice": "sales",
"confidence": 0.8309,
"probabilities": {"billing": 0.0862, "technical": 0.0829, "sales": 0.8309}
},
"frustration": {
"type": "score",
"score": 0.0292,
"confidence": 0.9726,
"legend": {"0": "Calm, just stating facts", "1": "Frustrated but civil", "2": "Very angry, strong language"},
"probabilities": {"0": 0.9726, "1": 0.0255, "2": 0.0018}
},
"is_urgent": {"type": "noul", "noul": 0.069}
},
"usage": {"input_tokens": 368, "output_tokens": 0},
"object": "decision"
}Only the tokens of the state and of the questions (input_tokens) are billed.
If you exceed this limit, a 429 error code will be returned.
For a broader overview of AI Endpoints, explore the full AI Endpoints Documentation.
Reach out to our support team or join the OVHcloud Discord #ai-endpoints channel to share your questions, feedback, and suggestions for improving the service, to the team and the community.