Cloudflare Models and the Extraction API Added
Date: 2026-10-24 / (1405-08-02)
Summary
AvalAI adds eight Cloudflare-hosted models for extraction, decisions, text conversations, and vision. Clairic introduces /v1/extraction; the three Clef models use /v1/decisions and /v1/systemone. PhoneLLM, Apertus, EuroLLM, and Moondream extend the Chat Completions model selection.
Details
Clairic: typed extraction, computation, and predictions
cf.clairic reads text or embedded images and returns a named answer for each typed field. It can extract an invoice number, calculate an amount from the supplied evidence, resolve a date, return a list, estimate a bounded value, or forecast a sequence. Its field types are text, number, date, time, datetime, duration, list, estimate, and forecast.
Cloudflare introduced Clairic as a preview extraction model on October 19, 2026. Through AvalAI, use /v1/extraction with model: "cf.clairic", a state, and a fields object. Although Cloudflare describes it as System One-style, its fields contract differs from Clef's questions contract. Changing a decision request's model or URL alone does not turn it into an extraction request.
The difference between extraction and prediction matters. A text field can identify a span in the evidence; an estimate or forecast expresses uncertainty about a value that the evidence does not directly state. A missing value can be null, even when the response also contains a candidate guess. Use value as the result, preserve missing values, and verify consequential arithmetic or dates in application code. See the Extraction API reference and extraction-model guide.
Clef: focused decisions over shared evidence
Cloudflare's Clef series returns typed judgments instead of conversational replies. Use it to route support requests, check relevance, classify content, or score an item against an ordered rubric:
cf.clefis a 27-billion-parameter decision model with a 65,536-token input window.cf.clef-flashis a 9-billion-parameter variant with a 24,576-token input window and the lowest input price in this group.cf.clef-omniuses a 30-billion-parameter mixture-of-experts backbone with 3 billion active parameters and a 64,000-token input window. Cloudflare's native hosted schema documents text or JSON state plus embedded image, audio, and video inputs. The hosted Clef and Clef-flash schemas document embedded images; broader model or self-hosted video descriptions do not add a hostedvideosfield for those two models. These upstream schemas do not establish that every media format works on both AvalAI endpoints.
The October 1 Clef announcement and October 9 multimodal update explain the model family. AvalAI enables all three public IDs on /v1/decisions and /v1/systemone. The examples here use shared text. Consult the System One media-scope notes before adding media, and validate your selected model and input form.
Choose the request schema before writing the client:
| Interface | Shared evidence | Questions | Question types |
|---|---|---|---|
| Decisions | input | Array of named objects | predicate, choice, score |
| Native System One | state | Object keyed by question ID | noul, choice, score |
Decisions uses choices for Choice and levels for Score. Native System One uses criteria for both. Decisions returns an answers array; native System One returns an answers object. Keep these formats separate even when the judgment and selected model are the same.
Text conversations and vision
cf.phonellm-mini-alpha-2is an open model tuned for voice-agent conversations, based on Nemotron Nano 30B capabilities with thinking disabled. AvalAI exposes it as a text Chat Completions model with function calling and a 262,140-token context window. Speech recognition and synthesis belong to separate components in a voice pipeline; the model's name does not mean it accepts or generates audio through this route.cf.apertus-v1.5-8bis an 8-billion-parameter multilingual model from Swiss AI, with a 262,144-token context window. Cloudflare describes its open training-data approach. This announcement covers text chat through AvalAI; it does not announce vision or tool calling for this model.cf.eurollm-9b-itis a 9-billion-parameter multilingual model trained on 4 trillion tokens, including web data, parallel text, and curated datasets. AvalAI's catalog lists a 32,768-token context window; Cloudflare's page lists 32,000. Use the AvalAI catalog value for route planning and test the payload sizes your application needs.cf.moondream3.1-9b-a2bis a vision-language model with 9 billion total parameters and 2 billion active parameters in a mixture-of-experts design. It supports vision Chat Completions through AvalAI with a 32,768-token context window. Cloudflare documents nativequery,caption,point, anddetecttasks; these task keys and their native response formats are not the AvalAI Chat Completions schema. Sendmessagesand read the assistant message here.
All eight model IDs are available from AvalAI tier 0. Keep the cf. prefix and exact spelling in the request. The Cloudflare provider page collects availability, model limits, and integration notes.
Endpoint selection
| Models | AvalAI endpoint | Request shape |
|---|---|---|
cf.clairic | /v1/extraction | state and typed fields |
cf.clef, cf.clef-flash, cf.clef-omni | /v1/decisions or /v1/systemone | The selected decision schema above |
cf.phonellm-mini-alpha-2, cf.apertus-v1.5-8b, cf.eurollm-9b-it, cf.moondream3.1-9b-a2b | /v1/chat/completions | messages; image content for Moondream vision |
Send requests to https://api.avalai.ir with Authorization: Bearer $AVALAI_API_KEY. Keep the key in a server environment. The model selection does not enable other endpoints or import Cloudflare's native authentication and account-specific URLs.
AvalAI pricing and context
Prices below are USD per 1 million tokens, from AvalAI's current catalog. Context values are token limits for the model; schema, questions, media, and conversation history also consume input capacity.
| AvalAI model ID | Context / input window | Input | Cached input | Output |
|---|---|---|---|---|
cf.clairic | 65,536 | $0.10 | $0.00 | $0.00 |
cf.clef | 65,536 | $0.24 | $0.00 | $0.00 |
cf.clef-flash | 24,576 | $0.038 | $0.00 | $0.00 |
cf.clef-omni | 64,000 | $0.15 | $0.00 | $0.00 |
cf.phonellm-mini-alpha-2 | 262,140 | $0.06 | $0.006 | $0.24 |
cf.apertus-v1.5-8b | 262,144 | $0.10 | $0.01 | $0.20 |
cf.eurollm-9b-it | 32,768 | $0.10 | $0.01 | $0.20 |
cf.moondream3.1-9b-a2b | 32,768 | $0.30 | $0.03 | $1.00 |
Zero output pricing for Clairic and Clef does not make the whole request free: input is billed. A zero cached-input price does not establish cache hits, cache-control parameters, or a cache lifetime. Inspect actual usage and estimated_cost; do not infer billable input from the visible text alone. Clairic can perform multiple passes, and media and field schemas can affect input usage. See pricing for the current published catalog.
API request and response examples
The following requests are schema-based AvalAI adaptations. The responses are complete illustrative examples, not captured live AvalAI results. Answer values, probabilities, token counts, timestamps, exchange rates, and costs are hypothetical. They show how to read each envelope; they do not measure model accuracy or establish live client compatibility. Each curl request sends one attempt with bounded timeouts.
Extract and calculate invoice fields with Clairic
This example combines literal extraction, a computed payment date and amount, a list, a missing purchase-order number, and an estimate. The predicted payment delay is different from the contractual due date.
curl --silent --show-error --fail-with-body \
--connect-timeout 10 --max-time 60 \
https://api.avalai.ir/v1/extraction \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary '{
"model": "cf.clairic",
"state": "Invoice INV-2291 from Northwind Supply, issued 2026-09-02, net 30. 4 pallets at $250.00 each, shipping $80.00. Contact: Dana Ruiz, Priya Shah.",
"fields": {
"invoice_number": { "type": "text" },
"due_date": { "type": "date", "instructions": "Issue date plus the net payment days" },
"total": { "type": "number", "decimals": 2, "unit": "USD", "instructions": "Amount due including shipping" },
"contacts": { "type": "list", "items": "text" },
"po_number": { "type": "text", "instructions": "Purchase order number" },
"days_to_pay": { "type": "estimate", "min": 0, "max": 120, "step": 1, "instructions": "Days after issue until this invoice is paid" }
}
}'Complete illustrative response, adapted from Cloudflare's documented Clairic envelope and AvalAI's cost fields:
{
"model": "cf.clairic",
"answers": {
"invoice_number": {
"type": "text",
"p_null": 3.8e-10,
"span": [
8,
16
],
"guess": "INV-2291",
"confidence": 1.0,
"value": "INV-2291"
},
"due_date": {
"type": "date",
"p_null": 1.9e-08,
"guess": "2026-10-02",
"confidence": 0.9999,
"value": "2026-10-02"
},
"total": {
"type": "number",
"p_null": 2.3e-08,
"guess": 1080,
"confidence": 0.9999,
"value": 1080
},
"contacts": {
"type": "list",
"value": [
"Dana Ruiz",
"Priya Shah"
],
"spans": [
[
120,
129
],
[
131,
141
]
],
"confidence": 0.9999
},
"po_number": {
"type": "text",
"p_null": 1.0,
"span": [
8,
16
],
"guess": "INV-2291",
"confidence": 0.9995,
"value": null
},
"days_to_pay": {
"type": "estimate",
"value": 30,
"mean": 29.535,
"median": 30,
"p10": 21,
"p90": 38,
"p_below": 5.9e-06,
"p_above": 1.2e-05
}
},
"truncated": false,
"usage": {
"state_tokens": 61,
"image_tokens": 0,
"schema_tokens": 472,
"input_tokens": 655,
"output_tokens": 0,
"passes": 3
},
"estimated_cost": {
"unit": "0.0000655000",
"irt": 17.69,
"exchange_rate": 270000
}
}Read answers.total.value, not the entire answer object. The missing purchase-order number remains null; guess does not replace it. p10 and p90 describe uncertainty in the payment-delay estimate, not a promised payment date. Check truncated before using an answer that may depend on omitted evidence. The hypothetical input charge is 655 × $0.10 / 1,000,000 = $0.0000655; use the returned accounting values for a real request.
For image extraction, use the documented embedded images format, not a remote image URL or Chat Completions image_url. reference_date anchors dates without a year. The reference explains options, forecast bounds and horizons, optional answer metadata, and the limits of confidence signals.
Make three independent judgments with native Clef
One shared state can answer urgency, routing, and severity questions. To select the other enabled Clef variants, change only model to cf.clef or cf.clef-omni while retaining this native request shape.
curl --silent --show-error --fail-with-body \
--connect-timeout 10 --max-time 30 \
https://api.avalai.ir/v1/systemone \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary '{
"model": "cf.clef-flash",
"state": "Checkout has been failing for every customer for the last hour.",
"questions": {
"urgent": { "type": "noul", "instructions": "Is this support request urgent?" },
"team": {
"type": "choice",
"instructions": "Which team should handle this request?",
"criteria": {
"billing": "Payments, invoices, and refunds",
"technical": "Outages, errors, and configuration",
"sales": "Plans and upgrades"
}
},
"severity": {
"type": "score",
"instructions": "How severe is the customer impact?",
"criteria": ["No impact", "Minor", "Major", "Critical"]
}
}
}'Complete illustrative native response:
{
"model": "cf.clef-flash",
"answers": {
"urgent": {
"type": "noul",
"noul": 0.98
},
"team": {
"type": "choice",
"choice": "technical",
"probabilities": {
"billing": 0.05,
"technical": 0.94,
"sales": 0.01
},
"confidence": 0.9
},
"severity": {
"type": "score",
"score": 2.9,
"legend": {
"0": "No impact",
"1": "Minor",
"2": "Major",
"3": "Critical"
},
"probabilities": {
"0": 0.01,
"1": 0.01,
"2": 0.05,
"3": 0.93
},
"confidence": 0.9
}
},
"usage": {
"input_tokens": 400,
"output_tokens": 0
},
"estimated_cost": {
"unit": "0.0000152000",
"irt": 4.1,
"exchange_rate": 270000
}
}noul is the probability of yes. choice identifies a supplied category. The four-level score lies between 0 and 3 and can be fractional; use the returned score rather than recalculating it from rounded probabilities. Validate answer IDs and ranges, and route uncertain or malformed results to review. A confidence signal does not authorize a refund, account change, or other action.
Use the Decisions schema for the same Clef task
This request evaluates the same evidence with the Decisions interface. The changes are structural: state becomes input, questions become an array, noul becomes predicate, and the choice and score definitions use choices and levels.
curl --silent --show-error --fail-with-body \
--connect-timeout 10 --max-time 30 \
https://api.avalai.ir/v1/decisions \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary '{
"model": "cf.clef-flash",
"input": "Checkout has been failing for every customer for the last hour.",
"questions": [
{ "name": "urgent", "type": "predicate", "instructions": "Is this support request urgent?" },
{
"name": "team",
"type": "choice",
"instructions": "Which team should handle this request?",
"choices": [
{ "value": "billing", "description": "Payments, invoices, and refunds" },
{ "value": "technical", "description": "Outages, errors, and configuration" },
{ "value": "sales", "description": "Plans and upgrades" }
]
},
{
"name": "severity",
"type": "score",
"instructions": "How severe is the customer impact?",
"levels": [
{ "label": "No impact" }, { "label": "Minor" },
{ "label": "Major" }, { "label": "Critical" }
]
}
]
}'Complete illustrative Decisions response:
{
"model": "cf.clef-flash",
"answers": [
{
"name": "urgent",
"type": "predicate",
"probability": 0.98
},
{
"name": "team",
"type": "choice",
"choice": "technical",
"probabilities": [
{
"value": "billing",
"probability": 0.05
},
{
"value": "technical",
"probability": 0.94
},
{
"value": "sales",
"probability": 0.01
}
],
"confidence": 0.9
},
{
"name": "severity",
"type": "score",
"score": 2.9,
"probabilities": [
{
"value": 0,
"label": "No impact",
"probability": 0.01
},
{
"value": 1,
"label": "Minor",
"probability": 0.01
},
{
"value": 2,
"label": "Major",
"probability": 0.05
},
{
"value": 3,
"label": "Critical",
"probability": 0.93
}
],
"confidence": 0.9
}
],
"usage": {
"input_tokens": 400,
"input_tokens_details": {
"cached_tokens": 0,
"cache_write_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 400
},
"estimated_cost": {
"unit": "0.0000152000",
"irt": 4.1,
"exchange_rate": 270000
}
}Find answers by name and read each primitive's field. This illustrative pair uses the same hypothetical values to explain the two schemas; real calls need not return identical values or usage. The native response has no Decisions-style answer array. See the decision-model guide for rubric design, probability interpretation, evaluation, and failure handling.
Text Chat Completions with PhoneLLM
The following clients send the same text request. The Python and JavaScript examples use the OpenAI SDK with AvalAI's /v1 base URL; install openai in the appropriate server environment. SDK transport compatibility for these new models has not been established by a live run here. Each SDK example disables automatic retries and sets a 30-second timeout.
curl --silent --show-error --fail-with-body \
--connect-timeout 10 --max-time 30 \
https://api.avalai.ir/v1/chat/completions \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary '{
"model": "cf.phonellm-mini-alpha-2",
"messages": [{ "role": "user", "content": "Write one brief greeting for a customer support call." }],
"max_tokens": 128
}'import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
timeout=30.0,
max_retries=0,
)
response = client.chat.completions.create(
model="cf.phonellm-mini-alpha-2",
messages=[
{
"role": "user",
"content": "Write one brief greeting for a customer support call.",
}
],
max_tokens=128,
)
print(response.model_dump_json(indent=2))import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
timeout: 30000,
maxRetries: 0,
});
const response = await client.chat.completions.create({
model: "cf.phonellm-mini-alpha-2",
messages: [{ role: "user", content: "Write one brief greeting for a customer support call." }],
max_tokens: 128,
});
console.log(JSON.stringify(response, null, 2));Complete illustrative Chat Completions response:
{
"id": "chatcmpl-example-phonellm",
"object": "chat.completion",
"created": 1792800000,
"model": "cf.phonellm-mini-alpha-2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello, thank you for calling. How can I help you today?",
"refusal": null
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 40,
"completion_tokens": 16,
"total_tokens": 56
},
"estimated_cost": {
"unit": "0.0000062400",
"irt": 1.68,
"exchange_rate": 270000
}
}Read choices[0].message.content. To use Apertus or EuroLLM for a text conversation, select cf.apertus-v1.5-8b or cf.eurollm-9b-it and evaluate the resulting behavior for your languages and workload. PhoneLLM function calls use the Chat Completions tool schema; your application validates arguments and executes authorized tools.
Vision Chat Completions with Moondream
This example uses the standard image-message shape with a public sample image. Use an image your application is permitted to send and that the service can access.
curl --silent --show-error --fail-with-body \
--connect-timeout 10 --max-time 60 \
https://api.avalai.ir/v1/chat/completions \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary '{
"model": "cf.moondream3.1-9b-a2b",
"messages": [{
"role": "user",
"content": [
{ "type": "text", "text": "Describe the visible scene in one sentence." },
{ "type": "image_url", "image_url": { "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg" } }
]
}],
"max_tokens": 128
}'Complete illustrative vision response:
{
"id": "chatcmpl-example-moondream",
"object": "chat.completion",
"created": 1792800000,
"model": "cf.moondream3.1-9b-a2b",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "A wooden boardwalk crosses a grassy wetland beneath a cloudy sky.",
"refusal": null
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 1000,
"completion_tokens": 20,
"total_tokens": 1020
},
"estimated_cost": {
"unit": "0.0003200000",
"irt": 86.4,
"exchange_rate": 270000
}
}Image tokens are part of the hypothetical input count here. Do not use these sample numbers as a per-image tariff or assume an image's token cost from its file size. Read the real response's usage and cost. Native Moondream object coordinates, detection arrays, or task-specific fields are not shown or promised by this chat example.
Integration and validation
Start with a small representative input, retain the requested model ID, and inspect the response shape before using its values. For Clairic, validate field types, null, date formats, and truncation. For Clef, validate named answers, allowed labels, finite probabilities, and the rubric range. For chat, check the assistant message and finish reason. Evaluate Persian and other target-language inputs separately when they matter to your product.
For a failed request, inspect the body and record avalai-request-id when present. Correct schema or authentication errors before resending; use bounded retries only for transient failures. A timeout may still correspond to a processed and charged request. Model judgments and confidence do not replace application permissions, deterministic checks, or human review for consequential actions.