An unofficial API wrapper for duck.ai written in C#
Warning
This API is a proof of concept. I do not suggest you to use it, nor am i responsible for any misuse of it. Using this is strictly against the ToS of DuckDuckGo. See DuckDuckGo Terms of Use
- Chat history
- Markdown renderer
- Default prompt
- Ability to choose model
- Keyword based context (such as time)
The concept is really easy. First a request is sent to the /status
endpoint. This request holds the X-Vqd-Accept: 1
header, which tells DuckDuckGo to give us a token. The token will be returned in the requests response headers. From here on, you can send requests to the /chat
endpoint and get the response as long as you include the token header in each request.
I had an internship for which i had to make some C# applications. This is what i came up with since i use duck.ai relatively frequently. Gave my best to document the code as best as i could.