mirror of
https://github.com/NovaOSS/nova-web.git
synced 2024-11-25 22:53:57 +01:00
58 lines
1.8 KiB
HTML
58 lines
1.8 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>
|
|
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' %}
|