# Cloudflare Workers AI (/docs/configuration/librechat_yaml/ai_endpoints/cloudflare)

> Setup: [AI Gateway Setup](https://developers.cloudflare.com/ai-gateway/get-started/) | [Workers AI Models](https://developers.cloudflare.com/workers-ai/models/)

**Notes:**

- **OpenAI Compatible:** Uses the OpenAI compatible endpoint specification ([documentation](https://developers.cloudflare.com/ai-gateway/providers/workersai/#openai-compatible-endpoints))
- **Known Issue:** `@cf/openai/gpt-oss-*` models may not work due to spec incompatibility
- **Environment Variables Required:**
  - `CF_API_TOKEN`: Your Cloudflare API token
  - `CF_ACCOUNT_ID`: Your Cloudflare account ID
  - `CF_GATEWAY_ID`: Your AI Gateway ID
  - Note: these environment variables can be customized/renamed as needed.

```yaml filename="librechat.yaml"
    - name: "Cloudflare Workers AI"
      apiKey: "${CF_API_TOKEN}"
      baseURL: "https://gateway.ai.cloudflare.com/v1/${CF_ACCOUNT_ID}/${CF_GATEWAY_ID}/workers-ai/v1"
      models:
        default: [
          "@cf/google/gemma-3-12b-it",
          "@cf/meta/llama-4-scout-17b-16e-instruct",
          "@cf/qwen/qwq-32b",
          "@cf/qwen/qwen2.5-coder-32b-instruct",
          "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
          "@cf/openai/gpt-oss-120b"
        ]
        fetch: false
      titleConvo: true
      titleModel: "@cf/google/gemma-3-12b-it"
      modelDisplayLabel: "Cloudflare AI"
```

![Cloudflare Workers AI in LibreChat](https://github.com/user-attachments/assets/722f8ba7-0773-4d8c-b01e-ccac22e0a4ea)
