Skip to content
Docs

Authentication

Required headers

Send X-Gray-Project-Id and Authorization: Bearer on every /v1 call.

Overview

Authenticated /v1/* routes expect both headers on every request. POST bodies also need JSON content type.

FieldRequiredDescription
X-Gray-Project-IdYesProject ID (proj_…)
AuthorizationYesBearer gray_sk_… (project secret)
Content-TypeNoapplication/json on POST/PATCH bodies (required when sending JSON)

Example

bash
curl -sS "https://blockchain.gray3.io/v1/chains" \
  -H "X-Gray-Project-Id: $GRAY_PROJECT_ID" \
  -H "Authorization: Bearer $GRAY_SECRET_KEY"
javascript
const res = await fetch("https://blockchain.gray3.io/v1/chains", {
  headers: {
    "X-Gray-Project-Id": process.env.GRAY_PROJECT_ID,
    Authorization: `Bearer ${process.env.GRAY_SECRET_KEY}`,
  },
});
const { data, error } = await res.json();

CORS

Allowed browser request headers include authorization, content-type, and x-gray-project-id. Production wallets should still proxy through your backend so the secret never ships to clients. See Where to put secrets.

Request id

Every response includes x-request-id. Log it when opening support tickets or correlating retries.