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

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# Coin OHLC Chart by ID

> 单个币种的 K 线数据行——时间戳、开盘、最高、最低和收盘价，不含字段名。

单个币种的 K 线数据，以裸数组形式返回，每行按位置排列：毫秒时间戳，然后是开盘、最高、最低和收盘价。响应中没有字段名，也不含成交量。K 线周期由必填的 `days` 推导。适合用于 K 线或技术分析。如果需要价格曲线并同时包含市值和成交量，请改用 [`get_coingecko_coins_id_market_chart`](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-id-market-chart)。

> [!NOTE]
>
> **第一次用？** 把任意 MCP 客户端指向 `https://mcp.aisa.one/mcp` —— Claude Code、
> Codex、Cursor、VS Code 都可以。鉴权走 OAuth：客户端打开浏览器，你点一次
> Allow，不需要粘贴任何 key。之后智能体通过几个元工具调用所有端点：
> `search`、`list_categories`、`get_details` 和 `batch_quote` 免费，`batch_use`
> 按次计费。各客户端的接入步骤见[通过 MCP 连接](https://aisa.one/docs/zh/agent-quickstart.md)；实时工具列表和
> 每次调用的价格见 [aisa.one/zh-cn/mcp](https://aisa.one/zh-cn/mcp#connect)。

[在你的 agent 里把这个端点跑起来 →](https://aisa.one/mcp?from=/zh/api-reference/coingecko/get_coingecko-coins-id-ohlc)

## 请求规范

* **方法与路径:** GET /apis/v1/coingecko/coins/\{id}/ohlc
* **可用状态:** enabled
* **请求 URL 模板:** `https://api.aisa.one/apis/v1/coingecko/coins/{id}/ohlc`
* **id:** path; 必填
* **days:** query; 必填
* **interval:** query; 可选
* **precision:** query; 可选
* **vs\_currency:** query; 必填

[完整 OpenAPI 定义](https://aisa.one/docs/openapi/zh/coingecko.json)

有效请求声明（包括认证和引用的 schema）：

```json theme={null}
{
  "operationId": "get_coingecko_coins_id_ohlc",
  "method": "GET",
  "path": "/apis/v1/coingecko/coins/{id}/ohlc",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [
    {
      "description": "Coin ID. \n*refers to [`/coins/list`](/reference/coins-list).",
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "default": "bitcoin",
        "type": "string"
      }
    },
    {
      "description": "Data up to number of days ago.",
      "in": "query",
      "name": "days",
      "required": true,
      "schema": {
        "default": "1",
        "enum": [
          "1",
          "7",
          "14",
          "30",
          "90",
          "180",
          "365",
          "max"
        ],
        "type": "string"
      }
    },
    {
      "description": "Data interval, leave empty for auto granularity.",
      "in": "query",
      "name": "interval",
      "required": false,
      "schema": {
        "enum": [
          "daily",
          "hourly"
        ],
        "type": "string"
      }
    },
    {
      "description": "Decimal place for currency price value.",
      "in": "query",
      "name": "precision",
      "required": false,
      "schema": {
        "enum": [
          "full",
          "0",
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15",
          "16",
          "17",
          "18"
        ],
        "type": "string"
      }
    },
    {
      "description": "Target currency of price data. \n*refers to [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies).",
      "in": "query",
      "name": "vs_currency",
      "required": true,
      "schema": {
        "default": "usd",
        "type": "string"
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## 费用与请求规则

公开参考价格：每次成功请求 \$0.008 USD。 账户适用价格可能不同；支持报价的接口可按实际请求获取报价。


## OpenAPI

````yaml openapi/zh/coingecko.json GET /apis/v1/coingecko/coins/{id}/ohlc
openapi: 3.1.0
info:
  description: ''
  title: CoinGecko
  version: '1'
  x-aisa-capabilities:
    idempotency: Idempotency-Key
    max_price: X-AISA-Max-Price-USD
    quote:
      header: X-AISA-Cost-Mode
      value: quote
  x-aisa-catalogs:
    coingecko:
      description: ''
      title: CoinGecko
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
      x-aisa-document:
        facts_hash: 2cebdc98d47ae0d3c355af637caf87081b8a62f7794a0c3667fcd49e4539823e
        generator_version: '3'
        protocol_version: '1'
        schema_version: '1'
      x-aisa-plans:
        builder: 1
        display_plan: payg
        payg: 1
        similarweb_payg: 1
        team: 1
        version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-configured-paths:
    - /apis/v1/coingecko/api/{id}/volume_chart
    - /apis/v1/coingecko/coins/categories
    - /apis/v1/coingecko/coins/categories/list
    - /apis/v1/coingecko/coins/list
    - /apis/v1/coingecko/coins/markets
    - /apis/v1/coingecko/coins/{id}
    - /apis/v1/coingecko/coins/{id}/contract/{contract_address}
    - /apis/v1/coingecko/coins/{id}/contract/{contract_address}/market_chart
    - >-
      /apis/v1/coingecko/coins/{id}/contract/{contract_address}/market_chart/range
    - /apis/v1/coingecko/coins/{id}/history
    - /apis/v1/coingecko/coins/{id}/market_chart
    - /apis/v1/coingecko/coins/{id}/market_chart/range
    - /apis/v1/coingecko/coins/{id}/ohlc
    - /apis/v1/coingecko/coins/{id}/tickers
    - /apis/v1/coingecko/exchanges
    - /apis/v1/coingecko/exchanges/list
    - /apis/v1/coingecko/exchanges/{id}
    - /apis/v1/coingecko/exchanges/{id}/tickers
    - /apis/v1/coingecko/ping
    - /apis/v1/coingecko/search/trending
    - /apis/v1/coingecko/simple/price
    - /apis/v1/coingecko/simple/supported_vs_currencies
    - /apis/v1/coingecko/simple/token_price/{id}
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:907b027ae7bb3f1cda28caf6099bbb9f000d21ebbbcfc0cbd176a69f84296194
    facts_hash: 2cebdc98d47ae0d3c355af637caf87081b8a62f7794a0c3667fcd49e4539823e
    generator_version: '3'
    protocol_version: '1'
    response_pending: []
    schema_version: '1'
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: coingecko
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/coingecko/coins/{id}/ohlc:
    get:
      tags:
        - default
      summary: Coin OHLC Chart by ID
      description: >-
        To get the OHLC chart (Open, High, Low, Close) of a coin based on
        particular coin ID


        This endpoint allows you to **get the OHLC chart (Open, High, Low,
        Close) of a coin based on particular coin ID**
      operationId: get_coingecko_coins_id_ohlc
      parameters:
        - description: |-
            Coin ID. 
            *refers to [`/coins/list`](/reference/coins-list).
          in: path
          name: id
          required: true
          schema:
            default: bitcoin
            type: string
        - description: Data up to number of days ago.
          in: query
          name: days
          required: true
          schema:
            default: '1'
            enum:
              - '1'
              - '7'
              - '14'
              - '30'
              - '90'
              - '180'
              - '365'
              - max
            type: string
        - description: Data interval, leave empty for auto granularity.
          in: query
          name: interval
          required: false
          schema:
            enum:
              - daily
              - hourly
            type: string
        - description: Decimal place for currency price value.
          in: query
          name: precision
          required: false
          schema:
            enum:
              - full
              - '0'
              - '1'
              - '2'
              - '3'
              - '4'
              - '5'
              - '6'
              - '7'
              - '8'
              - '9'
              - '10'
              - '11'
              - '12'
              - '13'
              - '14'
              - '15'
              - '16'
              - '17'
              - '18'
            type: string
        - description: >-
            Target currency of price data. 

            *refers to
            [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies).
          in: query
          name: vs_currency
          required: true
          schema:
            default: usd
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                - - 1779199200000
                  - 76769
                  - 76889
                  - 76744
                  - 76818
                - - 1779201000000
                  - 76712
                  - 76712
                  - 76321
                  - 76422
              schema:
                $ref: '#/components/schemas/Response39E58Aba19F7_CoinsOHLC'
          description: Coin OHLC chart data
        default:
          content:
            application/json:
              schema: {}
          description: >-
            Error response; upstream passthrough responses may use provider
            formats
components:
  schemas:
    Response39E58Aba19F7_CoinsOHLC:
      description: OHLC data points as [timestamp, open, high, low, close] arrays
      items:
        items:
          type: number
        type: array
      type: array
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.