Cloudflare AI Gateway Provider
기준일: 2026-07-26
난이도: 중급
공식 기준: Cloudflare AI gateway
개요
이 페이지는 OpenClaw Cloudflare AI Gateway provider의 인증, 모델 ref, 온보딩 플래그, 설정 키를 공식 문서 기준으로 정리합니다.
공식 요약: Cloudflare AI Gateway setup (auth + model selection)
model ref는 보통 provider/model 형식입니다. API key·endpoint·model id는 아래 원문 값을 그대로 쓰세요. 임의로 키나 엔드포인트를 만들지 마세요.
빠른 참조
| Property | Value |
|---|---|
| Provider | cloudflare-ai-gateway |
| Plugin | official external package (@openclaw/cloudflare-ai-gateway-provider) |
| Base URL | https://gateway.ai.cloudflare.com/v1/<account_id>/<gateway_id>/anthropic |
| Default model | cloudflare-ai-gateway/claude-sonnet-4-6 |
| API key | CLOUDFLARE_AI_GATEWAY_API_KEY (your provider API key for requests through the Gateway) |
공식 문서 기반 상세
아래는 공식 providers/cloudflare-ai-gateway 문서를 Mintlify 컴포넌트만 정리하고 공통 제목을 한국어로 맞춘 내용입니다. 설정 키, env, model ref, CLI 플래그는 원문 그대로 유지합니다.
Cloudflare AI Gateway sits in front of provider APIs and adds analytics, caching, and controls. For Anthropic, OpenClaw uses the Anthropic Messages API through your Gateway endpoint.
| Property | Value |
|---|---|
| Provider | cloudflare-ai-gateway |
| Plugin | official external package (@openclaw/cloudflare-ai-gateway-provider) |
| Base URL | https://gateway.ai.cloudflare.com/v1/<account_id>/<gateway_id>/anthropic |
| Default model | cloudflare-ai-gateway/claude-sonnet-4-6 |
| API key | CLOUDFLARE_AI_GATEWAY_API_KEY (your provider API key for requests through the Gateway) |
For Anthropic models routed through Cloudflare AI Gateway, use your Anthropic API key as the provider key.
When thinking is enabled for Anthropic Messages models, OpenClaw strips trailing assistant prefill turns before sending the payload through Cloudflare AI Gateway. Anthropic rejects response prefilling with extended thinking, while ordinary non-thinking prefill remains available.
Install plugin
Install the official plugin, then restart Gateway:
openclaw plugins install @openclaw/cloudflare-ai-gateway-provider
openclaw gateway restart
시작하기
Set the provider API key and Gateway details
Run onboarding and choose the Cloudflare AI Gateway auth option:
```bash
openclaw onboard --auth-choice cloudflare-ai-gateway-api-key
```
This prompts for your account ID, gateway ID, and API key.
Set a default model
Add the model to your OpenClaw config:
```json5
{
agents: {
defaults: {
model: { primary: "cloudflare-ai-gateway/claude-sonnet-4-6" },
},
},
}
```
Verify the model is available
```bash
openclaw models list --provider cloudflare-ai-gateway
```
Non-interactive example
For scripted or CI setups, pass all values on the command line:
openclaw onboard --non-interactive \
--mode local \
--auth-choice cloudflare-ai-gateway-api-key \
--cloudflare-ai-gateway-account-id "your-account-id" \
--cloudflare-ai-gateway-gateway-id "your-gateway-id" \
--cloudflare-ai-gateway-api-key "$CLOUDFLARE_AI_GATEWAY_API_KEY"
고급 설정
Authenticated gateways
If you enabled Gateway authentication in Cloudflare, add the `cf-aig-authorization` header. This is **in addition to** your provider API key.
```json5
{
models: {
providers: {
"cloudflare-ai-gateway": {
headers: {
"cf-aig-authorization": "Bearer <cloudflare-ai-gateway-token>",
},
},
},
},
}
```
The
cf-aig-authorizationheader authenticates with the Cloudflare Gateway itself, while the provider API key (for example, your Anthropic key) authenticates with the upstream provider.
Environment note
If the Gateway runs as a daemon (launchd/systemd), make sure `CLOUDFLARE_AI_GATEWAY_API_KEY` is available to that process.
A key exported only in an interactive shell will not help a launchd/systemd daemon unless that environment is imported there as well. Set the key in
~/.openclaw/.envor viaenv.shellEnvto ensure the gateway process can read it.
관련 문서
Choosing providers, model refs, and failover behavior.
General troubleshooting and FAQ.
검증 체크리스트
-
openclaw models list --provider cloudflare-ai-gateway로 모델이 보이는지 확인 - 기본 model alias를
agents.defaults.model.primary에 설정했는지 확인 - API key / OAuth / 로컬 런타임 인증 경로를 공식 문서와 대조했는지 확인
- failover 시 데이터가 다른 provider로 이동할 수 있는지 검토