You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const { data } =awaitroxy.crystals.searchCrystals({
95
-
query: { q: 'amethyst' },
96
-
});
97
-
98
-
const { data } =awaitroxy.dreams.searchDreamSymbols({
99
-
query: { q: 'flying' },
100
-
});
101
-
```
102
+
Common error codes: `401` invalid/missing API key, `403` subscription expired or limit reached, `429` rate limited, `404` resource not found.
102
103
103
104
## Common tasks
104
105
@@ -131,17 +132,20 @@ const city = cities[0];
131
132
// Use city.latitude and city.longitude in chart requests
132
133
```
133
134
134
-
## What NOT to do
135
+
## Gotchas
135
136
136
-
- Do not call endpoints with raw `fetch` — use the typed SDK methods
137
-
- Do not hardcode the base URL — `createRoxy` sets it
138
-
- Do not expose the API key client-side — call from server/API routes only
139
-
- Do not guess method names — type `roxy.domain.` and use autocomplete
140
-
- Parameters are `{ path }`, `{ body }`, or `{ query }` — not positional arguments
137
+
-**Parameters are objects, not positional.** Always `{ path: {...} }`, `{ body: {...} }`, or `{ query: {...} }` — never positional arguments.
138
+
-**Do not guess method names.** Type `roxy.domain.` and let autocomplete show available methods. Method names come from `operationId` in the OpenAPI spec, not URL paths.
139
+
-**Do not use raw `fetch`.** The SDK handles auth headers, base URL, and typed responses.
140
+
-**Do not expose API keys client-side.** Call Roxy from server code, API routes, or server components only.
141
+
-**Chart endpoints need coordinates.** Use `roxy.location.searchCities()` to get latitude/longitude before calling any birth chart or panchang method.
142
+
-**Date format is `YYYY-MM-DD`, time is `HH:MM:SS`.** Both are strings. Timezone is optional (IANA format like `America/New_York`).
143
+
-**All list endpoints may return paginated objects** (e.g. `{ items: [...], total: N }`) rather than raw arrays. Check the type.
144
+
-**`data` and `error` are mutually exclusive.** If `error` is set, `data` is `undefined` and vice versa.
141
145
142
146
## Links
143
147
144
148
- Full method reference: `docs/llms-full.txt` (bundled in this package)
145
149
- Interactive API docs: https://roxyapi.com/api-reference
146
150
- Pricing and API keys: https://roxyapi.com/pricing
147
-
- MCP setup for AI agents: https://roxyapi.com/docs/mcp
TypeScript SDK for [RoxyAPI](https://roxyapi.com). 8 domains, 120+ endpoints, one API key.
8
+
TypeScript SDK for [RoxyAPI](https://roxyapi.com). Multiple domains, fully typed endpoints, one API key.
9
9
10
10
Build astrology apps, tarot platforms, birth chart generators, and compatibility tools without writing a single calculation.
11
11
@@ -107,7 +107,18 @@ if (error) {
107
107
108
108
## TypeScript
109
109
110
-
Every request and response is fully typed. IDE autocomplete shows available methods per domain and exact parameter shapes:no docs tab needed.
110
+
Every request and response is fully typed. IDE autocomplete shows available methods per domain and exact parameter shapes — no docs tab needed.
111
+
112
+
## AI agents (Cursor, Claude Code, Copilot, Codex)
113
+
114
+
This package ships with bundled documentation that AI coding agents can read directly from `node_modules/`:
115
+
116
+
-**`AGENTS.md`** — Quick start, patterns, gotchas, and a common tasks reference table
117
+
-**`docs/llms-full.txt`** — Complete method reference with code examples for every domain
118
+
119
+
AI agents that support `AGENTS.md` (Claude Code, Cursor, GitHub Copilot, OpenAI Codex, Gemini CLI) will read it automatically. For other tools, point your agent to `node_modules/@roxyapi/sdk/AGENTS.md`.
120
+
121
+
Also available: [MCP server](https://roxyapi.com/docs/mcp) for AI agents that support the Model Context Protocol.
0 commit comments