nova-web/web/templates/panel.html
2023-08-20 13:41:24 +02:00

61 lines
2 KiB
HTML

{% include 'parts/begin.html' %}
<link rel="stylesheet" href="/static/css/home.css">
<main>
<h1>API Panel</h1>
<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 the official <i>OpenAI</i> Python 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>OpenAI</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 OpenAI documentation</a></p>
</main>
{% include 'parts/end.html' %}