{
  "openapi": "3.0.0",
  "info": {
    "description": "OpenAPI specification for the entire Messari API",
    "title": "Messari API - Ai Openai",
    "version": "1.0.0"
  },
  "servers": [
    {
      "description": "Messari API",
      "url": "https://api.messari.io"
    }
  ],
  "security": [],
  "paths": {
    "/ai/openai/chat/completions": {
      "post": {
        "description": "Processes a conversation and returns an AI-generated response in OpenAI-compatible format. Consumes 5 credits per request.",
        "operationId": "postChatCompletionOpenAI",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequestOpenAI"
              },
              "example": {
                "model": "messari",
                "messages": [
                  {
                    "role": "user",
                    "content": "What is Solana?"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "choices": {
                      "description": "Array of completion choices",
                      "items": {
                        "$ref": "#/components/schemas/ChatCompletionResponseChoiceOpenAI"
                      },
                      "type": "array"
                    },
                    "created": {
                      "description": "Unix timestamp when the completion was created",
                      "format": "int64",
                      "type": "integer"
                    },
                    "id": {
                      "description": "Unique identifier for the completion request",
                      "type": "string"
                    },
                    "metadata": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ChatCompletionResponseMetadataOpenAI"
                        },
                        {
                          "description": "Additional metadata about the completion"
                        }
                      ]
                    },
                    "model": {
                      "description": "Model used for the completion",
                      "type": "string"
                    },
                    "object": {
                      "description": "Type of object returned, always 'chat.completion'",
                      "type": "string"
                    }
                  },
                  "required": [
                    "choices",
                    "created",
                    "id",
                    "model",
                    "object"
                  ],
                  "type": "object"
                },
                "example": {
                  "id": "b72679d2-2144-41f1-9a15-252df2f264b3",
                  "object": "chat.completion",
                  "created": 1762276239,
                  "model": "messari-ai",
                  "choices": [
                    {
                      "index": 0,
                      "message": {
                        "role": "assistant",
                        "content": "# Solana Overview\n\nSolana is a Layer-1 blockchain network designed to provide a highly scalable infrastructure for decentralized applications (dapps). Its primary goal is to minimize performance constraints, such as transaction throughput limitations and high costs, typically faced by developers on other networks.\n\n## Core Features and Technology\n\nSolana is optimized for speed and efficiency, aiming to achieve high throughput without relying on second-layer or off-chain technologies.\n\n*   **Scalability and Throughput:** Solana uses a Proof of Stake (PoS) consensus mechanism combined with a unique innovation called Tower Consensus. This design allows the network to handle a high volume of transactions, with the capacity to process up to 710,000 transactions per second (TPS) at peak load.\n*   **Developer Support:** The network supports all LLVM-compatible smart contract languages, offering flexibility for developers.\n*   **Transaction Efficiency:** Solana is designed for sub-second settlement times and low transaction costs.\n*   **Token Extensions:** Developers launching SPL tokens on Solana can utilize various token extensions, such as Confidential Transfers, which hides transaction amounts to protect user balance confidentiality during transfers.\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.\n\n*   **Transaction Fees:** Users pay fees in SOL for sending transactions and executing smart contracts. These fees include a static base fee plus a variable fee based on the computational resources used. Users can also include an optional \"prioritization fee\" to expedite transaction processing.\n*   **Staking and Governance:** SOL is also used for staking to secure the network and for on-chain governance.\n\n## Ecosystem and Use Cases\n\nSolana's infrastructure supports various applications and services, including:\n\n*   **Decentralized Finance (DeFi):** Projects like Ellipsis Labs' Phoenix, a spot limit order book implementation, are built on Solana to create efficient and scalable DeFi liquidity primitives.\n*   **Payments (Solana Pay):** Solana Pay is a protocol for payments that uses the blockchain to create new commerce rails for merchants, enabling secure payments without intermediaries.\n*   **Gaming and Customer Engagement:** Services like GameShift streamline the integration of Web3 features into games, handling interactions with Solana for self-custodied game assets and abstracted transaction fees. Bond is another platform powered by Solana designed to boost customer engagement for brands through digital collectibles, authentication, and loyalty programs.\n\n## Recent Market Sentiment\n\nRecent market activity suggests a strong institutional interest in Solana, contrasting with other major cryptocurrencies:\n\n*   **ETF Inflows:** In early November 2025, Solana ETFs attracted significant investment, totaling **$421 million in inflows** for the week. This was driven by the successful launch of new U.S.-based funds, such as Bitwise's Solana ETF, which reached $105 million in assets under management in its first week.\n*   **Market Divergence:** This surge in Solana investment occurred while Bitcoin and Ethereum products experienced significant outflows, indicating a divergence in institutional capital allocation. Solana's year-to-date inflows reached $3.3 billion.\n\n## Company Background\n\nSolana was founded in **2017** and is headquartered in San Francisco, CA. The company has raised a total of **$335 million** in funding."
                      },
                      "finish_reason": "stop"
                    }
                  ],
                  "metadata": {
                    "status": "Completed",
                    "trace_id": "b72679d2-2144-41f1-9a15-252df2f264b3",
                    "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": "trending_topic",
                        "title": "Warden Protocol's $900K Mindshare Leaderboard Launch",
                        "url": "https://messari.io/topics"
                      },
                      {
                        "domain": "trending_topic",
                        "title": "Wintermute Denies Binance Lawsuit Rumors Amid CZ's ASTER Investment",
                        "url": "https://messari.io/topics"
                      },
                      {
                        "domain": "trending_topic",
                        "title": "Wallchain's Quack Reward System and Project Campaigns",
                        "url": "https://messari.io/topics"
                      },
                      {
                        "domain": "trending_topic",
                        "title": "Billion-Dollar Liquidation Cascade",
                        "url": "https://messari.io/topics"
                      },
                      {
                        "domain": "trending_topic",
                        "title": "ETF Flow Divergence: Bitcoin Outflows vs Solana Surge",
                        "url": "https://messari.io/topics"
                      },
                      {
                        "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"
                      }
                    ]
                  }
                }
              }
            },
            "description": "Default response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Generate chat completions in OpenAI format"
      }
    }
  },
  "components": {
    "schemas": {
      "ChatCompletionRequestOpenAI": {
        "properties": {
          "allow_clarification_query": {
            "description": "Whether the AI can ask for clarification when the query is ambiguous",
            "type": "boolean",
            "default": true
          },
          "generate_related_questions": {
            "description": "Adds AI generated related questions to use as follow up questions",
            "format": "int64",
            "type": "integer",
            "default": 0
          },
          "inline_citations": {
            "description": "Adds inline citation document references in the payload metadata",
            "type": "boolean",
            "default": true
          },
          "messages": {
            "description": "Array of messages in the conversation history",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "default": "user",
                  "description": "The role of the message author"
                },
                "content": {
                  "type": "string",
                  "default": "What is Solana?",
                  "description": "The content of the message"
                }
              },
              "required": [
                "role",
                "content"
              ]
            },
            "type": "array",
            "default": [
              {
                "role": "user",
                "content": "What is Solana?"
              }
            ]
          },
          "response_format": {
            "description": "Text format for the response. Values accepted are 'markdown' and 'plaintext'.",
            "type": "string",
            "default": "markdown"
          },
          "stream": {
            "description": "Stream the response through the API",
            "type": "boolean",
            "default": false
          },
          "verbosity": {
            "description": "Controls the length and detail level of the AI-generated response. Values accepted are 'succinct', 'balanced', and 'verbose'.",
            "type": "string",
            "default": "balanced"
          }
        },
        "required": [
          "messages"
        ],
        "type": "object"
      },
      "ChatCompletionResponseMetadataOpenAI": {
        "properties": {
          "charts": {
            "description": "Chart data referenced in the response",
            "items": {
              "$ref": "#/components/schemas/ChartSource"
            },
            "type": "array"
          },
          "related_questions": {
            "description": "Follow-up questions related to the original query",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "sources": {
            "description": "Sources used to construct the response content. If using inline citations, sources will include citationIds associated with the response citations.",
            "items": {
              "$ref": "#/components/schemas/StandardSource"
            },
            "type": "array"
          },
          "status": {
            "description": "Current status of the completion request",
            "type": "string"
          },
          "trace_id": {
            "description": "Unique identifier for tracing the request",
            "format": "byte",
            "type": "string"
          }
        },
        "required": [
          "status",
          "trace_id"
        ],
        "type": "object"
      },
      "ChatCompletionResponseChoiceOpenAI": {
        "properties": {
          "finish_reason": {
            "description": "Reason the model stopped generating (e.g., 'stop')",
            "type": "string"
          },
          "index": {
            "description": "Index of the choice in the array",
            "format": "int64",
            "type": "integer"
          },
          "message": {
            "type": "object",
            "description": "The message output by the model",
            "properties": {
              "role": {
                "type": "string",
                "description": "The role of the message author",
                "example": "assistant"
              },
              "content": {
                "type": "string",
                "description": "The content of the message"
              }
            },
            "required": [
              "role",
              "content"
            ]
          }
        },
        "required": [
          "finish_reason",
          "index",
          "message"
        ],
        "type": "object"
      },
      "StandardSource": {
        "type": "object",
        "description": "Schema for StandardSource",
        "properties": {},
        "additionalProperties": true
      },
      "ChartSource": {
        "type": "object",
        "description": "Schema for ChartSource",
        "properties": {},
        "additionalProperties": true
      }
    },
    "securitySchemes": {
      "apiKey": {
        "in": "header",
        "name": "X-Messari-API-Key",
        "type": "apiKey"
      }
    }
  }
}