DeepNews
The DeepNews
endpoint is our state-of-the-art AskNews agent, capable of self-reflection, on-the-fly learning, and deep tangential research into the AskNews archive, Google, and more. This agent is good for tasks that require complex analysis and high-level strategic planning. For example, monitoring geopolitical risk, investigative journalism, making event forecasts for prediction markets, fact-checking, and much more.
claude-3-7-sonnet-latest
The latest Claude deep thinking model (Rich tier).deepseek
The open-source DeepSeek model (hosted locally and verified in our bias benchmark to be unbiased) (Rich tier).o3-mini
The latest o3-mini model (Rich tier) (beware, OpenAI does not yield thinking tokens, so the thinking component of the response will not exist!).
Wanna test it out or request a new model? You can come to our Discord server to talk directly to the bot, or ask us to integrate new models
Detailed and updated response structures are always available in the API reference
Querying the DeepNews endpoint
The DeepNews endpoint can be used with the typical OpenAI SDK. That means, you can change your base_url
to https://api.asknews.app
and follow the instructions here. However, if you want fully structured source objects in addition to your response, you will need to use one of the AskNews SDKs as shown here:
AskNews SDK
Controlling the output
The following parameters allow you to make decisions about how deep the agent is allowed to search, and how the response is returned to you:
search_depth
The number of levels deep you want to force the agent to search. Beyond which, the agent can choose if it wants to continue searching or if it is done (up tomax_depth
)max_depth
The maximum number of levels deep the agent is allowed to search.return_sources
Whether to return structured source objects with the response (forstream=True
, the source objects are returned at the end of the stream one by one).stream
Whether to stream the response or not. Ifstream=True
, the response will be a generator that yields each message as it is received. Ifstream=False
, the response will be a list of all messages.model
The model to use for the response. The default isdeepseek
but you can also useclaude-3-7-sonnet-latest
oro3-mini
. IF you want another model, please reach out with your request at contact@asknews.app.
OpenAI SDK
It is possible to use the OpenAI SDK to query the DeepNews endpoint. The AskNews API uses OAuth 2.0 for authentication instead of API keys. In order to use the OpenAI SDK with the AskNews API you must first obtain an access token, then pass it in the Authorization
header much like you would with an API key. Luckily, there are plenty of libraries that can help handle this for you. The OpenAI SDK uses httpx
underneath the hood, and allows us to pass a custom client when using it. For the OAuth 2.0 handling, there is a great simple little package named httpx_auth
that already implements the OAuth 2.0 handling for us. Below is an example of how to use the OpenAI SDK with these libraries to easily set this up:
You can also include the extra AskNews parameters in your OpenAI client (or langchain client) requests by adding them to the extra_body
parameter.
Detailed and updated response structures are always available in the API reference