How to set up prefect server and local agent to make flow of flows

The API key is requested by the client when your agent assumes you are running flows with the Prefect Cloud backend. To switch to Server, either run:

prefect backend server

before starting the agent, or set the env variable on your agent:

export PREFECT__BACKEND="server"

More on that here: