nova-web/templates/panel.html

66 lines
2.1 KiB
HTML
Raw Normal View History

2023-07-23 02:07:22 +02:00
{% include 'parts/begin.html' %}
<link rel="stylesheet" href="/static/css/home.css">
<main>
<h1>API Panel</h1>
2023-07-23 02:07:22 +02:00
<h2>
<mark>Warning</mark>
this is a <u>very early prototype</u> of NovaAI. Do not use it in production.
You have been warned.
</h2>
<h2>Python</h2>
<h3>Endpoint</h3>
<p>
To use <i>NovaAI</i> in your code, simply set the endpoint of <i>NovaAI</i>.
It's compitable with <i><s>Closed</s>AI</i>'s library.
</p>
<pre><code class="language-python">import openai as novaai
novaai.api_base = 'https://api.nova-oss.com/v1'</code></pre>
<blockquote>
<b>Info:</b>
The reason we're using <code class="language-python">as novaai</code> is that we might add our own package soon.
That way, you'll only have to delete two words and install our package to migrate. Stay tuned!
</blockquote>
<h3>API Key</h3>
<p>
The API key is something like a password. So keep it safe. Don't share it with anyone!
</p>
<pre><code class="language-python">novaai.api_key = 'nv-...'</code></pre>
<h2>curl</h2>
<pre><code class="language-bash">curl https://api.nova-oss.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer nv-..." \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Whats a wormhole?"}]
}'</code></pre>
<h2>Unofficial front-ends (Better ChatGPT, ...)</h2>
<p>
Keep in mind not to violate <s>Closed</s>AI's terms of service, or it'll break their hearts :(
(and maybe write you a C&D).
<br><br>
Anyways, set the API endpoint to <code>https://api.nova-oss.com/v1</code> and don't forget to add your NovaAI API key, too.
<blockquote class="warning">
<b>Warning:</b>
Only use front-ends you trust. Malicious websites could steal your API key!
</blockquote>
</p>
<h2>Documentation</h2>
<p><a href="https://platform.openai.com/docs/api-reference" target="_blank">Official <s>Closed</s>AI documentation</a></p>
2023-07-23 02:07:22 +02:00
</main>
2023-07-23 02:07:22 +02:00
{% include 'parts/end.html' %}