@skylitai/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Skylit, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # @skylitai/sdk
2
+
3
+ A TypeScript client for [Skylit](https://www.skylit.ai) market data. Skylit covers options flow, volatility, dealer positioning (GEX/vanna levels and point-in-time replay) and dark pool, and is built for AI trading agents and the people who build them.
4
+
5
+ It is typed, has no dependencies, and runs on Node 18+, Bun, Deno and edge runtimes. Every call is read-only: it fetches data and never places orders.
6
+
7
+ ```bash
8
+ npm install @skylitai/sdk
9
+ export SKYLIT_API_KEY=... # create one at https://app.skylit.ai/developer
10
+ ```
11
+
12
+ ```ts
13
+ import { Skylit } from "@skylitai/sdk";
14
+
15
+ const skylit = new Skylit();
16
+
17
+ await skylit.account(); // balance, prices, limits (free)
18
+ await skylit.gexLevels("SPY"); // king node, gatekeepers, flip, walls
19
+ await skylit.historical("SPY", "2026-09-29T15:30:00Z"); // the board at a past instant
20
+ await skylit.vol("iv", ["SPY", "QQQ"]); // Tempest implied volatility
21
+ await skylit.flowTone("TSLA"); // bull/bear pressure across the chain
22
+ await skylit.get("/v1/vol/screener", { limit: 20 }); // any documented endpoint
23
+ ```
24
+
25
+ Responses are the API's JSON, `{ data, meta }`. `meta` carries the remaining credits and the rate-limit state. Errors throw `SkylitError` with `status`, `code` and `message`. Failed calls are not charged.
26
+
27
+ ## Agents
28
+
29
+ For Claude, ChatGPT, Cursor, the Vercel AI SDK, the OpenAI Agents SDK and other MCP clients, connect to the hosted MCP server at `MCP_URL` (`https://mcp.skylit.ai/mcp`). Setup guides for each client are at [SkylitAI/skylit-mcp](https://github.com/SkylitAI/skylit-mcp).
30
+
31
+ ## Pricing and terms
32
+
33
+ Calls are billed in credits (1 credit = $0.001; most calls cost 1 to 5). See [the docs](https://www.skylit.ai/docs). Use of Skylit data is governed by the [API Terms](https://www.skylit.ai/api-terms), which cover personal and research use; for commercial use, contact support@skylit.ai. The MIT license covers this client's code, not Skylit data.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Skylit market data for TypeScript and AI agents.
3
+ *
4
+ * import { Skylit } from "@skylitai/sdk";
5
+ * const skylit = new Skylit(); // reads SKYLIT_API_KEY
6
+ * await skylit.gexLevels("SPY");
7
+ *
8
+ * Read-only: the API serves data and never places orders.
9
+ * Agents can also connect to the hosted MCP server at MCP_URL.
10
+ */
11
+ export declare const API_URL = "https://api.skylit.ai";
12
+ export declare const MCP_URL = "https://mcp.skylit.ai/mcp";
13
+ export declare const VERSION = "0.1.0";
14
+ export type Symbols = string | readonly string[];
15
+ export type Params = Record<string, string | number | boolean | readonly string[] | undefined | null>;
16
+ /** Every response is `{ data, meta }`; `meta` carries credits and rate-limit state. */
17
+ export interface SkylitResponse<T = unknown> {
18
+ data: T;
19
+ meta?: Record<string, unknown>;
20
+ [key: string]: unknown;
21
+ }
22
+ export interface SkylitOptions {
23
+ /** Defaults to process.env.SKYLIT_API_KEY. Create one at https://app.skylit.ai/developer. */
24
+ apiKey?: string;
25
+ baseUrl?: string;
26
+ /** Request timeout in milliseconds (default 30000). */
27
+ timeoutMs?: number;
28
+ /** Custom fetch (tests, proxies). Defaults to the global fetch. */
29
+ fetch?: typeof fetch;
30
+ }
31
+ /** An error answer from the API. Failed calls are not charged. */
32
+ export declare class SkylitError extends Error {
33
+ readonly status: number;
34
+ readonly code: string;
35
+ constructor(status: number, code: string, message: string);
36
+ }
37
+ export declare class Skylit {
38
+ #private;
39
+ readonly baseUrl: string;
40
+ readonly timeoutMs: number;
41
+ constructor(options?: SkylitOptions);
42
+ /** GET any documented endpoint, e.g. `get("/v1/gex/levels", { symbols: "SPY" })`. */
43
+ get<T = unknown>(path: string, params?: Params): Promise<SkylitResponse<T>>;
44
+ /** Balance, prices and limits for this key. Free. */
45
+ account(): Promise<SkylitResponse<unknown>>;
46
+ /** Symbols covered by the dealer-positioning endpoints. Free. */
47
+ symbols(): Promise<SkylitResponse<unknown>>;
48
+ /** Key gamma/vanna levels (king node, gatekeepers, flip, walls) with distance from spot. */
49
+ gexLevels(symbols: Symbols, params?: Params): Promise<SkylitResponse<unknown>>;
50
+ /** The live per-strike exposure board. */
51
+ heatmap(symbols: Symbols, params?: Params): Promise<SkylitResponse<unknown>>;
52
+ /** The board as it stood at a past instant (`at` is RFC 3339). */
53
+ historical(symbols: Symbols, at: string, params?: Params): Promise<SkylitResponse<unknown>>;
54
+ /** Daily exposure statistics per symbol. */
55
+ statsDaily(symbols: Symbols, params?: Params): Promise<SkylitResponse<unknown>>;
56
+ /** A Tempest volatility module: iv, term, cones, sigma, tilt, events, surface, derived, snapshot, screener, history or market. */
57
+ vol(module: string, symbols?: Symbols, params?: Params): Promise<SkylitResponse<unknown>>;
58
+ /** Bull/bear pressure across a ticker's option chain. */
59
+ flowTone(ticker: string, timeframe?: string): Promise<SkylitResponse<unknown>>;
60
+ }
package/dist/index.js ADDED
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Skylit market data for TypeScript and AI agents.
3
+ *
4
+ * import { Skylit } from "@skylitai/sdk";
5
+ * const skylit = new Skylit(); // reads SKYLIT_API_KEY
6
+ * await skylit.gexLevels("SPY");
7
+ *
8
+ * Read-only: the API serves data and never places orders.
9
+ * Agents can also connect to the hosted MCP server at MCP_URL.
10
+ */
11
+ export const API_URL = "https://api.skylit.ai";
12
+ export const MCP_URL = "https://mcp.skylit.ai/mcp";
13
+ export const VERSION = "0.1.0";
14
+ /** An error answer from the API. Failed calls are not charged. */
15
+ export class SkylitError extends Error {
16
+ status;
17
+ code;
18
+ constructor(status, code, message) {
19
+ super(`${status} ${code}: ${message}`);
20
+ this.status = status;
21
+ this.code = code;
22
+ this.name = "SkylitError";
23
+ }
24
+ }
25
+ const joinSymbols = (s) => (typeof s === "string" ? s : s.join(","));
26
+ export class Skylit {
27
+ baseUrl;
28
+ timeoutMs;
29
+ #key;
30
+ #fetch;
31
+ constructor(options = {}) {
32
+ const env = globalThis.process?.env;
33
+ const key = options.apiKey ?? env?.SKYLIT_API_KEY;
34
+ if (!key) {
35
+ throw new Error("No API key: pass { apiKey } or set SKYLIT_API_KEY (create one at https://app.skylit.ai/developer).");
36
+ }
37
+ this.#key = key;
38
+ this.baseUrl = (options.baseUrl ?? API_URL).replace(/\/+$/, "");
39
+ this.timeoutMs = options.timeoutMs ?? 30_000;
40
+ this.#fetch = options.fetch ?? globalThis.fetch.bind(globalThis);
41
+ }
42
+ /** GET any documented endpoint, e.g. `get("/v1/gex/levels", { symbols: "SPY" })`. */
43
+ async get(path, params = {}) {
44
+ const url = new URL(this.baseUrl + "/" + path.replace(/^\/+/, ""));
45
+ for (const [k, v] of Object.entries(params)) {
46
+ if (v === undefined || v === null)
47
+ continue;
48
+ url.searchParams.set(k, Array.isArray(v) ? v.join(",") : String(v));
49
+ }
50
+ const res = await this.#fetch(url, {
51
+ headers: { Authorization: `Bearer ${this.#key}`, Accept: "application/json" },
52
+ signal: AbortSignal.timeout(this.timeoutMs),
53
+ });
54
+ const text = await res.text();
55
+ let body;
56
+ try {
57
+ body = text ? JSON.parse(text) : {};
58
+ }
59
+ catch {
60
+ body = { error: { code: "invalid_json", message: text.slice(0, 200) } };
61
+ }
62
+ if (!res.ok)
63
+ throw toError(res.status, res.statusText, body);
64
+ return body;
65
+ }
66
+ /** Balance, prices and limits for this key. Free. */
67
+ account() {
68
+ return this.get("/v1/account");
69
+ }
70
+ /** Symbols covered by the dealer-positioning endpoints. Free. */
71
+ symbols() {
72
+ return this.get("/v1/symbols");
73
+ }
74
+ /** Key gamma/vanna levels (king node, gatekeepers, flip, walls) with distance from spot. */
75
+ gexLevels(symbols, params = {}) {
76
+ return this.get("/v1/gex/levels", { ...params, symbols: joinSymbols(symbols) });
77
+ }
78
+ /** The live per-strike exposure board. */
79
+ heatmap(symbols, params = {}) {
80
+ return this.get("/v1/heatmap", { ...params, symbols: joinSymbols(symbols) });
81
+ }
82
+ /** The board as it stood at a past instant (`at` is RFC 3339). */
83
+ historical(symbols, at, params = {}) {
84
+ return this.get("/v1/historical", { ...params, symbols: joinSymbols(symbols), at });
85
+ }
86
+ /** Daily exposure statistics per symbol. */
87
+ statsDaily(symbols, params = {}) {
88
+ return this.get("/v1/stats/daily", { ...params, symbols: joinSymbols(symbols) });
89
+ }
90
+ /** A Tempest volatility module: iv, term, cones, sigma, tilt, events, surface, derived, snapshot, screener, history or market. */
91
+ vol(module, symbols, params = {}) {
92
+ return this.get(`/v1/vol/${encodeURIComponent(module)}`, {
93
+ ...params,
94
+ symbols: symbols === undefined ? undefined : joinSymbols(symbols),
95
+ });
96
+ }
97
+ /** Bull/bear pressure across a ticker's option chain. */
98
+ flowTone(ticker, timeframe = "1d") {
99
+ return this.get(`/v1/chain-bull-bear/${encodeURIComponent(ticker)}`, { timeframe });
100
+ }
101
+ }
102
+ function toError(status, statusText, body) {
103
+ let code = "http_error";
104
+ let message = statusText || "request failed";
105
+ if (body && typeof body === "object") {
106
+ const b = body;
107
+ const e = b.error;
108
+ if (e && typeof e === "object") {
109
+ const d = e;
110
+ if (d.code)
111
+ code = String(d.code);
112
+ if (d.message)
113
+ message = String(d.message);
114
+ }
115
+ else if (typeof e === "string") {
116
+ code = e;
117
+ if (b.error_description)
118
+ message = String(b.error_description);
119
+ }
120
+ }
121
+ return new SkylitError(status, code, message);
122
+ }
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@skylitai/sdk",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript client for Skylit market data: options flow, volatility, dealer positioning (GEX) and dark pool, for AI trading agents.",
5
+ "license": "MIT",
6
+ "author": "Skylit, Inc. <support@skylit.ai>",
7
+ "homepage": "https://www.skylit.ai/docs",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/SkylitAI/skylit-mcp.git",
11
+ "directory": "packages/typescript"
12
+ },
13
+ "bugs": "https://github.com/SkylitAI/skylit-mcp/issues",
14
+ "keywords": [
15
+ "skylit",
16
+ "options",
17
+ "options-flow",
18
+ "gamma-exposure",
19
+ "gex",
20
+ "volatility",
21
+ "dark-pool",
22
+ "mcp",
23
+ "ai-agents",
24
+ "trading"
25
+ ],
26
+ "type": "module",
27
+ "main": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ }
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "README.md",
38
+ "LICENSE"
39
+ ],
40
+ "engines": {
41
+ "node": ">=18"
42
+ },
43
+ "sideEffects": false,
44
+ "scripts": {
45
+ "build": "tsc -p tsconfig.json",
46
+ "test": "npm run build && node --test test/client.test.js",
47
+ "prepublishOnly": "npm test"
48
+ },
49
+ "devDependencies": {
50
+ "typescript": "^5.6.0",
51
+ "@types/node": "^22.0.0"
52
+ },
53
+ "publishConfig": {
54
+ "access": "public"
55
+ }
56
+ }