Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set HTTP-Referer & X-Title headers #19

Open
alexanderilyin opened this issue Dec 12, 2024 · 0 comments
Open

Set HTTP-Referer & X-Title headers #19

alexanderilyin opened this issue Dec 12, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@alexanderilyin
Copy link

fetch("https://openrouter.ai/api/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${OPENROUTER_API_KEY}`,
    "HTTP-Referer": `${YOUR_SITE_URL}`, // Optional, for including your app on openrouter.ai rankings.
    "X-Title": `${YOUR_SITE_NAME}`, // Optional. Shows in rankings on openrouter.ai.
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "mistralai/mixtral-8x7b-instruct",
    "messages": [
      
      {"role": "user", "content": "Who are you?"},
      
    ],
  })
});
@alexanderilyin alexanderilyin added enhancement New feature or request good first issue Good for newcomers labels Dec 12, 2024
@alexanderilyin alexanderilyin self-assigned this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant