Skip to content

Commit 2fbf985

Browse files
committed
Remove the extra key requirements for the OAI completions and chat completions examples.
1 parent 2823438 commit 2fbf985

File tree

2 files changed

+16
-52
lines changed

2 files changed

+16
-52
lines changed

docs/http-reference/examples/openai-compliant/chatCompletionsExample.mdx

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ For unlimited rate limits you will need to supply a header `provider-key`.
2828

2929
const client = new OpenAI({
3030
apiKey: "BYTEZ_KEY",
31-
baseURL: "https://api.bytez.com/models/v2/openai/v1",
32-
defaultHeaders: {
33-
Authorization: "BYTEZ_KEY"
34-
}
31+
baseURL: "https://api.bytez.com/models/v2/openai/v1"
3532
});
3633

3734
const messages = [
@@ -54,8 +51,7 @@ For unlimited rate limits you will need to supply a header `provider-key`.
5451

5552
client = OpenAI(
5653
api_key="BYTEZ_KEY",
57-
base_url="https://api.bytez.com/models/v2/openai/v1",
58-
default_headers={"Authorization": "BYTEZ_KEY"},
54+
base_url="https://api.bytez.com/models/v2/openai/v1"
5955
)
6056

6157
messages = [
@@ -97,10 +93,7 @@ For unlimited rate limits you will need to supply a header `provider-key`.
9793

9894
const client = new OpenAI({
9995
apiKey: "BYTEZ_KEY",
100-
baseURL: "https://api.bytez.com/models/v2/openai/v1",
101-
defaultHeaders: {
102-
Authorization: "BYTEZ_KEY"
103-
}
96+
baseURL: "https://api.bytez.com/models/v2/openai/v1"
10497
});
10598

10699
const messages = [
@@ -135,8 +128,7 @@ For unlimited rate limits you will need to supply a header `provider-key`.
135128

136129
client = OpenAI(
137130
api_key="BYTEZ_KEY",
138-
base_url="https://api.bytez.com/models/v2/openai/v1",
139-
default_headers={"Authorization": "BYTEZ_KEY"},
131+
base_url="https://api.bytez.com/models/v2/openai/v1"
140132
)
141133

142134
messages = [
@@ -193,11 +185,7 @@ For unlimited rate limits you will need to supply a header `provider-key`.
193185

194186
const client = new OpenAI({
195187
apiKey: "BYTEZ_KEY",
196-
baseURL: "https://api.bytez.com/models/v2/openai/v1",
197-
defaultHeaders: {
198-
Authorization: "BYTEZ_KEY",
199-
"provider-key": "PROVIDER_KEY"
200-
}
188+
baseURL: "https://api.bytez.com/models/v2/openai/v1"
201189
});
202190

203191
const messages = [
@@ -220,8 +208,7 @@ For unlimited rate limits you will need to supply a header `provider-key`.
220208

221209
client = OpenAI(
222210
api_key="BYTEZ_KEY",
223-
base_url="https://api.bytez.com/models/v2/openai/v1",
224-
default_headers={"Authorization": "BYTEZ_KEY", "provider-key": "PROVIDER_KEY"},
211+
base_url="https://api.bytez.com/models/v2/openai/v1"
225212
)
226213

227214
messages = [
@@ -264,11 +251,7 @@ For unlimited rate limits you will need to supply a header `provider-key`.
264251

265252
const client = new OpenAI({
266253
apiKey: "BYTEZ_KEY",
267-
baseURL: "https://api.bytez.com/models/v2/openai/v1",
268-
defaultHeaders: {
269-
Authorization: "BYTEZ_KEY",
270-
"provider-key": "PROVIDER_KEY"
271-
}
254+
baseURL: "https://api.bytez.com/models/v2/openai/v1"
272255
});
273256

274257
const messages = [
@@ -303,8 +286,7 @@ For unlimited rate limits you will need to supply a header `provider-key`.
303286

304287
client = OpenAI(
305288
api_key="BYTEZ_KEY",
306-
base_url="https://api.bytez.com/models/v2/openai/v1",
307-
default_headers={"Authorization": "BYTEZ_KEY", "provider-key": "PROVIDER_KEY"},
289+
base_url="https://api.bytez.com/models/v2/openai/v1"
308290
)
309291

310292
messages = [

docs/http-reference/examples/openai-compliant/completionsExample.mdx

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ If it were an `anthropic` model it would be an Anthropic key.
3131

3232
const client = new OpenAI({
3333
apiKey: "BYTEZ_KEY",
34-
baseURL: "https://api.bytez.com/models/v2/openai/v1",
35-
defaultHeaders: {
36-
Authorization: "BYTEZ_KEY"
37-
}
34+
baseURL: "https://api.bytez.com/models/v2/openai/v1"
3835
});
3936

4037
const response = await client.completions.create({
@@ -51,8 +48,7 @@ If it were an `anthropic` model it would be an Anthropic key.
5148

5249
client = OpenAI(
5350
api_key="BYTEZ_KEY",
54-
base_url="https://api.bytez.com/models/v2/openai/v1",
55-
default_headers={"Authorization": "BYTEZ_KEY"},
51+
base_url="https://api.bytez.com/models/v2/openai/v1"
5652
)
5753

5854
response = client.completions.create(
@@ -86,10 +82,7 @@ If it were an `anthropic` model it would be an Anthropic key.
8682

8783
const client = new OpenAI({
8884
apiKey: "BYTEZ_KEY",
89-
baseURL: "https://api.bytez.com/models/v2/openai/v1",
90-
defaultHeaders: {
91-
Authorization: "BYTEZ_KEY"
92-
}
85+
baseURL: "https://api.bytez.com/models/v2/openai/v1"
9386
});
9487

9588
const stream = await client.completions.create({
@@ -118,8 +111,7 @@ If it were an `anthropic` model it would be an Anthropic key.
118111

119112
client = OpenAI(
120113
api_key="BYTEZ_KEY",
121-
base_url="https://api.bytez.com/models/v2/openai/v1",
122-
default_headers={"Authorization": "BYTEZ_KEY"},
114+
base_url="https://api.bytez.com/models/v2/openai/v1"
123115
)
124116

125117
stream = client.completions.create(
@@ -166,11 +158,7 @@ If it were an `anthropic` model it would be an Anthropic key.
166158

167159
const client = new OpenAI({
168160
apiKey: "BYTEZ_KEY",
169-
baseURL: "https://api.bytez.com/models/v2/openai/v1",
170-
defaultHeaders: {
171-
Authorization: "BYTEZ_KEY",
172-
"provider-key": "PROVIDER_KEY"
173-
}
161+
baseURL: "https://api.bytez.com/models/v2/openai/v1"
174162
});
175163

176164
const response = await client.completions.create({
@@ -187,8 +175,7 @@ If it were an `anthropic` model it would be an Anthropic key.
187175

188176
client = OpenAI(
189177
api_key="BYTEZ_KEY",
190-
base_url="https://api.bytez.com/models/v2/openai/v1",
191-
default_headers={"Authorization": "BYTEZ_KEY", "provider-key": "PROVIDER_KEY"},
178+
base_url="https://api.bytez.com/models/v2/openai/v1"
192179
)
193180

194181
response = client.completions.create(
@@ -223,11 +210,7 @@ If it were an `anthropic` model it would be an Anthropic key.
223210

224211
const client = new OpenAI({
225212
apiKey: "BYTEZ_KEY",
226-
baseURL: "https://api.bytez.com/models/v2/openai/v1",
227-
defaultHeaders: {
228-
Authorization: "BYTEZ_KEY",
229-
"provider-key": "PROVIDER_KEY"
230-
}
213+
baseURL: "https://api.bytez.com/models/v2/openai/v1"
231214
});
232215

233216
const stream = await client.completions.create({
@@ -256,8 +239,7 @@ If it were an `anthropic` model it would be an Anthropic key.
256239

257240
client = OpenAI(
258241
api_key="BYTEZ_KEY",
259-
base_url="https://api.bytez.com/models/v2/openai/v1",
260-
default_headers={"Authorization": "BYTEZ_KEY", "provider-key": "PROVIDER_KEY"},
242+
base_url="https://api.bytez.com/models/v2/openai/v1"
261243
)
262244

263245
stream = client.completions.create(

0 commit comments

Comments
 (0)