LLM Reference
Cloudflare Workers AI

Using gpt-oss-20b on Cloudflare Workers AI

Implementation guide · GPT-OSS · OpenAI

ServerlessOpen Source

Quick Start

  1. 1
    Create an account at Cloudflare Workers AI and generate an API key.
  2. 2
    Use the Cloudflare Workers AI SDK or REST API to call @cf/openai/gpt-oss-20b — see the documentation for request format.
  3. 3
    You'll be billed $0.20/1M input, $0.30/1M output tokens. See full pricing.

Code Examples

See Cloudflare Workers AI documentation for integration details.

About Cloudflare Workers AI

Cloudflare Workers AI is a serverless GPU inference platform enabling developers to run machine learning models on Cloudflare's global edge network. It supports diverse AI tasks including text generation, image classification, automatic speech recognition, and real-time language translation. The platform provides pay-per-use pricing and access to a curated library of open-source models from Hugging Face, enabling rapid deployment without complex infrastructure management. Key features include low-latency edge computing, streaming responses for large language models, context length customization, and the AI Gateway for monitoring, caching, and cost optimization.

Cloudflare is a leading connectivity cloud company that provides a comprehensive suite of cloud-native products and developer tools to enhance web performance, security, and reliability. Their services include content delivery network (CDN), DDoS mitigation, DNS services, and zero trust security solutions. While Cloudflare doesn't primarily market itself as an AI platform, they have incorporated AI and machine learning technologies into various aspects of their services to improve performance and security, including threat detection capabilities, content delivery optimization, and intelligent routing decisions across their global network.

Pricing on Cloudflare Workers AI

TypePrice (per 1M)
Input tokens$0.20
Output tokens$0.30

Capabilities

Function CallingTool UseStructured Outputs

About gpt-oss-20b

OpenAI open-weight model with 20 billion parameters. Lightweight, efficient text-only model with reasoning and function calling. Free for self-hosting. Released August 5, 2025.

Model Specs

Released2025-08-05
Parameters20B
Context131k
ArchitectureDecoder Only
Knowledge cutoff2025-08

More Models on Cloudflare Workers AI

Provider

Cloudflare Workers AI
Cloudflare Workers AI

Cloudflare

San Francisco, California, United States