> [Agent navigation index](/llms.txt)

# API Routes

Brix uses one typed contract for server handlers, imperative clients, component hooks, caching, retries, and failures. Choose the workflow that owns the code you are changing.

## Define and implement an endpoint

[Create a browser-safe contract, implement its server route, and understand route discovery and direct execution.](/docs/api-routes-server.md)

## Call an endpoint

[Configure reusable clients, consume contracts from components, cache GETs, retry safely, and handle request failures.](/docs/api-routes-clients.md)

## Return a custom HTTP response

[Use a response contract and route for redirects, downloads, streams, or application-owned request processing.](/docs/response-routes.md) Schema-owned JSON or flat URL-encoded input with JSON output uses API contracts. Response routes share managed registration and typed URL generation, not the API client or response-validation contract.
