Hey all, is there an easy way to store my keys in the cloudflare dashboard and then call the unified

Hey all, is there an easy way to store my keys in the cloudflare dashboard and then call the unified api? When i do this I still have to provide the api key of my underlying provider. How did you fix this? Here is an example with cerebras

const client = new OpenAI({
            apiKey: apiKey,
            baseURL: 'https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat',
            defaultHeaders: {
                'cf-aig-authorization': `Bearer ${apiKey}`,
            },
        });

        const response = await client.chat.completions.create({
            model: 'cerebras/gpt-oss-120b',
            messages: [{ role: 'user', content: 'What is cloudflare?' }],
        });

apiKey is the gateway key.
Or did I get it wrong that the unified api (openai compatible) doesn't yet work with the BYOK (Store keys) feature?
Would love to hear if anyone knows.
Was this page helpful?