gpt-4o-mini / index.html
Quardo's picture
Updated Space.
e3738fa
raw
history blame
No virus
9.64 kB
<!DOCTYPE html>
<html lang="en">
<head>
<title>Quardo's OpenAI proxy</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Quardo's OpenAI proxy documentation">
<meta name="keywords" content="OpenAI, proxy, API, documentation, GPT-4O-mini">
<meta name="author" content="Quardo">
<meta property="og:title" content="Quardo's OpenAI proxy">
<meta property="og:description" content="Documentation for Quardo's OpenAI proxy">
<meta property="og:type" content="website">
<meta property="og:url" content="https://chat.cow.rip/api/v1/docs">
<meta property="og:image" content="https://tenor.com/view/cat-cat-e-cat-meme-cat-face-gif-23642589">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Quardo's OpenAI proxy">
<meta name="twitter:description" content="Documentation for Quardo's OpenAI proxy">
<meta name="twitter:image" content="https://tenor.com/view/cat-cat-e-cat-meme-cat-face-gif-23642589">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/theme/monokai.min.css">
<style>
body {font-family: Arial, sans-serif; background-color: #f4f4f9; color: #333; margin: 0; padding: 0;}
h1, h2 {color: #444; text-align: center;}
.main {max-width: 800px; margin: 20px auto; padding: 20px; background-color: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); border-radius: 8px;}
.CodeMirror {border: 1px solid #ddd; border-radius: 8px; margin: 20px 0;}
hr {border: 0; height: 1px; background: #ddd; margin: 40px 0;}
p {line-height: 1.6;}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/python/python.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/javascript/javascript.min.js"></script>
</head>
<body>
<div class="main">
<hr/>
<h1>Documentation of the API/updates</h1>
<hr/>
<h2>Updates</h2>
<button onclick="if (updates.style.display === 'none') { updates.style.display = 'block'; } else { updates.style.display = 'none'; }">Show/Hide updates</button>
<div style="display: none;" id="updates">
<div>
<strong> - 13. Update.</strong>
<p> * New API endpoint.</p>
<p> - To get an API key you can login at <a href="https://api.cow.rip/api/v1/oauth/hf">Here!</a></p>
<p> - Note: any key found on anywhere on the internet will get force-reset</p>
</div><hr/>
<div>
<strong> - 12. Update.</strong>
<p> * Updated faketool [search].</p>
<p> - on performance (30s => 22~s) by switching search API.</p>
<p> - on knowledge (better scraping).</p>
</div><hr/>
<div>
<strong> - 11. Update.</strong>
<p> * Finally found out a better way for TOS acception.</p>
</div><hr/>
<div>
<strong> - 10. Update.</strong>
<p> * Added OpenAI's new response param "refusal".</p>
</div><hr/>
<div>
<strong> - 9. Update.</strong>
<p> * Added a third faketool: search. Now the model can search, via search engine.</p>
</div><hr/>
<div>
<div>
<strong> - 8. Update.</strong>
<p> * Got new hosting for this space; <a href="https://chat.cow.rip/">chat.cow.rip</a></p>
<label>- The new hosting is provided by: repl.it.</label><br/>
<label>- The updates to the space will first be released there,</label><br/>
<label>- then later, they will come to the Hugging Face space, mostly due to the fact that repl.it is capable of faster build speeds.</label><br/>
<label>- So in simple terms, <a href="https://chat.cow.rip/">chat.cow.rip</a> will be like a beta release for this space, and that's it.</label>
</div><hr/>
<strong> - 7. Update.</strong>
<p> * Added a second faketool: math. Now the model can perform calculations.</p>
</div><hr/>
<div>
<strong> - 6. Update.</strong>
<p> * Added image generation via DALL-E-3.</p>
</div><hr/>
<div>
<strong> - 5. Update Rollback (part 2).</strong>
<p> * Switched back to old model, as it at least did some enough check</p>
</div><hr/>
<div>
<strong> - 5. Update Rollback.</strong>
<p> * After just a day, the new moderation turns out to be <strong>*extreamly*</strong> strict, so moderation has been paused until i found a better way.</p>
<label>- By to *strict* i meant as blocking pretty much everything, unless it is something like 'Hello.'</label>
</div><hr/>
<div>
<strong> - 5. Update.</strong>
<p> * Added extreamly strict moderation.</p>
</div><hr/>
<div>
<strong> - 4. Update.</strong>
<p> * Added a user consent feature for the application's terms of use.</p>
</div><hr/>
<div>
<strong> - 3. Update.</strong>
<p> * Managed to fix the file being non-visible to the AI model after one round.</p>
<p> * And fix the div error on this page.</p>
</div><hr/>
<div>
<strong> - 2. Update.</strong>
<p> * Added light moderation. [Might add more strict detection later]</p>
</div><hr/>
<div>
<strong> - 1. Update.</strong>
<p> * Fixed a bug where file encoding could trash the entire chat.</p>
<p> * Made models allowed set by the maintainer. [OPENAI_API_MODELS variable]</p>
</div><hr/>
<div>
<p><strong id="w" alt="yes i love fear"> * </strong>yippeeee</p>
<script>let q=25;setInterval(_=>{q+=.001;w.style.fontSize=`${q}px`},100);</script>
<label style="font-size: 2px;">The message above is edited by a script every 100ms. you can check it via view-source.</label>
</div>
</div>
<hr/>
<h2>API Endpoints</h2>
<p>Here are some example codes to interact with the API:</p>
<p><strong>Note:</strong> By using our API, you acknowledge and agree to the following terms regarding the data you provide:</p>
<ul>
<li>Data Collection: This application may log the following data through the Gradio endpoint or the API endpoint: message requests (including messages, responses, model settings, and images sent along with the messages), images that were generated (including only the prompt and the image), search tool calls (including query, search results, summaries, and output responses), and moderation checks (including input and output).</li>
<li>Data Retention and Removal: Data is retained until further notice or until a specific request for removal is made.</li>
<li>Data Usage: The collected data may be used for various purposes, including but not limited to, administrative review of logs, AI training, and publication as a dataset.</li>
<li>Privacy: Please avoid sharing any personal information.</li>
</ul>
<p>By continuing to use our API, you explicitly consent to the collection, use, and potential sharing of your data as described above. If you disagree with our data collection, usage, and sharing practices, we advise you not to use our API.</p>
<textarea id="example1" name="example1"># Example 1: Using OpenAI Python client
from openai import OpenAI
client = OpenAI(
# Or use the `OPENAI_BASE_URL` env var
base_url="https://api.cow.rip/api/v1",
# You can get a key by logging in at https://api.cow.rip/api/v1/oauth/hf
api_key="..."
)
completion = client.ChatCompletion.acreate(
model="gpt-4o-mini",
messages=[
{
"role": "user",
"content": "Say this is a test",
}
],
)
print(completion.choices[0].message.content)</textarea>
<hr/>
<textarea id="example2" name="example2"># Example 2: Using OpenAI Python client with different syntax
import openai
openai.api_key = '...' # You can get a key by logging in at https://api.cow.rip/api/v1/oauth/hf
openai.base_url = "https://chat.cow.rip/api/v1" # Or use the `OPENAI_BASE_URL` env var
completion = openai.ChatCompletion.acreate(
model="gpt-4o-mini",
messages=[
{
"role": "user",
"content": "Say this is a test",
},
],
)
print(completion.choices[0].message.content)</textarea>
<hr/>
<textarea id="example3" name="example3">// For Node.js:
const openai = new (require('openai')).OpenAI({
baseURL: "https://api.cow.rip/api/v1", // Or use the `OPENAI_BASE_URL` env var
apiKey: "..." // You can get a key by logging in at https://api.cow.rip/api/v1/oauth/hf
});
(async()=>{
var completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages=[
{
"role": "user",
"content": "Say this is a test",
}
]
});
console.log(completion.choices[0].message.content)
})()
</textarea>
<hr/>
<div>
<h3>Actual endpoints:</h3>
<p><strong>1. [GET]</strong> <a href="https://api.cow.rip/api/v1/models">/api/v1/models</a></p>
<label>Simply shows you the available models</label>
<p><strong>3. [POST]</strong> <a href="https://api.cow.rip/api/v1/chat/completions">/api/v1/chat/completions</a></p>
<label>Generates a chat completion based on the provided messages and model</label>
</div>
</div>
<script>
CodeMirror.fromTextArea(document.getElementById("example1"), { lineNumbers: true, mode: "python", theme: "monokai", readOnly: true });
CodeMirror.fromTextArea(document.getElementById("example2"), { lineNumbers: true, mode: "python", theme: "monokai", readOnly: true });
CodeMirror.fromTextArea(document.getElementById("example3"), { lineNumbers: true, mode: "javascript", theme: "monokai", readOnly: true });
</script>
</body>
</html>