Skip to main content
Same idea as OpenRouter: you pick one slash-separated route per client via id. Changing model = new Cloudflare(id=...) or a new Agent(model="cloudflare:...") string.
switch_model.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export environment variables

4

Run the example

Save the code above as switch_model.py, then run:
Full source: cookbook/90_models/cloudflare/switch_model.py