[AI Gateway] Dynamic Routing - JSON configuration
Existing documentation URL(s)
https://developers.cloudflare.com/ai-gateway/features/dynamic-routing/json-configuration/
Hello team,
How to use REST API to configure dynamic routing? I cannot find endpoint to do that
What changes are you suggesting?
Could you please add example REST API to configure dynamic routing?
Additional information
No response
I can confirm this is missing. The docs say "you can do it using the REST API" but there's no endpoint documented anywhere.
For comparison, the Custom Providers API docs show exactly what we need: https://developers.cloudflare.com/ai-gateway/configuration/custom-providers/
curl -X POST "https://api.cloudflare.com/client/v4/accounts/{account_id}/ai-gateway/custom-providers" \
-H "Authorization: Bearer {token}" \
-d '{
"name": "My Provider",
"slug": "my-provider",
"base_url": "https://api.example.com/v1"
}'
We need the same for dynamic routes.
Good catch, looking into it
Good catch, looking into it
Could you support create/update BYOK via API?
https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/
Moreover, could you consider to support "use authorization header" to use authorization header instead of cf-aig-authorization? (Because some client only support authorization header)
https://developers.cloudflare.com/ai-gateway/configuration/authentication/
Dynamic Routes endpoints are now documented
https://developers.cloudflare.com/api/resources/ai_gateway/subresources/dynamic_routing/methods/list/
Moreover, could you consider to support "use authorization header" to use authorization header instead of cf-aig-authorization? (Because some client only support authorization header)
https://developers.cloudflare.com/ai-gateway/configuration/authentication/
@letanloc1998 this is already supported, we'll take the cloudflare api token from cf-aig-authorization header and other vendor auth headers (Authorization, x-goog-api-key) so you can also pass the cloudflare api token in the apikey field in most vendor SDKs, provided the actual vendor api key is stored with BYOK or you are using Unified Billing