gefiwek187's picture
Create templates/index.html
11a10b3 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DuckDuckGo Chat API</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: #f4f4f4;
}
h1, h2 {
color: #333;
}
code {
background-color: #e4e4e4;
padding: 2px 4px;
border-radius: 4px;
}
pre {
background-color: #e4e4e4;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
}
.endpoint {
background-color: #fff;
border: 1px solid #ddd;
padding: 15px;
margin-bottom: 20px;
border-radius: 5px;
}
</style>
</head>
<body>
<h1>πŸ¦† DuckDuckGo Chat API</h1>
<p>An OpenAI-compatible API for DuckDuckGo's AI chat functionality. Seamlessly integrate multiple AI models into your applications.</p>
<h2>πŸš€ Available Endpoints</h2>
<div class="endpoint">
<h3>POST /v1/chat/completions</h3>
<p>Generate chat completions using various AI models.</p>
<h4>Request Body Example:</h4>
<pre><code>{
"model": "gpt-4o-mini",
"messages": [
{"role": "user", "content": "Hello, how are you?"}
],
"stream": false
}</code></pre>
<h4>Supported Models:</h4>
<ul>
<li>gpt-4o-mini</li>
<li>claude-3-haiku</li>
<li>llama-3.1-70b</li>
<li>mixtral-8x7b</li>
</ul>
</div>
<div class="endpoint">
<h3>GET /v1/models</h3>
<p>Retrieve a list of available AI models.</p>
</div>
<h2>πŸ› οΈ Features</h2>
<ul>
<li>OpenAI-compatible API</li>
<li>Multiple AI model support</li>
<li>Streaming and non-streaming responses</li>
<li>Easy integration</li>
</ul>
<h2>πŸ“ Usage Example (Python)</h2>
<pre><code>import requests
response = requests.post(
'https://your-api-url.com/v1/chat/completions',
json={
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Tell me a joke"}]
}
)
print(response.json())</code></pre>
<h2>πŸ™Œ Credits</h2>
<p>
Created by: Your Name<br>
Powered by:
<a href="https://duckduckgo.com">DuckDuckGo</a> |
<a href="https://github.com/deedy5/duckduckgo_search">duckduckgo_search</a>
</p>
<footer>
<p><small>Β© 2024 DuckDuckGo Chat API. All rights reserved.</small></p>
</footer>
</body>
</html>