Skip to main content

Module request

Module request 

Source
Expand description

What the gateway forwards: which paths, which of the harness’s headers, and which model the request names. Pure, so each is tested without a network.

Functions§

bearer_token
The gateway token the harness sent: Authorization: Bearer ... (Claude Code with ANTHROPIC_AUTH_TOKEN) or x-api-key.
forwarded_headers
named_model
The model the request body names, when it is JSON and names one.
path_allowed
The harness’s own paths a route serves. Anything else is refused, so the gateway is not a way to reach the rest of the upstream’s API with the person’s key.
upstream_url
with_served_model
The request body with its model made one the route serves. A harness that insists on a Claude name (the small model it uses for titles, an alias, a [1m] context suffix) is mapped to chosen, the model the agent was given. A body that is not JSON, or names no model, goes on as it is.