Code of Conduct
What article on docs.github.com is affected?
<title>AI Chat Website</title>
<style>
body{
margin:0;
font-family:Arial,sans-serif;
background:#0f172a;
color:white;
}
.chat-container{
max-width:900px;
margin:20px auto;
padding:20px;
}
h1{
text-align:center;
}
#chat-box{
height:500px;
overflow-y:auto;
background:#1e293b;
border-radius:10px;
padding:15px;
}
.message{
padding:10px;
margin:10px 0;
border-radius:10px;
}
.user{
background:#2563eb;
text-align:right;
}
.ai{
background:#334155;
}
.input-area{
display:flex;
gap:10px;
margin-top:15px;
}
input{
flex:1;
padding:12px;
border:none;
border-radius:8px;
outline:none;
}
button{
padding:12px 20px;
border:none;
border-radius:8px;
cursor:pointer;
background:#10b981;
color:white;
font-weight:bold;
}
</style>
AI Chat Website
<div id="chat-box"></div>
<div class="input-area">
<input type="text" id="user-input" placeholder="Type your message...">
<button onclick="sendMessage()">Send</button>
</div>
<script>
const API_KEY = "YOUR_OPENROUTER_API_KEY";
async function sendMessage() {
const input = document.getElementById("user-input");
const chatBox = document.getElementById("chat-box");
const message = input.value.trim();
if(!message) return;
chatBox.innerHTML += `
${message}
`;
input.value="";
try {
const response = await fetch(
"https://openrouter.ai/api/v1/chat/completions",
{
method:"POST",
headers:{
"Authorization":"Bearer " + API_KEY,
"Content-Type":"application/json"
},
body:JSON.stringify({
model:"openai/gpt-4o-mini",
messages:[
{
role:"user",
content:message
}
]
})
});
const data = await response.json();
const reply =
data.choices?.[0]?.message?.content ||
"No response received.";
chatBox.innerHTML += `
${reply}
`;
chatBox.scrollTop = chatBox.scrollHeight;
} catch(error){
chatBox.innerHTML += `
Error: ${error.message}
`;
}
}
</script>
What part(s) of the article would you like to see updated?
<title>AI Chat Website</title>
<style>
body{
margin:0;
font-family:Arial,sans-serif;
background:#0f172a;
color:white;
}
.chat-container{
max-width:900px;
margin:20px auto;
padding:20px;
}
h1{
text-align:center;
}
#chat-box{
height:500px;
overflow-y:auto;
background:#1e293b;
border-radius:10px;
padding:15px;
}
.message{
padding:10px;
margin:10px 0;
border-radius:10px;
}
.user{
background:#2563eb;
text-align:right;
}
.ai{
background:#334155;
}
.input-area{
display:flex;
gap:10px;
margin-top:15px;
}
input{
flex:1;
padding:12px;
border:none;
border-radius:8px;
outline:none;
}
button{
padding:12px 20px;
border:none;
border-radius:8px;
cursor:pointer;
background:#10b981;
color:white;
font-weight:bold;
}
</style>
AI Chat Website
<div id="chat-box"></div>
<div class="input-area">
<input type="text" id="user-input" placeholder="Type your message...">
<button onclick="sendMessage()">Send</button>
</div>
<script>
const API_KEY = "YOUR_OPENROUTER_API_KEY";
async function sendMessage() {
const input = document.getElementById("user-input");
const chatBox = document.getElementById("chat-box");
const message = input.value.trim();
if(!message) return;
chatBox.innerHTML += `
${message}
`;
input.value="";
try {
const response = await fetch(
"https://openrouter.ai/api/v1/chat/completions",
{
method:"POST",
headers:{
"Authorization":"Bearer " + API_KEY,
"Content-Type":"application/json"
},
body:JSON.stringify({
model:"openai/gpt-4o-mini",
messages:[
{
role:"user",
content:message
}
]
})
});
const data = await response.json();
const reply =
data.choices?.[0]?.message?.content ||
"No response received.";
chatBox.innerHTML += `
${reply}
`;
chatBox.scrollTop = chatBox.scrollHeight;
} catch(error){
chatBox.innerHTML += `
Error: ${error.message}
`;
}
}
</script>
Additional information
No response
Code of Conduct
What article on docs.github.com is affected?
<title>AI Chat Website</title> <style> body{ margin:0; font-family:Arial,sans-serif; background:#0f172a; color:white; } .chat-container{ max-width:900px; margin:20px auto; padding:20px; } h1{ text-align:center; } #chat-box{ height:500px; overflow-y:auto; background:#1e293b; border-radius:10px; padding:15px; } .message{ padding:10px; margin:10px 0; border-radius:10px; } .user{ background:#2563eb; text-align:right; } .ai{ background:#334155; } .input-area{ display:flex; gap:10px; margin-top:15px; } input{ flex:1; padding:12px; border:none; border-radius:8px; outline:none; } button{ padding:12px 20px; border:none; border-radius:8px; cursor:pointer; background:#10b981; color:white; font-weight:bold; } </style>AI Chat Website
What part(s) of the article would you like to see updated?
<title>AI Chat Website</title> <style> body{ margin:0; font-family:Arial,sans-serif; background:#0f172a; color:white; } .chat-container{ max-width:900px; margin:20px auto; padding:20px; } h1{ text-align:center; } #chat-box{ height:500px; overflow-y:auto; background:#1e293b; border-radius:10px; padding:15px; } .message{ padding:10px; margin:10px 0; border-radius:10px; } .user{ background:#2563eb; text-align:right; } .ai{ background:#334155; } .input-area{ display:flex; gap:10px; margin-top:15px; } input{ flex:1; padding:12px; border:none; border-radius:8px; outline:none; } button{ padding:12px 20px; border:none; border-radius:8px; cursor:pointer; background:#10b981; color:white; font-weight:bold; } </style>AI Chat Website
Additional information
No response