Report app name to OpenRouter via X-OpenRouter-Title header

This commit is contained in:
Danila Poyarkov 2026-03-01 10:58:22 +03:00
parent b10785fdee
commit 9235a75e6f

View file

@ -21,7 +21,13 @@ watch(apiKey, (key) => {
const isConfigured = computed(() => apiKey.value.length > 0)
function createAgent() {
const openrouter = createOpenRouter({ apiKey: apiKey.value })
const openrouter = createOpenRouter({
apiKey: apiKey.value,
headers: {
'X-OpenRouter-Title': 'OpenPencil',
'HTTP-Referer': 'https://github.com/dannote/open-pencil',
},
})
return new ToolLoopAgent({
model: openrouter('anthropic/claude-sonnet-4'),