Generate chat completions with Messari AI
curl --request POST \
--url https://api.messari.io/ai/v1/chat/completions \
--header 'Content-Type: application/json' \
--header 'X-Messari-API-Key: <api-key>' \
--data '
{
"messages": [
{
"role": "user",
"content": "What is Solana?"
}
]
}
'import requests
url = "https://api.messari.io/ai/v1/chat/completions"
payload = { "messages": [
{
"role": "user",
"content": "What is Solana?"
}
] }
headers = {
"X-Messari-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Messari-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({messages: [{role: 'user', content: 'What is Solana?'}]})
};
fetch('https://api.messari.io/ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.messari.io/ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messages' => [
[
'role' => 'user',
'content' => 'What is Solana?'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Messari-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.messari.io/ai/v1/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Solana?\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Messari-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.messari.io/ai/v1/chat/completions")
.header("X-Messari-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Solana?\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.messari.io/ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Messari-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Solana?\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": null,
"data": {
"messages": [
{
"role": "assistant",
"content": "# Solana Overview\n\nSolana is a Layer-1 blockchain network optimized for **scalability** and designed to provide infrastructure for decentralized applications (dapps). Its primary goal is to offer a platform where developers can build applications without encountering common performance bottlenecks, such as high transaction fees and throughput limitations.\n\n## Key Features and Design Goals\n\nSolana's design emphasizes high performance and efficiency, aiming to minimize constraints typically faced by developers:\n\n* **High Throughput:** The network is designed to handle a high volume of transactions, with the capacity to process up to 710,000 transactions per second (TPS) at peak load.\n* **Low Costs:** It aims for low transaction costs and sub-second settlement times.\n* **Scalability:** Solana achieves scalability without relying on second-layer or off-chain technologies.\n* **Smart Contract Support:** It supports all LLVM-compatible smart contract languages, which is a collection of modular compiler and toolchain technologies.\n\nThe network utilizes a Proof of Stake (PoS) consensus mechanism combined with a unique component called Tower Consensus to achieve its high throughput.\n\n## The SOL Token\n\nThe native token of the Solana network is **SOL**, which was launched alongside the Mainnet Beta in March 2020. SOL serves several essential functions within the ecosystem:\n\n* **Transaction Fees:** Users pay fees in SOL for sending transactions and executing smart contracts. These fees include a static base fee per signature and a variable fee based on the computational resources used. Transactions can also include an optional \"prioritization fee\" for faster processing.\n* **Staking:** SOL is used for staking to secure the network.\n* **Governance:** The token is used for on-chain governance.\n\n## Ecosystem and Applications\n\nSolana provides a robust environment for various decentralized applications and services:\n\n* **Decentralized Finance (DeFi):** Projects like Phoenix, a spot limit order book implementation by Ellipsis Labs, are built on Solana to create efficient and scalable DeFi infrastructure.\n* **Payments:** Solana Pay is a protocol for payments on Solana, designed to build new payment and commerce rails for merchants that utilize the blockchain for secure transactions without intermediaries.\n* **Gaming and NFTs:** Solana offers tools like GameShift, an API that streamlines integration with Web3 features for development studios, handling interactions with Solana for self-custodied game assets and abstracted transaction fees.\n* **Customer Engagement:** Platforms like Bond utilize Solana to drive customer engagement for brands through digital collectibles, luxury-good authentication, verified digital identities, and loyalty programs.\n\n## Company Background\n\nSolana was founded in 2017 and is headquartered in San Francisco, CA. It is a private company that has raised a total of $335 million in funding."
}
]
},
"metadata": {
"status": "Completed",
"trace_id": "63c56f80-4ac7-4e24-8fb7-a896e8bc5100",
"cited_sources": [
{
"domain": "asset_profile",
"url": "https://messari.io/asset/solana"
},
{
"domain": "diligence",
"title": "Diligence Report: General Information",
"url": "https://messari.io/asset/solana/diligence-report#general_information"
},
{
"domain": "diligence",
"title": "Diligence Report: Token Economics",
"url": "https://messari.io/asset/solana/diligence-report#token_usage_and_economics"
},
{
"domain": "research_image",
"title": "Solana Ecosystem Overview",
"url": "https://cdn.sanity.io/images/2bt0j8lu/production/10299763330e60bae0a812764da7cbd1c3e3d153-1940x976.png?w=800"
},
{
"domain": "research_image",
"title": "Solana Deep Dive: Reframing The Narrative",
"url": "https://cdn.sanity.io/images/2bt0j8lu/production/7a725362c19ddb5f7b089a68dcc13d416fa6726d-2782x1508.png?w=800"
},
{
"domain": "news",
"title": "What Is Solana? A Scalable, Decentralized Network for Dapps",
"url": "https://decrypt.co/resources/what-is-solana-a-scalable-decentralized-network-for-dapps"
},
{
"domain": "webcrawl",
"url": "https://www.kraken.com/prices/solana"
},
{
"domain": "webcrawl",
"title": "Solana Company Profile 2025: Valuation, Funding & Investors | PitchBook",
"url": "https://pitchbook.com/profiles/company/227820-52"
},
{
"domain": "webcrawl",
"title": "Solana - Products, Competitors, Financials, Employees, Headquarters Locations",
"url": "https://www.cbinsights.com/company/solana-labs"
},
{
"domain": "webcrawl",
"title": "There are no bad questions about... blockchain payments | Solana",
"url": "https://solana.com/learn/payments"
}
]
}
}{
"data": "<unknown>",
"error": "<string>"
}{
"data": "<unknown>",
"error": "<string>"
}{
"data": "<unknown>",
"error": "<string>"
}Copilot
Chat Completion - Messari Format
The MessariAI API’s Chat Completion endpoint is used for generating contextual crypto responses using Messari’s knowledge graph and specialized tools.
POST
/
ai
/
v1
/
chat
/
completions
Generate chat completions with Messari AI
curl --request POST \
--url https://api.messari.io/ai/v1/chat/completions \
--header 'Content-Type: application/json' \
--header 'X-Messari-API-Key: <api-key>' \
--data '
{
"messages": [
{
"role": "user",
"content": "What is Solana?"
}
]
}
'import requests
url = "https://api.messari.io/ai/v1/chat/completions"
payload = { "messages": [
{
"role": "user",
"content": "What is Solana?"
}
] }
headers = {
"X-Messari-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Messari-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({messages: [{role: 'user', content: 'What is Solana?'}]})
};
fetch('https://api.messari.io/ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.messari.io/ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messages' => [
[
'role' => 'user',
'content' => 'What is Solana?'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Messari-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.messari.io/ai/v1/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Solana?\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Messari-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.messari.io/ai/v1/chat/completions")
.header("X-Messari-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Solana?\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.messari.io/ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Messari-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Solana?\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": null,
"data": {
"messages": [
{
"role": "assistant",
"content": "# Solana Overview\n\nSolana is a Layer-1 blockchain network optimized for **scalability** and designed to provide infrastructure for decentralized applications (dapps). Its primary goal is to offer a platform where developers can build applications without encountering common performance bottlenecks, such as high transaction fees and throughput limitations.\n\n## Key Features and Design Goals\n\nSolana's design emphasizes high performance and efficiency, aiming to minimize constraints typically faced by developers:\n\n* **High Throughput:** The network is designed to handle a high volume of transactions, with the capacity to process up to 710,000 transactions per second (TPS) at peak load.\n* **Low Costs:** It aims for low transaction costs and sub-second settlement times.\n* **Scalability:** Solana achieves scalability without relying on second-layer or off-chain technologies.\n* **Smart Contract Support:** It supports all LLVM-compatible smart contract languages, which is a collection of modular compiler and toolchain technologies.\n\nThe network utilizes a Proof of Stake (PoS) consensus mechanism combined with a unique component called Tower Consensus to achieve its high throughput.\n\n## The SOL Token\n\nThe native token of the Solana network is **SOL**, which was launched alongside the Mainnet Beta in March 2020. SOL serves several essential functions within the ecosystem:\n\n* **Transaction Fees:** Users pay fees in SOL for sending transactions and executing smart contracts. These fees include a static base fee per signature and a variable fee based on the computational resources used. Transactions can also include an optional \"prioritization fee\" for faster processing.\n* **Staking:** SOL is used for staking to secure the network.\n* **Governance:** The token is used for on-chain governance.\n\n## Ecosystem and Applications\n\nSolana provides a robust environment for various decentralized applications and services:\n\n* **Decentralized Finance (DeFi):** Projects like Phoenix, a spot limit order book implementation by Ellipsis Labs, are built on Solana to create efficient and scalable DeFi infrastructure.\n* **Payments:** Solana Pay is a protocol for payments on Solana, designed to build new payment and commerce rails for merchants that utilize the blockchain for secure transactions without intermediaries.\n* **Gaming and NFTs:** Solana offers tools like GameShift, an API that streamlines integration with Web3 features for development studios, handling interactions with Solana for self-custodied game assets and abstracted transaction fees.\n* **Customer Engagement:** Platforms like Bond utilize Solana to drive customer engagement for brands through digital collectibles, luxury-good authentication, verified digital identities, and loyalty programs.\n\n## Company Background\n\nSolana was founded in 2017 and is headquartered in San Francisco, CA. It is a private company that has raised a total of $335 million in funding."
}
]
},
"metadata": {
"status": "Completed",
"trace_id": "63c56f80-4ac7-4e24-8fb7-a896e8bc5100",
"cited_sources": [
{
"domain": "asset_profile",
"url": "https://messari.io/asset/solana"
},
{
"domain": "diligence",
"title": "Diligence Report: General Information",
"url": "https://messari.io/asset/solana/diligence-report#general_information"
},
{
"domain": "diligence",
"title": "Diligence Report: Token Economics",
"url": "https://messari.io/asset/solana/diligence-report#token_usage_and_economics"
},
{
"domain": "research_image",
"title": "Solana Ecosystem Overview",
"url": "https://cdn.sanity.io/images/2bt0j8lu/production/10299763330e60bae0a812764da7cbd1c3e3d153-1940x976.png?w=800"
},
{
"domain": "research_image",
"title": "Solana Deep Dive: Reframing The Narrative",
"url": "https://cdn.sanity.io/images/2bt0j8lu/production/7a725362c19ddb5f7b089a68dcc13d416fa6726d-2782x1508.png?w=800"
},
{
"domain": "news",
"title": "What Is Solana? A Scalable, Decentralized Network for Dapps",
"url": "https://decrypt.co/resources/what-is-solana-a-scalable-decentralized-network-for-dapps"
},
{
"domain": "webcrawl",
"url": "https://www.kraken.com/prices/solana"
},
{
"domain": "webcrawl",
"title": "Solana Company Profile 2025: Valuation, Funding & Investors | PitchBook",
"url": "https://pitchbook.com/profiles/company/227820-52"
},
{
"domain": "webcrawl",
"title": "Solana - Products, Competitors, Financials, Employees, Headquarters Locations",
"url": "https://www.cbinsights.com/company/solana-labs"
},
{
"domain": "webcrawl",
"title": "There are no bad questions about... blockchain payments | Solana",
"url": "https://solana.com/learn/payments"
}
]
}
}{
"data": "<unknown>",
"error": "<string>"
}{
"data": "<unknown>",
"error": "<string>"
}{
"data": "<unknown>",
"error": "<string>"
}If you’d like to play around with the responses feel free to try on the Messari web-app, it uses the same underlying endpoint implementation.
The chat completion endpoint leverages a graph architecture with agents to:
- Access Messari’s real-time quantitative (compute) dataset which includes but is not limited to: Market data, Asset metrics, Fundraising, Token unlocks
- Access Messari’s qualitative (search) dataset which includes but is not limited to: News, Blogs, Youtube transcriptions, RSS-feeds, Twitter, Webcrawl documents, Proprietary datasets of: Research, Quarterlies, Diligence Reports
- Generate market insights and analysis
- Process natural language queries about crypto assets, protocols and projects
API_KEY field with your Enterprise API key generated in the Messari Account > API page of our webapp and you’re off!
Request Params
verbosity
Theverbosity parameter controls the level of detail in the model’s response. When set to "verbose", the model provides more comprehensive and detailed explanations, including additional context, examples, and supporting information. Other possible values might include "balanced" or "succinct" for shorter responses.
Example usage:
{
"verbosity": "verbose"
}
response_format
Theresponse_format parameter specifies the desired formatting style for the model’s response. When set to "markdown", the output will be formatted using Markdown syntax, allowing for structured text with headings, lists, code blocks, and other formatting elements. Other common option might include "text".
Example usage:
{
"response_format": "markdown"
}
inline_citations
Theinline_citations parameter determines whether the response metadata should include citations within its response text. When set to true, the model will reference sources directly in the text where information is being drawn from. This is particularly useful for academic, research, or factual content where attribution is important.
Example usage:
{
"inline_citations": true
}
stream
Thestream parameter controls whether the API response is delivered as a complete response or as a stream of partial responses. When set to false, the API will wait until the entire response is generated and then deliver it in one piece. When set to true, the API would begin sending partial responses as they are generated, useful for implementing real-time typing effects or processing responses incrementally.
Example usage:
{
"stream": false
}
generate_related_questions
Thegenerate_related_questions parameter determines whether the response metadata should include AI-generated related questions to the user query. This feature is useful for receiving follow up questions as part of the API response payload to prompt the user with potential next questions.
Note: A maximum of 5 is allowed.
Example usage:
{
"generate_related_questions": 2
}
Authorizations
Body
application/json
Array of messages in the conversation history
Show child attributes
Show child attributes
Whether the AI can ask for clarification when the query is ambiguous
Adds AI generated related questions to use as follow up questions
Adds inline citation document references in the payload metadata
Text format for the response. Values accepted are 'markdown' and 'plaintext'.
Stream the response through the API
Controls the length and detail level of the AI-generated response. Values accepted are 'succinct', 'balanced', and 'verbose'.

