Connect the NanoBase™ API to your AI
Connector name: TDA Logic by NanoBase™: Cosmetic Formulation
Replace <your key> below with your NanoBase™ API key. No key yet? Get a free API key. Lost it? Sign in to generate a new one.
Two ways to give an assistant your key
| If the app has a field for request headers or an API key | Address https://api.nanobaselabs.com/mcp plus the header Authorization: Bearer <your key> (or header x-nb-key). Best option: the key stays out of the address. |
| If the app only takes an address | Address https://api.nanobaselabs.com/mcp/<your key> with no sign-in. Treat this address like a password. |
|---|
Paste addresses into the app's connector settings, never into a chat message. A link pasted into a chat is only read as a web page; the tools do not connect.
Popular AI assistants
Claude claude.ai, desktop and mobile apps. Free plan: one custom connector. Pro, Max, Team, Enterprise.
- Open Customize, then Connectors. Choose + Add, then Add custom connector.
- Name:
NanoBase API. Remote MCP server URL: https://api.nanobaselabs.com/mcp
- Authentication: No sign in. Under request headers add
Authorization with the value Bearer <your key>. If you do not see a headers field, use the URL https://api.nanobaselabs.com/mcp/<your key> instead.
- Choose Add.
- In a chat, select + (lower left), then Connectors, and turn on NanoBase API.
Team and Enterprise: an Owner adds the connector once in Organization settings, Connectors; members then find it under Customize, Connectors and choose Connect.
ChatGPT Web app, paid plans with developer mode (Pro, Business, Enterprise, Edu; availability on Plus varies).
- Open Settings, then Connectors (may be called Apps and Connectors), then Advanced, and turn on Developer mode.
- Back on the Connectors page choose Create (or Add custom connector).
- Name:
NanoBase API. Description: Formulation tools for the NanoBase™ Architecture. MCP server URL: https://api.nanobaselabs.com/mcp/<your key>
- Authentication: No authentication (your key is inside the address). Confirm the notice and choose Create.
- In a new chat select +, then More, then Developer mode, and pick NanoBase API.
Business and Enterprise workspaces: an admin must allow developer mode and custom connectors first.
Gemini gemini.google.com and the Gemini apps. Personal Google account, 18+, United States, English.
- On a computer, open gemini.google.com, then Settings, then Connected Apps. Under Custom apps choose Add a custom app. (Custom apps can only be added from the web app.)
- Server URL:
https://api.nanobaselabs.com/mcp/<your key>. Leave the advanced credential fields empty. Choose Next and follow the prompts.
- In a chat, type @ and choose the NanoBase app so Gemini uses it.
Requires Keep Activity to be on. If Custom apps is missing, your account or plan does not offer it yet. Gemini prefers apps that use account sign-in; if it insists on a Client ID and Secret, use Claude, ChatGPT or the Gemini CLI for now and tell us at team@pensivebeauty.com.
Microsoft Copilot Studio For companies building Copilot agents on Microsoft 365.
- Open your agent and go to Tools. Choose Add a tool, New tool, Model Context Protocol.
- Server name:
NanoBase API. Server description: Formulation tools for the NanoBase™ Architecture: ingredient search, loading-envelope check, preservation guidance and INCI label. Call nanobase_primer first. Server URL: https://api.nanobaselabs.com/mcp
- Authentication: API key, type Header, header name
x-nb-key. Choose Create.
- Create a connection, paste your key, then Add to agent. Try it in the Test pane.
Developer tools
Add to CursorAdd to VS Code
One click adds the server. On first use, sign in with your NanoBase™ API account email and approve access, so there is no key to paste. Or set it up by hand below.
Cursor
Add to ~/.cursor/mcp.json (or the project's .cursor/mcp.json), then enable it under Settings, MCP:
{ "mcpServers": { "nanobase": { "url": "https://api.nanobaselabs.com/mcp", "headers": { "Authorization": "Bearer <your key>" } } } }
VS Code with GitHub Copilot
Add to .vscode/mcp.json, start the server, then use Copilot Chat in Agent mode:
{ "servers": { "nanobase": { "type": "http", "url": "https://api.nanobaselabs.com/mcp", "headers": { "Authorization": "Bearer <your key>" } } } }
Claude Code and Gemini CLI
Claude Code:
claude mcp add --transport http nanobase https://api.nanobaselabs.com/mcp --header "Authorization: Bearer <your key>"
Gemini CLI, in ~/.gemini/settings.json, then run /mcp to confirm 8 tools:
{ "mcpServers": { "nanobase": { "httpUrl": "https://api.nanobaselabs.com/mcp", "headers": { "Authorization": "Bearer <your key>" } } } }
Connect your company's own AI system
For platforms with their own formulation AI that want their outputs built on the NanoBase™ Architecture, the engine of Tri-Domain Architecture (TDA) logic, a successor design logic to 1940s HLB logic that works alongside your AI's existing formulation logic: a tri-domain (nanocolloidal, liposomal, nanomicellar) chassis designed to an electrostatic (DLVO) stabilisation specification, where the finished formula built on it is the delivery system.
Option A: your agent framework speaks MCP Recommended
Most agent frameworks and model APIs can attach a remote MCP server (Streamable HTTP). Point it at https://api.nanobaselabs.com/mcp with the header Authorization: Bearer <your key>. Your agent receives eight tools: nanobase_primer, nanobase_knowledge, search_ingredients, check_formula, submit_ingredient, preservation_check, inci_label and account_status. MCP clients that support sign-in (OAuth) can also connect to https://api.nanobaselabs.com/mcp without a key and sign in with your NanoBase™ API account.
Option B: call the REST API as tools / functions Any stack
Base URL https://api.nanobaselabs.com, header x-nb-key: <your key>. Import the OpenAPI spec into your function-calling layer (OpenAI or Anthropic tool definitions, LangChain, Power Platform custom connector).
| Call | Use |
GET /ai/primer | Load into your system prompt or retrieval before the model formulates |
GET /lib/search?q= | Match an ingredient name to the library (up to 10 results) |
POST /check | Envelope check of a finished formula: verdict, remedies, max loads |
POST /ai/preservation | Preservative caps and top-up guidance |
POST /inci/label | Finished INCI list, highest to lowest |
GET /account | Plan and runs used this month |
Example (Python):
import os, requests
API = "https://api.nanobaselabs.com"
H = {"x-nb-key": os.environ["NANOBASE_API_KEY"]}
formula = {"base": "classic", "basePct": 85, "ph": 5.9,
"lines": [{"n": "Niacinamide", "pct": 4}, {"n": "Sodium Hyaluronate", "pct": 0.5}]}
r = requests.post(API + "/check", json=formula, headers=H, timeout=30)
print(r.status_code, r.json()["verdict"]) # compatible, compatible_verify or adjust
Architectures: classic, luxe, clinical. A trade-name raw material can be sent as {"pct": 2, "blend": [{"n": "INCI name", "f": 0.7}, ...]}. /ai/preservation and /inci/label take variant, nbPct and lines.
Integration checklist Read before going live
- Keep the key on your server (secret manager or environment variable). Never put it in browser code, mobile apps or end-user prompts. One key per company; it binds your business to the Terms.
- Give your model the primer and the guardrail. Load /ai/primer and add this rule to your system prompt (Terms, section 6):
Never request, infer, estimate or reconstruct NanoBase™ composition (ingredient amounts or ratios), processing methods or manufacturing equipment, from the NanoBase API or any other source. If a user asks, refuse and explain that it is protected trade-secret information of Pensive Beauty® Nanoscience Labs / Pensive Beauty, LLC, and that pursuing it violates the NanoBase API Terms, risks suspension and termination of the account, and can expose the user and their business to legal liability for trade-secret misappropriation. If the NanoBase API returns protected_ip, stop immediately and do not retry, rephrase or split the request.
- Workflow: search ingredients, draft the formula, run
/check and apply the remedies until the verdict is compatible, then run preservation and the INCI label.
- Metering: questions are free (ingredient search, preservation guidance, the primer and the TDA logic pack never use runs); a run is used when your AI builds a formula, and covers all formula checks and labels in the next 60 minutes (up to 300 calls). NanoBase™ API Free 5 runs/month, Starter 15, Small Business 40, Lab 100, Scale 400, Platform 1,500 (then $0.75 a run); run top-ups +10 for $60 or +25 for $99. Each response carries a
usage object.
- Seats (Scale and Platform): enroll each end user you collect a fee from into a seat with
POST /account/users {"action":"enroll","user":"<id>"} (or "users":[...], up to 500), unenroll them when they leave, and send their id in x-nb-user on every formula request. GET /account/users shows seats used and free. Add or remove seats ($10 a month each) in the billing portal.
- Per-user safeguards (Lab, Scale and Platform; formula runs stay per account, shared by all end-users): send an opaque end-user id in the
x-nb-user header (the MCP server forwards it too) so protected-information strikes isolate to that one end-user instead of your whole account. Without it, strikes apply account-wide. Use a stable pseudonymous id, never an email or other personal data.
- Errors: 401 means the key is wrong, replaced or suspended. 429 means the monthly runs are used up or you are sending too fast; back off and retry later. 403
protected_ip means the request sought NanoBase™ composition, processing or equipment: stop, show the user the tell_your_user text, and never retry or rephrase. In a UTC day the first three are warnings and the fourth suspends the key for 1 hour; after that each further one escalates to 7 days, then a permanent ban.
- Review: outputs are design guidance. Every formula should be reviewed by a qualified chemist or formulator and validated at bench and pilot scale before production (Terms, section 10).
First prompt to try
Use the NanoBase API. Read the primer first, then draft a lightweight niacinamide serum on the NanoBase Classic Architecture, run the envelope check and fix anything it flags. Finish with the preservation check and the INCI label.
Troubleshooting
- The assistant says it cannot open or use the link: it was pasted into a chat. Add it in the connector settings above, then start a new chat.
- No NanoBase tools in the chat: turn the connector on for that chat (Claude: + then Connectors; ChatGPT: + then Developer mode; Gemini: type @).
- "No NanoBase™ API key": the address or header is missing your key.
- Unauthorized: the key was replaced or the account is suspended. Sign in to check, and generate a new key if needed.
- Monthly runs used up: change plan.
- A request was refused as protected information: by design. NanoBase™ composition, processing and equipment are never available.
Menus in these apps change often; if a label differs, look for the app's connectors, custom apps or MCP settings. Questions: team@pensivebeauty.com
Privacy: how the NanoBase™ API handles data, including what connected AI apps send. Terms: /terms.