API Documentation
Colour Memory stops your AI hallucinating colour names. Every result is sourced from a primary archive citation. Base URL: https://colour-memory-api-production.up.railway.app Live
Overview
Two ways to use Colour Memory: via the MCP server (recommended for AI agents and Claude) or the REST API (for direct integration). Both use the same archive and return the same structured data.
Every response includes a primary source citation, a confidence score (0.0–1.0), a claim strength grade (A–E), epistemic guardrails (do_not_say), and cultural risk flags. No generated data. No guesses.
Using Claude, Cursor, or any MCP client? Add the MCP server at https://colour-memory-api-production.up.railway.app/mcp — all all tools register automatically. See MCP Server.
Free colour APIs tell you what a colour is called. Colour Memory tells you what it means, where it came from, and whether it will get you in trouble.
Get an API key
Two free tiers. No credit card required to start.
For paid plans (Studio £12, Pro £39, Founder Enterprise £299) see Pricing. Keys are issued at colourmemory.com/start.
Quickstart
Match a hex colour to the archive in one call:
curl https://colour-memory-api-production.up.railway.app/query/hex \ -H "X-Api-Key: your_key_here" \ -H "Content-Type: application/json" \ -d '{"hex": "#D4A829"}'
{ "name": "Song Gold Sycee", "hex": "#D4A829", "archive": "China", "primary_source": "Song dynasty imperial gold currency ingots", "confidence": 0.97, "claim_strength": "A", "cultural_risk": "low", "do_not_say": [] }
Authentication
Pass your API key in the X-Api-Key request header on all authenticated requests.
X-Api-Key: cm_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Requests without a key are rate limited by IP and return a 401 after the free preview limit is exhausted.
Intelligence credits
Colour Memory has two types of call:
Every response from an Intelligence endpoint includes _intelligence_credits_remaining so you always know your balance. When credits reach zero, archive tools keep working. Top up at colourmemory.com/pricing.
If a Claude API call fails (timeout, error) after credit deduction, credits are automatically refunded. You never pay for a failed call.
MCP Server
Colour Memory ships as a full MCP server. Connect once and all all tools are available to your AI agent without any additional code.
Setup — Claude Desktop
Open Claude Desktop settings and add to your MCP config:
{ "mcpServers": { "colour-memory": { "url": "https://colour-memory-api-production.up.railway.app/mcp", "headers": { "X-Api-Key": "your_key_here" } } } }
Also available on Smithery and Glama for one-click connection.
Setup — ChatGPT
In ChatGPT, go to Settings → Connectors → Add connector. Enter the MCP URL above and your API key. All tools register automatically.
All all tools
Tools are grouped by function. Archive tools use archive calls. Intelligence tools use credits.
Core endpoints
query_hex — Match by hex
| Field | Type | Description |
|---|---|---|
| hexrequired | string | Hex value e.g. #D4A829 |
| n_resultsoptional | integer | Number of matches. Default 1, max 10. |
| archiveoptional | string | Restrict to a named archive. |
query_conceptual — Semantic search
Uses sentence-transformer embeddings. Abstract queries like "grief," "Ottoman luxury," or "toxic chemistry" return real archive results.
| Field | Type | Description |
|---|---|---|
| queryrequired | string | Natural language query |
| n_resultsoptional | integer | Default 5, max 20. |
| archiveoptional | string | Restrict to a named archive. |
archive_search — Keyword search
| Field | Type | Description |
|---|---|---|
| qrequired | string | Search term — name, material, pigment, period |
| archiveoptional | string | Restrict to a named archive. |
| limitoptional | integer | Default 10, max 50. |
session_brief — Forensic brief 3 credits
One call returns colour cards, editorial argument, act structure, pull quote, closing line, and Midjourney/Flux image prompt. Uses Opus model — costs 3 Intelligence credits.
brand_collision — Colour ownership
Checks competitor distance, cultural context, and ownership risk. Returns verdict with reasoning.
ecommerce_copy — Product copy 1 credit
Returns product title, short description, long description, SEO title, meta description, alt text, and Instagram caption — all grounded in archive provenance.
accessibility_matrix — Full WCAG matrix
| Field | Type | Description |
|---|---|---|
| paletterequired | array | Array of hex values e.g. ["#D4A829", "#0A0A0B"] |
Response schema
Every colour result includes these fields:
Claim strength grades
Error codes
Health endpoint
curl https://colour-memory-api-production.up.railway.app/health
Returns API version, archive list, colour count, search method, and embedding model. No key required.