2023-09-11 13:48:28 +02:00
|
|
|
{% include 'common/begin.html' %}
|
2023-07-23 02:07:22 +02:00
|
|
|
<link rel="stylesheet" href="/static/css/home.css">
|
|
|
|
|
|
|
|
<main>
|
2023-09-14 22:42:12 +02:00
|
|
|
<h1>Get started</h1>
|
2023-07-23 03:48:02 +02:00
|
|
|
|
|
|
|
<h2>Python</h2>
|
|
|
|
<h3>Endpoint</h3>
|
|
|
|
<p>
|
|
|
|
To use <i>NovaAI</i> in your code, simply set the endpoint of <i>NovaAI</i>.
|
2023-08-20 13:41:24 +02:00
|
|
|
It's compitable with the official <i>OpenAI</i> Python library.
|
2023-07-23 03:48:02 +02:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<pre><code class="language-python">import openai as novaai
|
2023-08-20 13:41:24 +02:00
|
|
|
|
2023-10-20 15:30:33 +02:00
|
|
|
novaai.api_base = 'https://api.nova-oss.com/v1'
|
|
|
|
# you're an enterprise-level donator? use:
|
|
|
|
# novaai.api_base = 'https://api.nova-oss.com/enterprise/v1' </code></pre>
|
2023-07-23 03:48:02 +02:00
|
|
|
|
|
|
|
<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>
|
2023-10-20 15:30:33 +02:00
|
|
|
<b>You can currently only obtain your API key using the Discord server.</b>
|
2023-07-23 03:48:02 +02:00
|
|
|
The API key is something like a password. So keep it safe. Don't share it with anyone!
|
|
|
|
</p>
|
|
|
|
|
2023-10-20 15:30:33 +02:00
|
|
|
<pre><code class="language-python">novaai.api_key = 'nv2-...'</code></pre>
|
2023-07-23 03:48:02 +02:00
|
|
|
|
|
|
|
<h2>curl</h2>
|
|
|
|
|
|
|
|
<pre><code class="language-bash">curl https://api.nova-oss.com/v1/chat/completions \
|
|
|
|
-H "Content-Type: application/json" \
|
2023-10-20 15:30:33 +02:00
|
|
|
-H "Authorization: Bearer nv2-..." \
|
2023-07-23 03:48:02 +02:00
|
|
|
-d '{
|
2023-08-11 21:21:50 +02:00
|
|
|
"model": "gpt-3.5-turbo",
|
2023-10-20 15:30:33 +02:00
|
|
|
"messages": [{"role": "user", "content": "1+1="}]
|
2023-07-23 03:48:02 +02:00
|
|
|
}'</code></pre>
|
|
|
|
|
|
|
|
<h2>Unofficial front-ends (Better ChatGPT, ...)</h2>
|
|
|
|
<p>
|
2023-08-20 14:24:06 +02:00
|
|
|
Set the API endpoint to <code>https://api.nova-oss.com/v1</code> and don't forget to add your NovaAI API key, too.
|
2023-07-23 03:48:02 +02:00
|
|
|
|
|
|
|
<blockquote class="warning">
|
|
|
|
<b>Warning:</b>
|
|
|
|
Only use front-ends you trust. Malicious websites could steal your API key!
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<h2>Documentation</h2>
|
2023-08-20 13:41:24 +02:00
|
|
|
<p><a href="https://platform.openai.com/docs/api-reference" target="_blank">Official OpenAI documentation</a></p>
|
2023-07-23 03:48:02 +02:00
|
|
|
|
2023-07-23 02:07:22 +02:00
|
|
|
</main>
|
2023-07-23 03:48:02 +02:00
|
|
|
|
2023-09-11 13:48:28 +02:00
|
|
|
{% include 'common/end.html' %}
|