Quardo commited on
Commit
24c061e
1 Parent(s): bbb69f6

Updated space.

Browse files
Files changed (1) hide show
  1. index.html +9 -9
index.html CHANGED
@@ -41,7 +41,7 @@
41
  <div>
42
  <strong> - 13. Update.</strong>
43
  <p> * New API endpoint.</p>
44
- <p> - To get an API key you can login at <a href="https://api.cow.rip/api/v1/oauth/hf">Here!</a></p>
45
  <p> - Note: any key found on anywhere on the internet will get force-reset</p>
46
  </div><hr/>
47
  <div>
@@ -131,9 +131,9 @@ from openai import OpenAI
131
 
132
  client = OpenAI(
133
  # Or use the `OPENAI_BASE_URL` env var
134
- base_url="https://api.cow.rip/api/v1",
135
 
136
- # You can get a key by logging in at https://api.cow.rip/api/v1/oauth/hf
137
  api_key="..."
138
  )
139
 
@@ -152,8 +152,8 @@ print(completion.choices[0].message.content)</textarea>
152
  <textarea id="example2" name="example2"># Example 2: Using OpenAI Python client with different syntax
153
  import openai
154
 
155
- openai.api_key = '...' # You can get a key by logging in at https://api.cow.rip/api/v1/oauth/hf
156
- openai.base_url = "https://api.cow.rip/api/v1" # Or use the `OPENAI_BASE_URL` env var
157
 
158
  completion = openai.ChatCompletion.acreate(
159
  model="gpt-4o-mini",
@@ -169,8 +169,8 @@ print(completion.choices[0].message.content)</textarea>
169
  <hr/>
170
  <textarea id="example3" name="example3">// For Node.js:
171
  const openai = new (require('openai')).OpenAI({
172
- baseURL: "https://api.cow.rip/api/v1", // Or use the `OPENAI_BASE_URL` env var
173
- apiKey: "..." // You can get a key by logging in at https://api.cow.rip/api/v1/oauth/hf
174
  });
175
  (async()=>{
176
  var completion = await openai.chat.completions.create({
@@ -189,9 +189,9 @@ const openai = new (require('openai')).OpenAI({
189
  <hr/>
190
  <div>
191
  <h3>Actual endpoints:</h3>
192
- <p><strong>1. [GET]</strong> <a href="https://api.cow.rip/api/v1/models">/api/v1/models</a></p>
193
  <label>Simply shows you the available models</label>
194
- <p><strong>3. [POST]</strong> <a href="https://api.cow.rip/api/v1/chat/completions">/api/v1/chat/completions</a></p>
195
  <label>Generates a chat completion based on the provided messages and model</label>
196
  </div>
197
  </div>
 
41
  <div>
42
  <strong> - 13. Update.</strong>
43
  <p> * New API endpoint.</p>
44
+ <p> - To get an API key you can login at <a href="https://cow.rip/api/v1/oauth/hf">Here!</a></p>
45
  <p> - Note: any key found on anywhere on the internet will get force-reset</p>
46
  </div><hr/>
47
  <div>
 
131
 
132
  client = OpenAI(
133
  # Or use the `OPENAI_BASE_URL` env var
134
+ base_url="https://cow.rip/api/v1",
135
 
136
+ # You can get a key by logging in at https://cow.rip/api/v1/oauth/hf
137
  api_key="..."
138
  )
139
 
 
152
  <textarea id="example2" name="example2"># Example 2: Using OpenAI Python client with different syntax
153
  import openai
154
 
155
+ openai.api_key = '...' # You can get a key by logging in at https://cow.rip/api/v1/oauth/hf
156
+ openai.base_url = "https://cow.rip/api/v1" # Or use the `OPENAI_BASE_URL` env var
157
 
158
  completion = openai.ChatCompletion.acreate(
159
  model="gpt-4o-mini",
 
169
  <hr/>
170
  <textarea id="example3" name="example3">// For Node.js:
171
  const openai = new (require('openai')).OpenAI({
172
+ baseURL: "https://cow.rip/api/v1", // Or use the `OPENAI_BASE_URL` env var
173
+ apiKey: "..." // You can get a key by logging in at https://cow.rip/api/v1/oauth/hf
174
  });
175
  (async()=>{
176
  var completion = await openai.chat.completions.create({
 
189
  <hr/>
190
  <div>
191
  <h3>Actual endpoints:</h3>
192
+ <p><strong>1. [GET]</strong> <a href="https://cow.rip/api/v1/models">/api/v1/models</a></p>
193
  <label>Simply shows you the available models</label>
194
+ <p><strong>3. [POST]</strong> <a href="https://cow.rip/api/v1/chat/completions">/api/v1/chat/completions</a></p>
195
  <label>Generates a chat completion based on the provided messages and model</label>
196
  </div>
197
  </div>