Workers AI Specialized Models

Access 30+ Cloudflare Workers AI models for tasks beyond chat and embeddings — summarization, translation, image generation, speech-to-text, text-to-speech, classification, object detection, and more. These models use the /v1/run endpoint instead of /v1/chat/completions.

Features

Summarization

@cf/facebook/bart-large-cnn — Summarize long text into concise outputs. Input: { input_text, max_length }.

Translation

@cf/meta/m2m100-1.2b — Translate between 100+ language pairs. Input: { text, source_lang, target_lang }.

Text Classification

@cf/huggingface/distilbert-sst-2-int8 — Sentiment analysis and text classification. Input: { text }.

Image Classification

@cf/microsoft/resnet-50 — Classify images into 1000+ categories. Input: { image: [byte array] }.

Object Detection

@cf/facebook/detr-resnet-50 — Detect and locate objects in images with bounding boxes. Input: { image: [byte array] }.

Image Captioning

@cf/llava-hf/llava-1.5-7b-hf, @cf/uform/uform-gen2-qwen-500m — Generate text descriptions of images. Input: { image: [byte array], prompt }.

Image Generation

@cf/black-forest-labs/flux-1-schnell, @cf/stabilityai/stable-diffusion-xl-base-1.0, @cf/bytedance/stable-diffusion-xl-lightning, @cf/lykon/dreamshaper-8-lcm — Generate images from text prompts. Returns PNG binary.

Speech-to-Text

@cf/openai/whisper, @cf/openai/whisper-tiny-en, @cf/openai/whisper-large-v3-turbo — Transcribe audio to text. Input: { audio: [byte array] }.

Text-to-Speech

@cf/myshell-ai/melotts — Convert text to spoken audio. Returns binary audio. Input: { text }.

Task TypeModelInput FormatOutput Format
Summarization@cf/facebook/bart-large-cnn{ input_text, max_length? }JSON { summary }
Translation@cf/meta/m2m100-1.2b{ text, source_lang, target_lang }JSON { translated_text }
Text Classification@cf/huggingface/distilbert-sst-2-int8{ text }JSON [{ label, score }]
Image Classification@cf/microsoft/resnet-50{ image: [bytes] }JSON [{ label, score }]
Object Detection@cf/facebook/detr-resnet-50{ image: [bytes] }JSON [{ label, score, box }]
Image-to-Text@cf/llava-hf/llava-1.5-7b-hf{ image: [bytes], prompt }JSON { description }
Text-to-Image@cf/black-forest-labs/flux-1-schnell{ prompt, num_steps? }Binary PNG
Speech-to-Text@cf/openai/whisper{ audio: [bytes] }JSON { text, vtt?, words? }
Text-to-Speech@cf/myshell-ai/melotts{ text }Binary audio

Code Examples

Summarize text (cURL)

curl https://api.cloudvera.io/v1/run \
  -H "Authorization: Bearer cvk_your_cloudvera_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "@cf/facebook/bart-large-cnn",
    "input": {
      "input_text": "CloudVera is a security-first AI Gateway and Agent Runtime Control Plane. It sits between your application and LLM providers, giving you unified routing, security scanning, cost tracking, and observability across 12 AI providers...",
      "max_length": 50
    }
  }'

Translate text (Node.js)

const response = await fetch('https://api.cloudvera.io/v1/run', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer cvk_your_cloudvera_key',
  },
  body: JSON.stringify({
    model: '@cf/meta/m2m100-1.2b',
    input: {
      text: 'Hello, how are you?',
      source_lang: 'en',
      target_lang: 'fr',
    },
  }),
});

const data = await response.json();
console.log(data.result.translated_text); // "Bonjour, comment allez-vous ?"

Generate an image (Node.js)

import { writeFileSync } from 'fs';

const response = await fetch('https://api.cloudvera.io/v1/run', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer cvk_your_cloudvera_key',
  },
  body: JSON.stringify({
    model: '@cf/black-forest-labs/flux-1-schnell',
    input: {
      prompt: 'A futuristic city skyline at sunset, cyberpunk style',
      num_steps: 4,
    },
  }),
});

// Response is binary PNG
const buffer = await response.arrayBuffer();
writeFileSync('output.png', Buffer.from(buffer));
console.log('Image saved to output.png');

Transcribe audio (Node.js)

import { readFileSync } from 'fs';

const audioFile = readFileSync('recording.mp3');

const response = await fetch('https://api.cloudvera.io/v1/run', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer cvk_your_cloudvera_key',
  },
  body: JSON.stringify({
    model: '@cf/openai/whisper',
    input: {
      audio: [...audioFile],  // byte array
    },
  }),
});

const data = await response.json();
console.log(data.result.text); // "Hello, this is a test recording..."

Classify sentiment (Python)

import requests

response = requests.post(
    "https://api.cloudvera.io/v1/run",
    headers={
        "Authorization": "Bearer cvk_your_cloudvera_key",
        "Content-Type": "application/json",
    },
    json={
        "model": "@cf/huggingface/distilbert-sst-2-int8",
        "input": {"text": "This product is amazing!"},
    },
)

data = response.json()
# [{"label": "POSITIVE", "score": 0.9998}]
print(data["result"])

Generate an image (Python)

import requests

response = requests.post(
    "https://api.cloudvera.io/v1/run",
    headers={
        "Authorization": "Bearer cvk_your_cloudvera_key",
        "Content-Type": "application/json",
    },
    json={
        "model": "@cf/stabilityai/stable-diffusion-xl-base-1.0",
        "input": {"prompt": "A cat wearing sunglasses on a beach"},
    },
)

# Response is binary PNG
with open("output.png", "wb") as f:
    f.write(response.content)

print("Image saved to output.png")