go run ./webapi
Then the server will be running at http://localhost:8080.
PORT
: The port to listen on. Default:8080
ALLOWED_ORIGINS
: The allowed origins for CORS. Default:*
NO_LOG
: Whether to disable logging. Default:false
DEFAULT_COOKIES
: Default cookies to use, can be obtained bydocument.cookie
. Default:""
HTTPS_PROXY
orHTTP_PROXY
: The proxy to use for requests to Microsoft. Default:""
AUTH_TOKEN
: The Bearer token to access the API server. Default:""
Check the health of the server.
- Request: None
- Response:
- Content-Type:
text/plain
- Body:
OK
- Content-Type:
Upload an image and return its URL.
-
Request:
- Content-Type:
multipart/form-data
- Body:
file
:File
cookies
:string
(Optional)
- Content-Type:
-
Response:
- Content-Type:
text/plain
- Body:
string
- Content-Type:
Get urls of images created by Sydney.
-
Request:
- Content-Type:
application/json
- Body:
image
:GenerativeImage
cookies
:string
(Optional)
- Content-Type:
-
Response:
- Content-Type:
application/json
- Body:
GenerateImageResult
- Content-Type:
Start a chat stream.
-
Request:
- Content-Type:
application/json
- Body:
prompt
:string
context
:string
cookies
:string
(Optional)imageUrl
:string
(Optional)noSearch
:boolean
(Optional)conversationStyle
:string
(Optional)gpt4turbo
:boolean
(Optional)classic
:boolean
(Optional)plugins
:[]string
(Optional)
- Content-Type:
-
Response:
- Content-Type:
text/event-stream
- Body: Server-sent events
event
:string
data
:string
- Content-Type:
This endpoint is compatible with the OpenAI API. You can check the API reference here.
Due to differences between the OpenAI API and the Sydney API, only the following parameters are supported:
messages
: The same as OpenAI's, and can contain image url (only valid in the last message).model
:GPT-3.5-Turbo
series will be mapped toBalance
, others will be mapped toCreative
. GPT-4-Turbo will always be enabled.stream
: The same as OpenAI's.tool_choice
: Will enablenoSearch
if it isnull
.
There is an extra field for reusing conversation, if your SDK supports such customization:
conversation
:CreateConversationResponse
The Cookie
header is also supported to provide custom cookies.
The response is full of dummy values, and only the choices
field is valid. The stop reason is length
if any error occurs, and stop
otherwise.
This endpoint is compatible with the OpenAI API. You can check the API reference here.
Due to differences between the OpenAI API and the Sydney API, only the following parameters are supported:
prompt
: The same as OpenAI's.
The Cookie
header is also supported to provide custom cookies.