Log classification analyzes the request and response content stored in AI Gateway logs. It classifies eligible traffic by task and assesses whether the model used matches the task requirements.
These results power Task and model analysis in User Insights. Log classification is turned off by default. You must turn it on for each gateway individually.
AI Gateway assigns task classifications such as debugging, code planning, code Q&A, text drafting, and coding. The Tasks by model chart shows how token usage and estimated spend are distributed across these classifications for each model.
AI Gateway compares the task requirements with the capabilities of the model used. It classifies model fit as Overkill, Appropriate, Underpowered, or Could not assess. You can compare these results by token usage or estimated spend.
When log classification is turned on, Cloudflare may process stored request and response content, including:
- Prompts
- Model responses
- Request metadata
- Identifiers used to associate related requests into a conversation
Cloudflare uses this information to generate task and model-fit classifications for AI Gateway analysis features.
Log classification is not required to use AI Gateway or standard log collection. Turning on this setting allows Cloudflare to analyze eligible logs for the selected gateway as described on this page. This setting is gateway-specific: turning it on for one gateway does not turn it on for other gateways in your account.
- Collect logs must also be turned on for the gateway.
- Only activity recorded while both Collect logs and Log classification are turned on is eligible for classification.
- Turning off Collect logs also turns off log classification.
- Turning off Log classification prevents new gateway activity from being classified. Work already in progress and previously generated results remain subject to applicable retention and deletion policies.
-
In the Cloudflare dashboard, go to AI Gateway.
Go to AI Gateway ↗ -
Select a gateway, then go to Settings.
-
Turn on Collect logs.
-
Turn on Log classification.
To stop classifying new activity, go to your gateway's Settings and turn off Log classification.
You can continue collecting logs without turning on classification.