Bearer authentication header of the form Bearer <token>, where <token> is your API key.
A list of messages comprising the conversation so far. Each message must consist of 2 components (see the example on the right side):
Determines whether or not to incrementally stream the response with server-sent events with content-type: text/event-stream. Default to False.
Chat's id
Neyman AI's response to the user query in markdown format
Summary of the user's query
3 related queries
Sources used to answer the user's query
Tickers related to the user's query
Widgets related to the user's query
import requests
url = "https://neyman.ai/api/chat-completion"
payload = {
"messages": [
{
"role": "system",
"content": "Be precise and concise."
},
{
"role": "user",
"content": "What is the current price of AAPL?"
}
],
"stream": False,
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
{
"chatId": "hKCTD489rN",
"content": "The current price of Apple stock is $222.78.",
"querySummary": "Apple Stock Price",
"relatedQueries": [
"What is Apple's stock price today?",
"How has Apple stock performed this year?",
"What are Apple's stock predictions for next quarter?"
],
"sources": [
{
"link": "https://finnhub.io/docs/api",
"shortURL": "finnhub.io",
"snippet": "Comprehensive stock API for realtime market data, global company fundamentals, economic data, and alternative data...",
"title": "Finnhub API Documentation",
"websiteName": "Finnhub"
},
{
"link": "https://investor.apple.com/stock-price/default.aspx",
"shortURL": "apple.com",
"snippet": "Stock Quote: NASDAQ: AAPL · Day's Open224.78 · Closing Price222.78 · Volume54.7M · Intraday High225.63 · Intraday Low221.41.",
"title": "Stock Price - Apple Investor Relations",
"websiteName": "Apple"
}
],
"tickers": [
{
"link": "https://neyman.ai/AAPL/overview",
"priceCurrency": "USD",
"reportingCurrency": "USD",
"ticker": "AAPL"
}
],
"widgets": ["https://neyman.ai/widget?ticker=AAPL&which=historical-price"]
}