Problem
Celeste provides extra_body as an escape hatch for provider-specific request body fields, but there's no equivalent for HTTP headers. This gap is felt today with Anthropic's 1M context window, which requires a beta header (anthropic-beta: context-1m-2025-08-07) and has premium pricing — making it something users must explicitly opt into.
Currently, the only way to influence headers is through the internal _beta_features convention, which is undocumented and fragile.
Proposal
Add extra_headers: dict[str, str] | None = None alongside extra_body on all client methods (generate, stream, analyze, speak, embed, edit).
User-facing API:
response = await celeste.text.generate(
"Analyze this massive codebase...",
model="claude-sonnet-4-6",
extra_headers={"anthropic-beta": "context-1m-2025-08-07"},
)
Scope
- Add
extra_headers parameter to _predict(), _stream() in base ModalityClient
- Thread it through all namespace methods (text, images, audio, videos, embeddings)
- Merge with provider-built headers in
_make_request() / _make_stream_request() (user headers take precedence)
- Apply to both public and private repos
Precedent
OpenAI's Python SDK offers extra_headers, extra_body, and extra_query on every request method. This is an established pattern for provider-agnostic SDKs.
Why not a dedicated parameter?
A context_window="1m" parameter would pollute the unified interface for a single provider's beta feature. extra_headers keeps provider-specific concerns where they belong — in the escape hatch.
Problem
Celeste provides
extra_bodyas an escape hatch for provider-specific request body fields, but there's no equivalent for HTTP headers. This gap is felt today with Anthropic's 1M context window, which requires a beta header (anthropic-beta: context-1m-2025-08-07) and has premium pricing — making it something users must explicitly opt into.Currently, the only way to influence headers is through the internal
_beta_featuresconvention, which is undocumented and fragile.Proposal
Add
extra_headers: dict[str, str] | None = Nonealongsideextra_bodyon all client methods (generate,stream,analyze,speak,embed,edit).User-facing API:
Scope
extra_headersparameter to_predict(),_stream()in baseModalityClient_make_request()/_make_stream_request()(user headers take precedence)Precedent
OpenAI's Python SDK offers
extra_headers,extra_body, andextra_queryon every request method. This is an established pattern for provider-agnostic SDKs.Why not a dedicated parameter?
A
context_window="1m"parameter would pollute the unified interface for a single provider's beta feature.extra_headerskeeps provider-specific concerns where they belong — in the escape hatch.