Skip to content

App attribution headers don't work #133

@MasterIO02

Description

@MasterIO02

The OpenRouter API docs says to use:

const openRouter = new OpenRouter({
  apiKey: '<OPENROUTER_API_KEY>',
  defaultHeaders: {
    'HTTP-Referer': 'https://myapp.com', // Your app's URL
    'X-Title': 'My AI Assistant', // Your app's display name
  },
});

but defaultHeaders doesn't exist in type SDKOptions.

There are the "xTitle" and "httpReferer" parameters instead, but they aren't working. I don't see them going anywhere in the SDK code.

The AI-generated request code, like in src/funcs/completionsGenerate.ts, doesn't include the HTTP-Referer and X-Title headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions