-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.http
More file actions
68 lines (56 loc) · 1.42 KB
/
test.http
File metadata and controls
68 lines (56 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#https://platform.openai.com/docs/api-reference
@apikey={{$dotenv OPENAI_API_KEY}}
@org={{$dotenv OPENAI_ORG}}
@base_url=https://api.openai.com/v1
### test
get {{base_url}}/models
Authorization: Bearer {{apikey}}
OpenAI-Organization: {{org}}
### test chat
post {{base_url}}/chat/completions
Authorization: Bearer {{apikey}}
Content-Type: application/json
{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}
### test chat with system role
post {{base_url}}/chat/completions
Authorization: Bearer {{apikey}}
Content-Type: application/json
{
"model": "gpt-3.5-turbo",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}
### test completion
post {{base_url}}/completions
Authorization: Bearer {{apikey}}
Content-Type: application/json
{
"model": "text-davinci-003",
"prompt": "Say this is a test",
"max_tokens": 7,
"temperature": 0
}
### test edits
post {{base_url}}/edits
Authorization: Bearer {{apikey}}
Content-Type: application/json
{
"model": "text-davinci-edit-001",
"input": "What day of the wek is it?",
"instruction": "Fix the spelling mistakes"
}
### images
post {{base_url}}/images/generations
Authorization: Bearer {{apikey}}
Content-Type: application/json
{
"prompt": "A cute baby sea otter",
"n": 2,
"size": "1024x1024"
}