Accessing API using rust WASM worker. CORS error

For Workers & Pages, what is the name of the domain?

api.cloudflare.com

What is the issue or error you’re encountering

CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 400.

What steps have you taken to resolve the issue?

I have searched everywhere with many different search phrases.
The only answer I found is “use a worker”
So I wrote a worker and still get the same error
I tried cloudflare-rs using auth-key and email but I get
HTTP 400 Bad Request:
Error 6003: Invalid request headers
error_chain: [{“code”:6103,“message”:“Invalid format for X-Auth-Key header”}]
result: null
success: false
messages:

What are the steps to reproduce the issue?

try to access the api from a program.

I would like a cookie cutter example of how to access the API so I can parse the return json and get the DNS for every domain so I can check the security