> ## 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.

# 빠른 시작

> 5분 안에 인증된 첫 ChainStream 호출을 완료하세요.

이 가이드를 끝내면 다음이 준비되어 있습니다:

* API 키 (또는 OAuth 토큰)
* ChainStream REST API에 대한 동작하는 호출
* ChainStream SDK, CLI, MCP Server에 대한 동작하는 호출
* 다음 단계 — REST / GraphQL / WebSocket / Kafka / SDK / CLI / MCP 중 어떤 것이 당신의 워크로드에 가장 적합한지

<Note>예상 시간: **5분**.</Note>

## 전제 조건

ChainStream 계정. 아직 없다면 [여기](https://www.chainstream.io/dashboard)에서 가입하세요.

## 1. API 키 받기

1. [ChainStream Dashboard](https://www.chainstream.io/dashboard)를 엽니다.
2. **Applications**로 이동합니다.
3. **Create New App**을 클릭합니다.
4. 생성된 **API Key** (`cs_live_…`로 시작)를 복사합니다.

<Tip>
  API 키는 가장 빠른 인증 방법입니다. 머신 간 (M2M) 시나리오에서는
  OAuth 2.0 client-credentials 흐름을 사용하세요 —
  [API 키 & OAuth](/ko/docs/platform/authentication/api-keys-oauth) 참고.
</Tip>

## 2. 첫 요청 보내기

다음 예제는 Solana의 Wrapped SOL 메타데이터를 가져옵니다. 통합 방식에 맞는 인터페이스를 선택하세요:

<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);
    ```

    Python, Go, Rust는 [SDK 개요](/ko/sdks/overview) 참고.
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    # 설치 불필요 — npx가 최신 CLI를 받아옵니다.
    npx @chainstream-io/cli token info \
      --chain solana \
      --address So11111111111111111111111111111111111111112
    ```

    첫 실행 시 키 입력을 요구합니다. 명시적으로 설정할 수도 있습니다:

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

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

    그런 다음 AI 에이전트에게 *"What is the SOL token on Solana?"* 라고 물어보세요 — 올바른 도구를 호출합니다.

    Claude / Cursor / ChatGPT 설정은
    [MCP Server 셋업](/ko/docs/ai-agents/mcp-server/setup) 참고.
  </Tab>

  <Tab title="OAuth 2.0 (JWT)">
    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>

### 응답

```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
}
```

| 필드               | 타입      | 설명                   |
| :--------------- | :------ | :------------------- |
| `chain`          | string  | 블록체인 식별자, 소문자.       |
| `address`        | string  | 토큰 컨트랙트 주소.          |
| `name`           | string  | 사람이 읽을 수 있는 토큰명.     |
| `symbol`         | string  | 티커 심볼.               |
| `decimals`       | integer | 토큰 소수점.              |
| `imageUrl`       | string  | 공식 로고 URL (null 가능). |
| `tokenCreatedAt` | integer | 생성 타임스탬프 (ms).       |

## 3. 적합한 접속 방법 선택

방금 하나의 요청-응답 호출을 했을 뿐입니다. 실제 통합은 보통 더 많은 것을 필요로 합니다:

<CardGroup cols={2}>
  <Card title="REST API" icon="bolt" href="/ko/docs/access-methods/rest-api">
    온디맨드 조회 — 토큰, 지갑, 풀, 거래, 컴플라이언스.
  </Card>

  <Card title="GraphQL" icon="diagram-project" href="/ko/docs/access-methods/graphql">
    전체 체인 데이터 cube에 대한 유연한 분석 쿼리.
  </Card>

  <Card title="WebSocket" icon="tower-broadcast" href="/ko/docs/access-methods/websocket">
    라이브 UI와 브라우저 앱을 위한 서브초 푸시.
  </Card>

  <Card title="Kafka Streams" icon="bars-staggered" href="/ko/docs/access-methods/kafka-streams/overview">
    백엔드, 인덱서, 트레이딩 엔진을 위한 exactly-once 전달.
  </Card>

  <Card title="SDK" icon="box" href="/ko/sdks/overview">
    TypeScript, Python, Go, Rust — 인증이 내장된 타입드 클라이언트.
  </Card>

  <Card title="CLI" icon="terminal" href="/ko/docs/access-methods/cli">
    스크립팅, CI/CD, AI 에이전트를 위한 건별 과금 접근.
  </Card>
</CardGroup>

## 문제 해결

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    * `X-API-KEY` 또는 `Authorization: Bearer …` 헤더가 올바르게 있는지 확인하세요.
    * 키가 로테이션되었다면 재생성하세요.
    * OAuth에서는 토큰이 만료되지 않았는지 확인하세요 (기본 TTL은 1시간).
  </Accordion>

  <Accordion title="429 Too Many Requests">
    플랜의 레이트 제한에 도달했습니다. 무료 플랜은 10 req/s부터입니다. 플랜 업그레이드 또는
    지수 백오프를 사용하세요. 자세한 내용은
    [플랜 & 유닛](/ko/docs/platform/billing-payments/plans-and-units).
  </Accordion>

  <Accordion title="다른 체인의 토큰은 어떻게 쿼리하나요?">
    URL의 체인 식별자를 바꾸세요: `solana`, `ethereum`, `bsc`, `base`, `polygon`,
    `arbitrum`, `optimism`, `avalanche`, `zksync`, `tron`.
    전체 목록은 [지원 체인](/ko/docs/supported-chains).
  </Accordion>
</AccordionGroup>

## 다음 단계

<CardGroup cols={2}>
  <Card title="데이터 카탈로그 살펴보기" icon="boxes-stacked" href="/ko/docs/data-products/overview">
    저희가 게시하는 모든 데이터셋과 커버리지, 갱신 주기.
  </Card>

  <Card title="실시간 스트림 시작" icon="tower-broadcast" href="/ko/docs/access-methods/websocket">
    라이브 거래, 가격, 전송, 풀 이벤트 구독.
  </Card>

  <Card title="컴플라이언스 체크 실행" icon="shield-halved" href="/ko/docs/compliance/overview">
    전송, 출금, 카운터파티에 대한 KYT / KYA.
  </Card>

  <Card title="AI 에이전트 만들기" icon="robot" href="/ko/docs/ai-agents/overview">
    MCP + Agent Skills로 Claude, Cursor, ChatGPT 연결.
  </Card>
</CardGroup>
