Skip to content

copilotHeaders

function copilotHeaders(appName, turn): Record<string, string>;

Defined in: core/src/auth/flows.ts:310

The editor headers Copilot’s gate wants on every call.

turn matters for the bill. GitHub charges one premium request per user-started turn and lets the agent’s own follow-ups ride free, and X-Initiator is how a client says which one this is. Leave it off and every tool call in a run bills as a new turn. The github-copilot preset sets it for you (initiatorHeader); this is for a call you make yourself.

Parameter Type
appName string
turn "user" | "agent"

Record<string, string>