The Messari Typescript SDK provides a type-safe interface for accessing Messari’s crypto data and AI services.

Key Features

Type-safe

Full TypeScript support with auto-generated types from OpenAPI specs

Modern

Built with modern TypeScript features and best practices

Well-documented

Comprehensive documentation and examples

Developer-friendly

Intuitive API design with built-in error handling

Installation

# Using npm
npm install @messari/sdk-ts

# Using pnpm
pnpm add @messari/sdk-ts

# Using yarn
yarn add @messari/sdk-ts

Authorization

You’ll need a Messari API key to use the SDK. See our docs for more information.

API Services

Each endpoint in the API has a corresponding method in the SDK. Here are some examples:
API RouteSDK MethodDescription
/ai/v1/chat/completionsclient.ai.v1.chat.generateCompletion()AI chat completion using Messari’s standard format
/ai/openai/chat/completionsclient.ai.openai.chat.generateCompletion()AI chat completion in OpenAI-compatible format
/api/v1/assetsclient.signal.v0.assets.list()List all tracked assets
/api/v1/assets/{assetId}client.signal.v0.assets.retrieve()Get details for a specific asset
For the complete list of available endpoints and methods, please refer to the API documentation.

Example Usage

AI Chat Completion

import MessariSDK from "@messari/sdk-ts";

// Initialize the client
const client = new MessariSDK({
  apiKey: process.env["MESSARI_SDK_API_KEY"],
});

// Use the AI service
const response = await client.ai.openai.chat.generateCompletion({
  messages: [
    {
      role: "user",
      content: "What companies have both paradigm and a16z on their cap table?",
      MultiContent: [{}],
    },
  ],
  inlineCitations: true,
});
console.log(response.choices[0].message.content);
For full examples, see the Examples section.