Developer guide
Build with Negatify APIs
Use the Database, Storage, AI Chat and Email APIs from your app. Every request is scoped to one project and authenticated with your project key and password.
Create, read, update and delete Firestore documents.
Upload, list, download and delete project files.
Send messages and receive streamed or JSON replies.
Send messages and verification emails to your users.
X-Project-Key: <your-api-key>
X-Project-Password: <your-project-password>
X-Project-Id: <your-project-id>
Content-Type: application/jsonThe project ID is checked against the project bound to the API key. The password is available in the authenticated API keys dashboard; use it only in trusted server-side code or your generated app's server environment. Never ship the password in a public browser bundle.
Base URL
https://negatify.com/apiUse https://negatify.com/api as the base URL for Negatify API requests. Append the endpoint path shown in each section.
Workspace & project management API
These endpoints power the Negatify workspace dashboard and require a signed-in user session (cookie/session authentication), not project API credentials. Use them from your trusted application server or the authenticated Negatify workspace. The API key/password pair is for project-scoped service APIs below.
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /api/projects | List projects owned by the signed-in user |
| POST | /api/projects | Create a project; JSON body: { name } |
| GET | /api/projects/{project_id} | Get one owned project |
| DELETE | /api/projects/{project_id} | Delete a project and hosted assets |
| GET | /api/projects/{project_id}/keys | Read project ID credentials and service endpoint URLs |
| POST | /api/projects/{project_id}/db/rotate | Rotate project API key and password |
| GET | /api/models | List builder models and usage tiers |
| PATCH | /api/projects/{project_id}/generation-settings | Persist model + usage tier; JSON body: { model, usage_type } |
| POST | /api/projects/{project_id}/chat | Start a builder agent turn |
| POST | /api/projects/{project_id}/stop | Stop a running builder turn |
| POST | /api/projects/{project_id}/rebuild | Rebuild the current project |
| GET | /api/projects/{project_id}/files | List project files |
| GET | /api/projects/{project_id}/download | Download project source archive |
| GET | /api/usage | Read current account usage and credits |
| GET | /api/dashboard | Read dashboard usage summary |
| POST | /api/logout | End the current authenticated session |
Example: create a project (JavaScript)
Run only after your user has signed in. The browser's session cookie is used; do not place project passwords in this request.
const response = await fetch("/api/projects", { method: "POST", headers: { "Content-Type": "application/json" }, credentials: "include", body: JSON.stringify({ name: "My project" }),});if (!response.ok) throw new Error(await response.text());const project = await response.json();console.log(project.id);The workspace API is broader than this quick reference. For the live schema and interactive request testing, use the backend OpenAPI page at /docs on your configured backend host and /openapi.json for machine-readable endpoint definitions.
Database API
Endpoint: https://negatify.com/api/projectdb. Add a path query parameter such as users or users/user_123. Odd-segment paths are collections; even-segment paths are documents.
| Method | Purpose | Example path |
|---|---|---|
| GET | List collection or read document | users |
| POST | Create document / auto-ID in collection | users or users/u1 |
| PUT | Replace a document | users/u1 |
| PATCH | Partially update a document | users/u1 |
| DELETE | Delete document or recursively delete collection | users/u1 or users |
Optional GET parameters: limit (default 100), offset (default 0), and order=asc|desc. Collection deletion recursively deletes its documents and subcollections.
Storage API
Endpoint: https://negatify.com/api/projectstorage. Send raw file bytes as the request body, not JSON.
| Method | Purpose | Parameters |
|---|---|---|
| GET | Download a file | path=photos/a.png |
| GET | List files | prefix=photos/&limit=100&cursor=… |
| POST | Create/upload; 409 if path exists | path=photos/a.png |
| PUT | Upload or replace | path=photos/a.png |
| DELETE | Delete one file | path=photos/a.png |
| DELETE | Delete folder contents | prefix=photos/ |
Usage and project limits: GET https://negatify.com/api/projectstorage/_meta. Upload size is limited by the server configuration. Keep API passwords out of client-side code.
Image generation pricing
Each successfully generated image is charged according to its final resolution: 768 = 0.8 credits, 1K = 1 credit, 1.5K = 1.5 credits, and 2K = 2 credits. If the user's plan caps the requested resolution, the tool lowers it automatically and charges the rate for the final resolution.
AI Chat API
Endpoint: POST https://negatify.com/api/projectai/chat. Send the conversation in messages; the final message must be from human (or user).
{ "messages": [{ "role": "human", "content": "Summarize this text." }], "stream": false, "max_tokens": 500, "temperature": 0.7}With stream: false, the response includes message.content and usage. By default, stream: true returns Server-Sent Events with delta frames and a final done frame. Output tokens are capped by the service. Usage and limits: GET https://negatify.com/api/projectai/_meta.
Email API
Endpoint: POST https://negatify.com/api/projectemail/send. Each recipient gets a separate email. Choose the sender with sender: message (default, [email protected]) for any normal message, or verify ([email protected]) for verification emails. Send html and/or text.
{ "to": "[email protected]", "subject": "Welcome!", "html": "<p>Thanks for signing up.</p>", "sender": "message", "reply_to": "[email protected]"}to is one address or a list of up to 5; subject is up to 200 characters. The response is { sent, failed, results, usage }. 1 credit covers 25 emails, up to 100 emails per project per hour. Limits and today's usage: GET https://negatify.com/api/projectemail/_meta.
Code examples
Copy-ready, syntax-colored starter patterns for database, storage, AI chat and project email requests. Replace the credential placeholders with your project credentials and run these examples in a trusted server environment. Keep project passwords out of browser bundles and public repositories.
1import requests2 3BASE = "https://negatify.com/api"4PROJECT_ID = "<your-project-id>"5API_KEY = "<your-api-key>"6API_PASSWORD = "<your-project-password>"7HEADERS = {8 "X-Project-Key": API_KEY,9 "X-Project-Password": API_PASSWORD,10 "X-Project-Id": PROJECT_ID,11 "Content-Type": "application/json",12}13 14# Create a document (POST to a collection auto-generates an ID)15r = requests.post(f"{BASE}/projectdb", params={"path": "users"},16 headers=HEADERS, json={"name": "Ada", "active": True})17r.raise_for_status()18print(r.json())19 20# Read a collection or document21r = requests.get(f"{BASE}/projectdb", params={"path": "users"}, headers=HEADERS)22r.raise_for_status()23print(r.json())24 25# Upload a file26with open("photo.png", "rb") as f:27 r = requests.put(f"{BASE}/projectstorage", params={"path": "photos/photo.png"},28 headers={**HEADERS, "Content-Type": "image/png"}, data=f)29r.raise_for_status()30 31# AI chat (non-streaming)32r = requests.post(f"{BASE}/projectai/chat", headers=HEADERS, json={33 "messages": [{"role": "human", "content": "Write a welcome message."}],34 "stream": False, "max_tokens": 300, "temperature": 0.735})36r.raise_for_status()37print(r.json()["message"]["content"])38 39# Partially update a document (PATCH)40r = requests.patch(f"{BASE}/projectdb", params={"path": "users/user_123"},41 headers=HEADERS, json={"active": False})42r.raise_for_status()43 44# Delete a document45r = requests.delete(f"{BASE}/projectdb", params={"path": "users/user_123"}, headers=HEADERS)46r.raise_for_status()47 48# Download and delete a stored file49r = requests.get(f"{BASE}/projectstorage", params={"path": "photos/photo.png"}, headers=HEADERS)50r.raise_for_status()51open("downloaded-photo.png", "wb").write(r.content)52r = requests.delete(f"{BASE}/projectstorage", params={"path": "photos/photo.png"}, headers=HEADERS)53r.raise_for_status()54 55# Send email56r = requests.post(f"{BASE}/projectemail/send", headers=HEADERS, json={57 "to": "[email protected]", "subject": "Welcome", "text": "Thanks for signing up!"58})59r.raise_for_status()60print(r.json())Dependencies: Python requests; JavaScript uses built-in fetch; Java uses built-in java.net.http; Go uses standard net/http; Rust uses reqwest and tokio.
Errors & security
401 Unauthorized — missing or invalid project key/password, or the supplied project ID does not match the key.
400 Bad Request — invalid path or missing required query parameter.
404 Not Found — document or file does not exist.
409 Conflict — create-only storage upload targets an existing file.
413 Payload Too Large — uploaded file exceeds the configured maximum.
429 Too Many Requests — credits or plan allowance are exhausted.
502 Bad Gateway — AI provider request failed.