forked from 0x676e67/ninja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rest.http
181 lines (146 loc) · 4.33 KB
/
rest.http
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
@hostname = 127.0.0.1
@port = 7999
@host = {{hostname}}:{{port}}
@access_token=
@refresh_token=
@email=
@password=
@session_id= #You need to login with your email password to extract sensitive_id
@bearer_token=Bearer {{access_token}}
@bearer_refresh_token=Bearer {{refresh_token}}
@bearer_session_id=Bearer {{session_id}}
/// oauth ///
### you may need the MFA parameter to log in
POST http://{{host}}/auth/token
Content-Type: application/x-www-form-urlencoded
username={{email}}&password={{password}}
###
POST http://{{host}}/auth/refresh_token
Authorization: {{bearer_refresh_token}}
###
POST http://{{host}}/auth/revoke_token
Authorization: {{bearer_refresh_token}}
/// dashboard ///
### this is extract sensitive_id
POST http://{{host}}/dashboard/onboarding/login
Authorization: {{bearer_token}}
###
POST http://{{host}}/dashboard/user/api_keys
Authorization: {{bearer_session_id}}
Content-Type: application/json
{
"action":"create",
"name":"ninja"
}
###
POST http://{{host}}/dashboard/user/api_keys
Authorization: {{bearer_session_id}}
Content-Type: application/json
{
"action":"delete",
"redacted_key":"sk-M4dpz***************************************L1o3",
"created_at":1687341651
}
###
GET http://{{host}}/dashboard/user/api_keys
Authorization: {{bearer_session_id}}
###
GET http://{{host}}/dashboard/billing/usage?end_date=2023-7-1&start_date=2023-5-01
Authorization: {{bearer_session_id}}
###
GET http://{{host}}/dashboard/billing/credit_grants
Authorization: {{bearer_session_id}}
###
GET http://{{host}}/v1/dashboard/billing/subscription
Authorization: {{bearer_session_id}}
/// backend-api ///
### get models
GET http://{{host}}/backend-api/models?history_and_training_disabled=false
Authorization: {{bearer_token}}
### check account status
GET http://{{host}}/backend-api/accounts/check
Authorization: {{bearer_token}}
### check account status
GET http://{{host}}/backend-api/accounts/check/v4-2023-04-27
Authorization: {{bearer_token}}
### maybe need chatgpt plus
GET http://{{host}}/backend-api/settings/beta_features
Authorization: {{bearer_token}}
### get conversation by id
GET http://{{host}}/backend-api/conversation/5ae8355a-82a8-4ded-b0e4-ea5dc11b4a9f
Authorization: {{bearer_token}}
### get conversation limit
GET http://{{host}}/public-api/conversation_limit
### get conversation list
GET http://{{host}}/backend-api/conversations?offset=0&limit=3&order=updated
Authorization: {{bearer_token}}
### get share link
GET http://{{host}}/backend-api/shared_conversations?order=created
Authorization: {{bearer_token}}
### export data send to email
POST http://{{host}}/backend-api/accounts/data_export
Authorization: {{bearer_token}}
### new conversation
POST http://{{host}}/backend-api/conversation
Authorization: {{bearer_token}}
Content-Type: application/json
Accept: text/event-stream
{
"action": "next",
"messages": [
{
"id": "{{$guid}}",
"author": {
"role": "user"
},
"content": {
"content_type": "text",
"parts": [
"new conversation"
]
},
"metadata": {}
}
],
"model": "text-davinci-002-render-sha-mobile",
"parent_message_id": "{{$guid}}",
"timezone_offset_min": -480,
"history_and_training_disabled": false
}
### change conversation title by id
PATCH http://{{host}}/backend-api/conversation/5ae8355a-82a8-4ded-b0e4-ea5dc11b4a9f
Authorization: {{bearer_token}}
Content-Type: application/json
{
"title": "New Test"
}
### generate conversation title
POST http://{{host}}/backend-api/conversation/gen_title/5ae8355a-82a8-4ded-b0e4-ea5dc11b4a9f
Authorization: {{bearer_token}}
Content-Type: application/json
{
"message_id": "1646facc-08a6-465f-ba08-58cec1e31ed6"
}
### clear conversation by id
PATCH http://{{host}}/backend-api/conversation/5ae8355a-82a8-4ded-b0e4-ea5dc11b4a9f
Authorization: {{bearer_token}}
Content-Type: application/json
{
"is_visible": false
}
### clear conversations
PATCH http://{{host}}/backend-api/conversations
Authorization: {{bearer_token}}
Content-Type: application/json
{
"is_visible": false
}
### conversation message feedbak
POST http://{{host}}/backend-api/conversation/message_feedback
Authorization: {{bearer_token}}
Content-Type: application/json
{
"message_id": "1646facc-08a6-465f-ba08-58cec1e31ed6",
"conversation_id": "5ae8355a-82a8-4ded-b0e4-ea5dc11b4a9f",
"rating": "ThumbsUp"
}