Built for Claude Code, Codex, Copilot, Cursor & friends
EasyDB for AI Coding Agents
Give your agent one file and it knows every endpoint, auth mode, quota and pitfall, so it can start using EasyDB correctly on the first try.
Use it with your agent
Any agent: paste this prompt
Read https://easy-db.cloud/SKILL.md and use it to build against the EasyDB API. Ask me for my API key (or use the demo_store sandbox) before writing data.
Claude Code: install as a skill
mkdir -p .claude/skills/easydb curl -o .claude/skills/easydb/SKILL.md https://easy-db.cloud/SKILL.md
Use ~/.claude/skills/easydb/ instead to make it available in every project.
Codex, Copilot, Cursor and others: add to your project instructions
mkdir -p docs curl -o docs/easydb.md https://easy-db.cloud/SKILL.md echo "For EasyDB (easy-db.cloud) API usage, read docs/easydb.md" >> AGENTS.md
Keep your API key out of the file and the chat: set it as EASYDB_API_KEY in your environment. Get a key by signing in with GitHub, or try the shared demo_store sandbox with no key.
Preview: SKILL.md
---
name: easydb
description: Use when the user wants to store, query, update or delete JSON documents, work with relational SQL tables, or upload/download files with EasyDB (easy-db.cloud), a serverless edge REST API with NoSQL documents, SQL tables and object storage. Covers auth, every endpoint, quotas and common mistakes.
---
# EasyDB
EasyDB is a REST API at `https://easy-db.cloud` for NoSQL (schemaless JSON documents grouped in collections), SQL (relational tables) and object storage (files and media). No SDK or driver is needed: use plain HTTPS with `curl` or `fetch`.
## Setup: pick an auth mode
| Mode | Header | Use for |
| --- | --- | --- |
| Sandbox | `x-tenant-id: demo_store` | Trying the API with no signup. Shared and public: never store private data. |
| Registered | `Authorization: Bearer edb_live_...` | Real projects. Private tenant, plan quotas. |
- Any `x-tenant-id` other than `demo_store` returns 403. Do not invent tenant IDs.
- If an `Authorization: Bearer` header is sent it is used instead of `x-tenant-id`.
- Sandbox limits: 100 documents, 5 files, and a small shared SQL quota (5 tables, 256 KB, 20,000 rows written/month) in total.
- API keys come from signing in with GitHub at `https://easy-db.cloud/api/v1/auth/github/login` (browser only). The key is shown once. **You cannot create a key yourself: ask the user for it.**
- Read the key from an environment variable such as `EASYDB_API_KEY`. Never hardcode it, print it or commit it.
Check a key and see its quotas:
```bash
curl https://easy-db.cloud/api/v1/auth/me -H "Authorization: Bearer $EASYDB_API_KEY"
```
## Document endpoints
All take `Content-Type: application/json`. `collection` defaults to `"items"` if omitted. Collections are created implicitly on first insert.
| Action | Request | Body |
| --- | --- | --- |
| Insert / upsert | `POST /api/v1/insert` | `{"collection","id","data":{...}}` |
| Find | `POST /api/v1/find` | `{"collection"}` or `{"collection","id"}` |
| Update | `PUT /api/v1/update` | `{"collection","id","data":{...}}` |
| Delete | `DELETE /api/v1/delete` | `{"collection","id"}` |
```bash
BASE=https://easy-db.cloud
AUTH="Authorization: Bearer $EASYDB_API_KEY" # or: "x-tenant-id: demo_store"
curl -X POST $BASE/api/v1/insert -H "$AUTH" -H "Content-Type: application/json" \
-d '{"collection":"products","id":"prod_001","data":{"name":"Headphones","price":149.99}}'
# -> {"success":true,"insertedId":"prod_001","azureSynced":true}
curl -X POST $BASE/api/v1/find -H "$AUTH" -H "Content-Type: application/json" \
-d '{"collection":"products"}'
# -> {"success":true,"count":1,"documents":[{"_id":"prod_001","name":"Headphones","price":149.99,"_updatedAt":"..."}]}
curl -X PUT $BASE/api/v1/update -H "$AUTH" -H "Content-Type: application/json" \
-d '{"collection":"products","id":"prod_001","data":{"name":"Headphones","price":129.99}}'
curl -X DELETE $BASE/api/v1/delete -H "$AUTH" -H "Content-Type: application/json" \
-d '{"collection":"products","id":"prod_001"}'
```
Behavior to rely on:
- **Insert is an upsert.** The same `id` overwrites the existing document. If `id` is omitted a UUID is generated and returned as `insertedId`.
- **Update replaces the whole document, it does not merge.** To change one field, `find` the document first, modify it, then send the complete object back in `data`.
- **Find has no filters, sorting or pagination.** It returns every document in the collection (or one, by `id`). Filter client-side. Keep collections reasonably small.
- Returned documents carry `_id` and `_updatedAt` metadata fields. Do not send them back inside `data`.
- Update does not report an error if the `id` does not exist.
- `azureSynced: false` means the fast index write succeeded but the durable copy failed. It is not an API failure.
## SQL endpoints
Tenant-isolated relational tables. Routes accept the sandbox (`x-tenant-id: demo_store`) or a registered key. Values are always bound parameters. Native SQL is accepted only via `/sql/query` (restricted subset, below).
- `POST /api/v1/sql/tables` `{"table":"users","columns":[{"name":"id","type":"INTEGER","primaryKey":true},{"name":"name","type":"TEXT","notNull":true}]}` (types: TEXT, INTEGER, REAL, NUMERIC, BLOB)
- `GET /api/v1/sql/tables` list; `DELETE /api/v1/sql/tables` `{"table":"users"}` drop
- `POST /api/v1/sql/insert` `{"table":"users","rows":[{"id":1,"name":"Ann"}]}` (max 100 rows)
- `POST /api/v1/sql/select` `{"table":"users","columns":["name"],"where":{"id":{"gte":1}},"orderBy":"id","order":"desc","limit":50,"offset":0}` (limit max 1000; operators eq, ne, gt, gte, lt, lte, like, in)
- `PUT /api/v1/sql/update` `{"table":"users","set":{"name":"Annie"},"where":{"id":1}}` (`where` required)
- `DELETE /api/v1/sql/delete` `{"table":"users","where":{"id":2}}` (`where` required)
- `POST /api/v1/sql/query` `{"sql":"SELECT * FROM users WHERE id > ?","args":[0]}` native SQL; or `{"statements":[{"sql":"...","args":[...]}, ...]}` (max 25) to run several in one atomic transaction (all commit or none). Use plain table names. Allowed: SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE; one statement each, `?` placeholders only; no comments, PRAGMA, ATTACH, WITH. Disallowed commands (CREATE/DROP DATABASE, TRUNCATE, indexes, views...) return 403/400 `{"error","hint"}`: read `hint` and use the supported alternative; creating, altering and dropping your own tables is fine. Optional `"format":"array"`; max 1000 rows.
- `POST /api/v1/sql/batch` `{"operations":[{"op":"insert","table":"users","row":{"name":"Ann"}},{"op":"select","table":"users"}]}` atomic structured operations (`createTable`, `insert`, `select`, `update`, `delete`; max 25)
- `GET /api/v1/sql/usage` (registered keys) storage, rows read/written this month, table count vs plan limits
Exceeding a SQL quota returns 429 with `status: "LIMIT_REACHED"`.
## Media endpoints
Files are stored per tenant and identified by filename. Uploading the same name overwrites.
```bash
# Upload: multipart (field name must be "file")
curl -X POST $BASE/api/v1/media/upload -H "$AUTH" -F "file=@photo.jpg"
# Also accepted: raw binary body with ?filename=photo.jpg and a Content-Type header,
# or JSON {"fileName":"photo.jpg","base64Content":"...","contentType":"image/jpeg"}
curl "$BASE/api/v1/media/list" -H "$AUTH"
curl -OJ "$BASE/api/v1/media/download?filename=photo.jpg" -H "$AUTH"
curl -X DELETE "$BASE/api/v1/media/delete?filename=photo.jpg" -H "$AUTH"
```
- Download and delete take `filename` as a **query parameter**, not a JSON body.
- Fetch files only through `/media/download`; the underlying storage location is not exposed.
- If no filename is available on a raw upload, one like `asset_<timestamp>` is generated.
## Plans and quotas (registered keys)
| Plan | Requests / month | Document storage | Media storage | Max file size | Collections |
| --- | --- | --- | --- | --- | --- |
| Free | 100,000 | 500 MB | 1 GB | 10 MB | 10 |
| Developer ($9) | 2,000,000 | 10 GB | 25 GB | 50 MB | 50 |
| Scale ($29) | 10,000,000 | 50 GB | 250 GB | 250 MB | unlimited |
Monthly request counts are tracked atomically per tenant in UTC. Document and media storage limits are approximate safeguards based on the tenant's indexed D1 metadata; Azure Table and Blob Storage remain the durable backend. Document inserts and updates and media uploads check the projected usage against the plan. Exceeding a quota returns **HTTP 429** with a `quota` object (`status: "LIMIT_REACHED"`); exceeding the per-file upload size returns **HTTP 413**. Do not retry in a loop: tell the user, delete data, or suggest an upgrade at `https://easy-db.cloud/pricing`. Exact plan limits and current request usage are available from `GET /api/v1/auth/me`.
## Errors
| Status | Meaning |
| --- | --- |
| 400 | Missing field (for example no `id` on update/delete, no `filename`). |
| 401 | `Authorization` header expected but missing (account endpoints). |
| 403 | Invalid or revoked API key, or a non-`demo_store` `x-tenant-id`. |
| 404 | Media file not found. |
| 429 | Quota exceeded (see above). |
Error bodies are JSON: `{"error":"..."}`.
## Guidance for agents
1. Ask the user whether to use the sandbox or their API key before writing any data.
2. Start with `GET /api/v1/auth/me` (registered) or a `find` on a test collection (sandbox) to confirm access.
3. Put the base URL and key in environment variables so generated code is portable.
4. Do not call the account, billing or dashboard endpoints (`/api/v1/auth/*` except `/me`, `/api/v1/billing/*`, `/dashboard`). They are for humans in a browser, and rotating a key invalidates the current one.
5. Never delete or overwrite data the user did not ask you to change.
## More
- Docs and live playground: https://easy-db.cloud
- Pricing: https://easy-db.cloud/pricing
- Agent resources: https://easy-db.cloud/agents