Skip to content

Send OpenRouter app-attribution headers #17

Description

@DevMortimer

Wanted

Send OpenRouter's app-attribution headers on the OpenRouter backend (docs):

  • HTTP-Referer: required for an app page and for rankings.
  • X-OpenRouter-Title: the display name.
  • X-OpenRouter-Categories: for example cli-agent or ide-extension.
  • Optionally X-OpenRouter-App-Visibility: hidden.

By default, name pi-typesafe. Add a createTypeSafe option (for example attribution) so an extension built on this library can name itself instead.

Constraints

  • The headers go only to the OpenRouter backend. Requests to the TypeSafe backend stay exactly as they are.
  • The headers carry no secret and no user content.
  • The SDK client accepts defaultHeaders. Check that they reach the injected fetch on both the judgment request and the model list.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions