Galya Docs
Galya (Beta)

Setup & Authentication

Check it works

A quick unauthenticated liveness ping:

curl -sS "https://api.galya.io/health"
# { "ok": true }

Then a real authenticated call, list clusters (empty array on a fresh workspace is fine):

curl -sS "https://api.galya.io/v1/clusters?limit=1" \
  -H "X-API-Key: $GALYA_API_KEY"

A 401 means the key is missing or wrong type.

Using the TypeScript SDK (optional)

npm install @galya/agents
import { GalyaApiClient } from "@galya/agents";

// Workspace secret key, no workspaceId needed.
const api = new GalyaApiClient({ apiKey: process.env.GALYA_API_KEY! });

// Account secret key, pass the workspace id.
// const api = new GalyaApiClient({ apiKey: process.env.GALYA_API_KEY!, workspaceId: "ws_…" });

The client defaults to https://api.galya.io/v1 and sends X-API-Key for you.

The one setup trap

search, rerank, ask, and explain take relative_to_entity_id and in_terms_of_entity_type as URL query parameters, not JSON body fields. Forget either and the call fails:

{ "error": "relative_to_entity_id and in_terms_of_entity_type are required", "code": "bad_request" }

Correct shape (params in the URL, only query in the body):

curl -sS -X POST "https://api.galya.io/v1/search?relative_to_entity_id=shopper_jordan&in_terms_of_entity_type=content" \
  -H "X-API-Key: $GALYA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "calm coastal furniture" }'

The SDK takes them as the first argument, so you can't miss them:

await api.search(
  { relativeToEntityId: "shopper_jordan", inTermsOfEntityType: "content" },
  { query: "calm coastal furniture" },
);

On this page