Skip to content
Docs

Quickstart

Your first API call

List the chains available to your project with one authenticated GET request.

Endpoint

GET/v1/chains

GET /v1/chains lists every chain your project can call. It is a good first request because it needs no parameters and confirms that your credentials work.

Request

Run it from your terminal or your backend. Replace the placeholders with your values.

Request
curl -sS "https://blockchain.gray3.io/v1/chains" \
  -H "X-Gray-Project-Id: proj_your_project_id" \
  -H "Authorization: Bearer gray_sk_your_secret"

Read the response envelope

Successful responses return HTTP 200 and wrap the result in a data object:

json
{
  "data": {
    "items": [
      {
        "id": "ethereum",
        "name": "Ethereum",
        "family": "evm",
        "native": { "symbol": "ETH", "name": "Ether", "decimals": 18 },
        "explorer": { "url": "https://etherscan.io" }
      }
    ]
  }
}

Failed requests return a 4xx or 5xx status and an error object with a stable code, a readable message, and a retryable flag:

json
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid project ID or secret key",
    "retryable": false
  }
}

Every response also carries an x-request-id header. Include it when you contact support about a specific request. The @gray3/cloud SDK unwraps data for you and throws a GrayError on failure.

Next steps