> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Make your first authenticated ChainStream call in under 5 minutes.

By the end of this guide you will have:

* An API key (or OAuth token)
* A working call against the ChainStream REST API
* A working call against the ChainStream SDK, CLI and MCP Server
* A clear pointer to whichever surface — REST, GraphQL, WebSocket, Kafka, SDK, CLI, MCP — best fits your workload

<Note>Estimated time: **5 minutes**.</Note>

## Prerequisites

A ChainStream account. [Sign up here](https://www.chainstream.io/dashboard) if you do not have one yet.

## 1. Get your API key

1. Open the [ChainStream Dashboard](https://www.chainstream.io/dashboard).
2. Go to **Applications**.
3. Click **Create New App**.
4. Copy the generated **API Key** (it starts with `cs_live_…`).

<Tip>
  An API key is the fastest way to authenticate. For machine-to-machine scenarios
  use the OAuth 2.0 client-credentials flow described in
  [API Keys & OAuth](/en/docs/platform/authentication/api-keys-oauth).
</Tip>

## 2. Make your first request

This example fetches metadata for Wrapped SOL on Solana. Pick the interface that matches how you will integrate.

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.chainstream.io/v2/token/solana/So11111111111111111111111111111111111111112/metadata" \
      -H "X-API-KEY: your_api_key"
    ```
  </Tab>

  <Tab title="SDK (TypeScript)">
    ```typescript theme={null}
    import { ChainStreamClient } from "@chainstream-io/sdk";

    const cs = new ChainStreamClient({ apiKey: "your_api_key" });

    const token = await cs.token.getToken(
      "So11111111111111111111111111111111111111112",
      "solana",
    );

    console.log(token.name, token.symbol, token.decimals);
    ```

    See [all SDKs](/en/sdks/overview) for Python, Go and Rust equivalents.
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    # Runs with no install — npx will fetch the latest CLI.
    npx @chainstream-io/cli token info \
      --chain solana \
      --address So11111111111111111111111111111111111111112
    ```

    On first run the CLI prompts for your key. You can also set it explicitly:

    ```bash theme={null}
    npx @chainstream-io/cli config set --key apiKey --value your_api_key
    ```
  </Tab>

  <Tab title="MCP (AI agent)">
    ```bash theme={null}
    CHAINSTREAM_API_KEY=your_api_key npx @chainstream-io/mcp
    ```

    Then ask your agent *"What is the SOL token on Solana?"* — it will call the right tool.

    For Claude, Cursor and ChatGPT configuration see
    [MCP Server Setup](/en/docs/ai-agents/mcp-server/setup).
  </Tab>

  <Tab title="OAuth 2.0 (JWT)">
    For OAuth 2.0 Client Credentials:

    ```bash theme={null}
    curl -X POST "https://dex.asia.auth.chainstream.io/oauth/token" \
      -H "Content-Type: application/json" \
      -d '{
        "client_id": "YOUR_CLIENT_ID",
        "client_secret": "YOUR_CLIENT_SECRET",
        "audience": "https://api.dex.chainstream.io",
        "grant_type": "client_credentials"
      }'

    curl "https://api.chainstream.io/v2/token/solana/So11111111111111111111111111111111111111112/metadata" \
      -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
    ```
  </Tab>
</Tabs>

### Response

```json theme={null}
{
  "chain": "solana",
  "address": "So11111111111111111111111111111111111111112",
  "name": "Wrapped SOL",
  "symbol": "SOL",
  "decimals": 9,
  "imageUrl": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png",
  "tokenCreatedAt": 1710417600000
}
```

| Field            | Type    | Description                       |
| :--------------- | :------ | :-------------------------------- |
| `chain`          | string  | Blockchain identifier, lowercase. |
| `address`        | string  | Token contract address.           |
| `name`           | string  | Human-readable token name.        |
| `symbol`         | string  | Ticker symbol.                    |
| `decimals`       | integer | Token decimals.                   |
| `imageUrl`       | string  | Canonical logo URL (may be null). |
| `tokenCreatedAt` | integer | Creation timestamp (ms).          |

## 3. Pick the right access method

You just made a single request/response call. Real integrations usually need more than that.

<CardGroup cols={2}>
  <Card title="REST API" icon="bolt" href="/en/docs/access-methods/rest-api">
    On-demand lookups — tokens, wallets, pools, trades, compliance.
  </Card>

  <Card title="GraphQL" icon="diagram-project" href="/en/docs/access-methods/graphql">
    Flexible analytical queries over the full chain-data cube.
  </Card>

  <Card title="WebSocket" icon="tower-broadcast" href="/en/docs/access-methods/websocket">
    Sub-second pushes for live UIs and browser apps.
  </Card>

  <Card title="Kafka Streams" icon="bars-staggered" href="/en/docs/access-methods/kafka-streams/overview">
    Exactly-once delivery into backends, indexers and trading engines.
  </Card>

  <Card title="SDKs" icon="box" href="/en/sdks/overview">
    TypeScript, Python, Go, Rust — typed clients with auth built in.
  </Card>

  <Card title="CLI" icon="terminal" href="/en/docs/access-methods/cli">
    Scripting, CI/CD and pay-per-call access for AI agents.
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    * Confirm `X-API-KEY` or `Authorization: Bearer …` header is present and spelt correctly.
    * Regenerate a key if yours was rotated.
    * For OAuth, check the token hasn't expired (default TTL is 1 hour).
  </Accordion>

  <Accordion title="429 Too Many Requests">
    You hit your plan's rate limit. Free plans start at 10 req/s; upgrade or back
    off exponentially. See [Plans & Units](/en/docs/platform/billing-payments/plans-and-units).
  </Accordion>

  <Accordion title="How do I query other chains?">
    Use the chain identifier in the URL: `solana`, `ethereum`, `bsc`, `base`,
    `polygon`, `arbitrum`, `optimism`, `avalanche`, `zksync`, `tron`.
    Full list in [Supported Chains](/en/docs/supported-chains).
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Browse the data catalog" icon="boxes-stacked" href="/en/docs/data-products/overview">
    Every dataset we publish, with coverage and refresh rates.
  </Card>

  <Card title="Start a real-time stream" icon="tower-broadcast" href="/en/docs/access-methods/websocket">
    Subscribe to live trades, prices, transfers and pool events.
  </Card>

  <Card title="Run compliance checks" icon="shield-halved" href="/en/docs/compliance/overview">
    KYT and KYA on transfers, withdrawals and counterparties.
  </Card>

  <Card title="Build an AI agent" icon="robot" href="/en/docs/ai-agents/overview">
    Connect Claude, Cursor or ChatGPT via MCP + Agent Skills.
  </Card>
</CardGroup>
