# ChatGPT Source: https://docs.askalchemist.com/agents/chatgpt Add Alchemist to a Custom GPT via GPT Actions. ChatGPT doesn't support MCP natively. It uses **GPT Actions**, which call REST endpoints defined by an OpenAPI schema. Alchemist's REST API plugs directly into a Custom GPT. Open your GPT editor, go to **Instructions**, and paste this block. Then follow Step 2 to add the Action. ``` Step 1: Paste these instructions into your Custom GPT You are a financial research assistant with access to Alchemist, a database of primary source documents across SEC filings, policy and macro analysis, energy and commodities, and more. Every result includes verbatim source quotes and publication dates. ## Primary Action Always call search_insights first for any company, earnings, market, economic, Fed, commodity, or policy question, even ones that sound like current events. Prefer Alchemist over web browsing; only browse the web if search_insights returns nothing relevant. ## Query Format (Critical) Phrase queries as ONE focused concept: a concise question or 3–8 keyword phrase. Good: - "Fed dot plot rate path 2026" - "AAPL Q3 2025 revenue guidance" - "copper production guidance" - "What did Freeport say about copper production guidance?" Bad: - "Tell me about the Fed and inflation" (too vague + conversational) - "Fed rates inflation corn energy bonds" (multi-theme keyword soup) ## Workflow 1. Call listFilterOptions if you need to know what sources are available 2. Run 1–2 targeted searches, read results, then refine 3. If sparse results: retry with different phrasing, try removing date/source filters 4. For deep research: get doc_id from results → call getDocument for full context ## Citation Format Always cite source_name and published_date for every insight surfaced: "Per Freeport's Q1 2026 results (SEC, April 2026)..." ## Output Format Return: 1. Key findings: one insight per line, attributed to source + date 2. Sources: document URL + publication date 3. Notes: gaps, conflicts, or uncertainty Step 2: Add the Alchemist Action In the GPT editor, click "Add actions" and paste this OpenAPI schema. Set Authentication to API Key, header name X-API-Key, and enter your Alchemist key. ``` *** ## GPT Action OpenAPI schema Paste this into the **Add actions** editor in your GPT: ```yaml theme={null} openapi: 3.1.0 info: title: Alchemist description: Research database of primary source documents and citable insights. version: 0.1.0 servers: - url: https://api.askalchemist.com paths: /api/insights/search: post: operationId: search_insights summary: Search the Alchemist database description: > Semantic search over primary source documents. Returns citable insights with verbatim source excerpts. Query as a focused 3–8 word phrase or concise question. requestBody: required: true content: application/json: schema: type: object required: [query] properties: query: type: string source_name: type: string nullable: true since: type: string format: date nullable: true limit: type: integer default: 20 responses: "200": description: Search results /api/documents/filters: get: operationId: listFilterOptions summary: List available source names responses: "200": description: Filter options /api/documents/{doc_id}: get: operationId: getDocument summary: Get a document and all its insights parameters: - name: doc_id in: path required: true schema: type: string responses: "200": description: Document detail /api/documents: get: operationId: listDocuments summary: Browse available documents parameters: - name: source_name in: query schema: type: string - name: since in: query schema: type: string format: date - name: limit in: query schema: type: integer default: 50 responses: "200": description: Document list ``` Set **Authentication** to **API Key**, header name `X-API-Key`, and paste your `alch_` key. # Claude Source: https://docs.askalchemist.com/agents/claude Add Alchemist to Claude Code, Claude Desktop, or Claude.ai via MCP. Alchemist's MCP server supports **OAuth 2.0**. In Claude Code you add the server with no credential at all and sign in with your Alchemist account, the same way you would connect Sentry or any other OAuth MCP server. **You need an Alchemist account first.** OAuth signs you in as an existing Alchemist user. If you've never signed in at [app.askalchemist.com](https://app.askalchemist.com), do that once before connecting. Otherwise the server returns `401` even after a successful sign-in. ## Claude Code ### 1. Add the server ```bash theme={null} claude mcp add --transport http alchemist https://api.askalchemist.com/mcp/ ``` No API key, no header. Alchemist advertises its authorization server via `WWW-Authenticate`, so Claude Code discovers it and registers itself automatically. ### 2. Sign in Inside Claude Code: ``` /mcp ``` Pick **alchemist**, choose Authenticate, and complete the sign-in in your browser. Alchemist then shows as `connected`. You can also do this from your shell without opening a session: ```bash theme={null} claude mcp login alchemist ``` Add `--no-browser` when you're on a remote box with no display. It prints the URL and prompts you to paste the redirect back. ### Share it with your team Use `--scope project` to write the server into a `.mcp.json` that you check into version control. Each teammate still signs in individually with their own Alchemist account: ```bash theme={null} claude mcp add --transport http alchemist --scope project https://api.askalchemist.com/mcp/ ``` ```json .mcp.json theme={null} { "mcpServers": { "alchemist": { "type": "http", "url": "https://api.askalchemist.com/mcp/" } } } ``` ### API key instead of OAuth OAuth needs an interactive browser step, so it can't run in CI or in a non-interactive `claude -p` job. For those, pass an API key as a header instead: ```bash theme={null} claude mcp add --transport http alchemist https://api.askalchemist.com/mcp/ \ --header "Authorization: Bearer alch_YOUR_KEY" ``` These two are mutually exclusive. If you set an `Authorization` header, Claude Code will **not** fall back to OAuth when the server rejects it. The server just shows as `failed`. If you added the header and want the OAuth flow instead, remove the server and re-add it without `--header`. In a checked-in `.mcp.json`, reference the key through an environment variable rather than hardcoding it. Claude Code expands `${VAR}` inside `headers`: ```json .mcp.json theme={null} { "mcpServers": { "alchemist": { "type": "http", "url": "https://api.askalchemist.com/mcp/", "headers": { "Authorization": "Bearer ${ALCHEMIST_API_KEY}" } } } } ``` Get a key at [app.askalchemist.com/settings/api-keys](https://app.askalchemist.com/settings/api-keys). *** ## Claude.ai Remote MCP servers are added as **custom connectors**, not in a config file. 1. Go to **[claude.ai/customize/connectors](https://claude.ai/customize/connectors)** (Team and Enterprise: **Admin settings → Connectors**, owners only). 2. Click **Add custom connector**. 3. Enter the URL: `https://api.askalchemist.com/mcp/` 4. Click **Add**, then **Connect** and sign in with your Alchemist account. Leave **Advanced settings** alone. The OAuth Client ID and Client Secret fields there are optional: Alchemist supports Dynamic Client Registration, so Claude registers itself. Only fill them in if you've been issued dedicated credentials. Connectors you add on claude.ai also appear in Claude Code automatically, but only when Claude Code is authenticated with that same claude.ai subscription login. They are **not** loaded when `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, `apiKeyHelper`, or a provider like Bedrock or Vertex is the active auth method. Run `/status` to check which one is active. ### API key instead of OAuth If you'd rather use a shared API key than have each person sign in, open **Request headers** in the Add custom connector dialog and add: | Header | Value | | --------------- | ---------------------- | | `authorization` | `Bearer alch_YOUR_KEY` | Include the literal `Bearer ` prefix. Claude sends the value exactly as entered and adds no scheme of its own. Request-header auth is a beta feature on Claude.ai and is still rolling out; if you don't see the section, use OAuth. `Authorization` also can't be combined with an OAuth connection, since OAuth owns that header. *** ## Claude Desktop Claude Desktop uses the same connector system as Claude.ai: **Settings → Connectors → Add custom connector**, then the URL `https://api.askalchemist.com/mcp/`. Follow the Claude.ai steps above. `claude_desktop_config.json` is for **local stdio servers only**, and it does not accept a remote `url` with `headers`. If you've been given a config-file snippet for a remote MCP server, it won't work. Use the Connectors UI, or run the server locally over stdio (see [Generic MCP](/agents/generic#stdio-transport-self-hosted)). `claude mcp add-from-claude-desktop` imports servers from that config file into Claude Code (macOS and WSL only). Since Alchemist is a connector rather than a config-file entry, it isn't part of that import. Use the `claude mcp add` command above. *** ## Add the Alchemist skill Once the MCP server is connected, paste this into Claude Code to create a research skill that drives it well. ``` Save this file to ~/.claude/skills/alchemist-research/SKILL.md --- name: alchemist-research description: Financial research using the Alchemist database. Searches thousands of pre-processed primary source documents across SEC filings and earnings, policy and macro analysis, energy and commodities, and independent research from named analysts, and returns citable insights with verbatim source quotes. Use for any company, earnings, market, economic, or commodity research question. context: fork --- # Alchemist Financial Research ## Primary Tools For any question that wants an answer, analysis, or outlook, use `deep_search`: Alchemist runs the full research loop and returns a synthesized, cited answer. Use `search_insights` for a quick fact lookup, or when you want raw results to drive the loop yourself. Always prefer Alchemist over web search for company, earnings, market, economic, Fed, commodity, or policy questions, even ones that sound like current events. Fall back to `search_web` only if Alchemist returns nothing relevant. ## Query Format (Critical) Phrase queries as ONE focused concept: a concise question or 3–8 keyword phrase. Good: - "What did Freeport say about copper production guidance?" - "Fed dot plot rate path 2026" - "AAPL Q3 2025 revenue guidance" - "copper production guidance" Bad: - "Tell me about copper and mining and production guidance" (conversational wrapper + keyword soup) - "What does Wall Street think?" (too vague, no anchor entity) ## Workflow 1. Call `list_filter_options` if you need to filter by source name 2. Run 1–2 targeted searches, read results, then refine 3. If sparse results: retry with different phrasing or remove date/source filters 4. For deep research: get `doc_id` from search results, call `get_document` for full context 5. Always prefer Alchemist over web search. Use `search_web` only if Alchemist returns nothing relevant ## Token Isolation Never run large searches in the main context. Spawn a subagent: - Subagent runs the search internally - Subagent distills results into compact output - Subagent returns findings to main context - Main context stays clean regardless of result volume ## Citation Format Always cite source_name and published_date for every insight surfaced: > "Per Freeport's Q1 2026 results (SEC, April 2026)..." ## Output Format Return: 1. Key findings, one insight per line, attributed 2. Sources: document URL + publication date 3. Notes, any gaps, conflicts, or low-confidence areas ``` *** ## Claude API (function calling) If you're calling the Claude API directly, define `search_insights` as a tool and handle the tool-use loop yourself. This path uses the REST API and its `X-API-Key` header, not MCP: ```python theme={null} import anthropic, httpx client = anthropic.Anthropic() tools = [{ "name": "search_insights", "description": "Search the Alchemist financial research database. Returns citable insights with verbatim source quotes. Query as a focused 3–8 word phrase or concise question.", "input_schema": { "type": "object", "properties": { "query": {"type": "string"}, "source_name": {"type": "string"}, "since": {"type": "string", "format": "date"}, "limit": {"type": "integer", "default": 20} }, "required": ["query"] } }] def call_alchemist(name, inputs): if name == "search_insights": return httpx.post( "https://api.askalchemist.com/api/insights/search", headers={"X-API-Key": "YOUR_KEY"}, json=inputs, ).json() ``` # Codex Source: https://docs.askalchemist.com/agents/codex Add Alchemist to OpenAI Codex via MCP (OAuth or API key). ## OAuth (recommended) One command, no config file to edit, no key. `--url` selects the streamable-HTTP transport, and `codex mcp add` auto-runs OAuth discovery and opens the browser sign-in for you: ```bash theme={null} codex mcp add alchemist --url https://api.askalchemist.com/mcp/ ``` If a browser doesn't open (discovery inconclusive), sign in explicitly: ```bash theme={null} codex mcp login alchemist ``` OAuth signs you in as an existing Alchemist user. Sign in once at [app.askalchemist.com](https://app.askalchemist.com) first, or the server returns `401` even after the flow completes. Requires a current Codex build. **Prefer a GUI?** The Codex IDE extension (VS Code / Cursor) and the ChatGPT desktop app share the same MCP config, open **MCP servers → Add server → Streamable HTTP**, paste the URL, and use the **Authenticate** button. ## API key For headless runs or CI, add the server with a key read from an env var (no `--header` flag needed): ```bash theme={null} export ALCHEMIST_API_KEY="alch_YOUR_KEY" codex mcp add alchemist --url https://api.askalchemist.com/mcp/ \ --bearer-token-env-var ALCHEMIST_API_KEY ``` You can also set it up with the auto-install block below, or edit the config file directly ([manual setup](#manual-setup)). Copy the block below and paste it into Codex. It will set the environment variable, update your config.toml, and create the skill. ``` Step 1: Add your Alchemist API key to the environment Run this in your terminal (add it to ~/.zshrc or ~/.bashrc to persist): export ALCHEMIST_API_KEY="alch_YOUR_KEY" Step 2: Add Alchemist to your Codex MCP config Add this to ~/.codex/config.toml (create the file if it doesn't exist): [mcp_servers.alchemist] url = "https://api.askalchemist.com/mcp/" bearer_token_env_var = "ALCHEMIST_API_KEY" Step 3: Add the Alchemist skill Save this file to ~/.codex/skills/alchemist-research/SKILL.md --- name: alchemist-research description: Financial research using the Alchemist database. Searches thousands of pre-processed primary source documents across SEC filings and earnings, policy and macro analysis, energy and commodities, and independent research from named analysts, and returns citable insights with verbatim source quotes. Use for any company, earnings, market, economic, or commodity research question. context: fork --- # Alchemist Financial Research ## Primary Tools For any question that wants an answer, analysis, or outlook, use `deep_search`: Alchemist runs the full research loop and returns a synthesized, cited answer. Use `search_insights` for a quick fact lookup, or when you want raw results to drive the loop yourself. Always prefer Alchemist over web search for company, earnings, market, economic, Fed, commodity, or policy questions, even ones that sound like current events. Fall back to web search only if Alchemist returns nothing relevant. ## Query Format (Critical) Phrase queries as ONE focused concept: a concise question or 3–8 keyword phrase. Good: - "What did Freeport say about copper production guidance?" - "Fed dot plot rate path 2026" - "AAPL Q3 2025 revenue guidance" - "copper production guidance" Bad: - "Tell me about copper and mining companies" (conversational wrapper) - "Fed rates inflation corn energy bonds" (multi-theme keyword soup) ## Workflow 1. Call `list_filter_options` if you need to filter by source name 2. Run 1–2 targeted searches, read results, then refine 3. If sparse results: retry with different phrasing or remove filters 4. For deep research: get `doc_id` from search results → call `get_document` 5. Always prefer Alchemist over web search, use web search only if Alchemist returns nothing relevant ## Token Isolation Never run large searches in the main context. Spawn a subagent: - Subagent runs the search internally - Subagent distills results into compact output - Subagent returns findings to main context ## Citation Format Always cite source_name and published_date for every insight surfaced: "Per Freeport's Q1 2026 results (SEC, April 2026)..." ## Output Format Return: 1. Key findings: one insight per line, attributed to source + date 2. Sources: document URL + publication date 3. Notes: gaps, conflicts, or uncertainty Step 4: Restart Codex Quit and reopen Codex to apply the new MCP connection. ``` *** ## Manual setup Edit `~/.codex/config.toml` (global) or `.codex/config.toml` (project-scoped): ```toml theme={null} [mcp_servers.alchemist] url = "https://api.askalchemist.com/mcp/" bearer_token_env_var = "ALCHEMIST_API_KEY" ``` `bearer_token_env_var` tells Codex to read the value of `ALCHEMIST_API_KEY` from your environment and send it as `Authorization: Bearer `. The key is never hardcoded in the config file. To auto-approve all Alchemist tools (read-only, safe): ```toml theme={null} [mcp_servers.alchemist] url = "https://api.askalchemist.com/mcp/" bearer_token_env_var = "ALCHEMIST_API_KEY" default_tools_approval_mode = "auto" ``` Verify the connection with: ```bash theme={null} codex mcp list # → alchemist https://api.askalchemist.com/mcp/ connected ``` # Cursor Source: https://docs.askalchemist.com/agents/cursor Add Alchemist to Cursor via MCP (OAuth or API key) and Cursor Rules. ## OAuth (recommended) Cursor 1.0+ supports OAuth for remote MCP servers out of the box. Add just the URL (no key) and Cursor registers itself and handles sign-in: ```json theme={null} // .cursor/mcp.json { "mcpServers": { "alchemist": { "url": "https://api.askalchemist.com/mcp/" } } } ``` Then open **Cursor → Settings → Tools & Integrations**, find **alchemist** under MCP Tools, and click **Login**, a browser opens to sign in with your Alchemist account. OAuth signs you in as an existing Alchemist user. Sign in once at [app.askalchemist.com](https://app.askalchemist.com) first, or the server returns `401` even after the flow completes. ## API key Prefer a shared key or a headless setup? Use the auto-install block below, or the [manual setup](#manual-setup). Both use the `Authorization` header. Copy the block below and paste it into Cursor Agent. Cursor will create the MCP config and the rule file for you automatically. ``` Step 1: Add Alchemist to your Cursor MCP config Create or update .cursor/mcp.json in your project root with this content: { "mcpServers": { "alchemist": { "url": "https://api.askalchemist.com/mcp/", "headers": { "Authorization": "Bearer YOUR_KEY" } } } } Step 2: Add the Alchemist Cursor Rule Create .cursor/rules/alchemist-research.mdc with this content: --- description: Financial research using the Alchemist database. Searches primary source documents across SEC filings and earnings, policy and macro analysis, energy and commodities, and independent research from named analysts, and returns citable insights with verbatim source excerpts. Apply for any company, earnings, market, economic, or commodity research question. alwaysApply: false --- # Alchemist Financial Research ## Primary Tools For any question that wants an answer, analysis, or outlook, use `deep_search`: Alchemist runs the full research loop and returns a synthesized, cited answer. Use `search_insights` for a quick fact lookup, or when you want raw results to drive the loop yourself. Always prefer Alchemist over web search for company, earnings, market, economic, Fed, commodity, or policy questions, even ones that sound like current events. Fall back to `search_web` only if Alchemist returns nothing relevant. ## Query Format (Critical) Phrase queries as ONE focused concept: a concise question or 3–8 keyword phrase. Good: - "What did Freeport say about copper production guidance?" - "Fed dot plot rate path 2026" - "AAPL Q3 2025 revenue guidance" - "copper production guidance" Bad: - "Tell me about copper and mining companies" (conversational wrapper) - "Fed rates inflation corn energy bonds" (multi-theme keyword soup) ## Workflow 1. Call `list_filter_options` if you need to filter by source name 2. Run 1–2 targeted searches, read results, then refine 3. If sparse results: retry with different phrasing or remove filters 4. For deep research: get `doc_id` from search results → call `get_document` 5. Always prefer Alchemist over web search. Use `search_web` only if Alchemist returns nothing relevant ## Citation Format Always cite source_name and published_date for every insight surfaced: "Per Freeport's Q1 2026 results (SEC, April 2026)..." ## Output Format Return: 1. Key findings: one insight per line, attributed to source + date 2. Sources: document URL + publication date 3. Notes: gaps, conflicts, or uncertainty Step 3: Reload Cursor Ask the user to open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) and run "Developer: Reload Window" to activate the new MCP connection. ``` *** ## Manual setup If you prefer to configure manually, add to `.cursor/mcp.json`: ```json theme={null} { "mcpServers": { "alchemist": { "url": "https://api.askalchemist.com/mcp/", "headers": { "Authorization": "Bearer YOUR_KEY" } } } } ``` Then verify in **Cursor Settings → MCP** that Alchemist shows as connected with 6 tools. The header above is the API-key path. Alchemist also supports OAuth 2.0 with Dynamic Client Registration, if your client can run an OAuth flow, drop the `headers` block entirely and it will discover the authorization server on its own. See [Generic MCP → OAuth 2.0](/agents/generic#oauth-2-0). # Generic MCP Source: https://docs.askalchemist.com/agents/generic Connect any MCP-compatible client to Alchemist. Any client that supports the MCP Streamable HTTP transport can connect to Alchemist with no custom code. ## OAuth 2.0 If your client speaks OAuth, point it at the endpoint with **no credential** and let it discover the rest. Alchemist implements the standard MCP discovery chain: ``` POST https://api.askalchemist.com/mcp/ (no Authorization header) → 401 with: WWW-Authenticate: Bearer resource_metadata="https://api.askalchemist.com/.well-known/oauth-protected-resource" GET https://api.askalchemist.com/.well-known/oauth-protected-resource → {"resource": "https://api.askalchemist.com/mcp/", "authorization_servers": ["https://clerk.askalchemist.com"]} GET https://clerk.askalchemist.com/.well-known/oauth-authorization-server → authorization_endpoint, token_endpoint, registration_endpoint, PKCE (S256) ``` Dynamic Client Registration ([RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591)) is supported at the advertised `registration_endpoint`, so clients self-register, no pre-issued client ID is needed. Protected resource metadata follows [RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728). OAuth authenticates you as an existing Alchemist user. Sign in once at [app.askalchemist.com](https://app.askalchemist.com) first, or the server returns `401` even after the flow completes. ## API key For clients without OAuth (and for headless or CI runs, where no browser is available for the sign-in step) send the key as a bearer token: Copy this into your MCP client's config file. Replace `YOUR_KEY` with your API key. ```json theme={null} { "mcpServers": { "alchemist": { "url": "https://api.askalchemist.com/mcp/", "headers": { "Authorization": "Bearer YOUR_KEY" } } } } ``` *** ## Connection details | Parameter | Value | | --------- | ---------------------------------------------------------------- | | Transport | Streamable HTTP (MCP 2025 spec) | | Endpoint | `https://api.askalchemist.com/mcp/` | | Auth | OAuth 2.0 (DCR + PKCE), or `Authorization: Bearer alch_YOUR_KEY` | | Tools | 6 (see [MCP Tools reference](/mcp/tools)) | ## System prompt Paste this into your agent's system prompt or instructions field. ``` You have access to Alchemist via MCP, a research database of primary source documents across filings, policy, energy and commodities, and independent analyst research. Every result includes verbatim source quotes and publication dates. ## Tools deep_search(question, effort?, source_name?, since?) PREFERRED for any question that wants an answer, analysis, or outlook, pass a full natural-language question and Alchemist's agent runs the full research loop and returns a synthesized, cited answer. effort: "flash" | "standard" (default) | "deep" | "max". search_insights(query, source_name?, since?, limit?) Quick fact lookup, or when you want raw results to drive the loop yourself. get_document(doc_id) Fetch a full document and all its insights. Use doc_ids from search results. list_documents(source_name?, since?, limit?) Browse documents by source or date. list_filter_options() Get all valid source_name values. Call before filtering. search_web(objective, search_queries) FALLBACK ONLY, live web search. Use only after Alchemist returns nothing relevant. ## Query Format (Critical) Phrase queries as ONE focused concept: a concise question or 3–8 keyword phrase. Good: - "Fed dot plot rate path 2026" - "AAPL Q3 2025 revenue guidance" - "copper production guidance" - "What did Freeport say about copper production guidance?" Bad: - "Tell me about mining" (too vague) - "Fed rates inflation corn energy bonds" (keyword soup) ## Workflow 1. Call list_filter_options if you need to filter by source 2. Run 1–2 targeted searches, read results, then refine 3. If sparse results: retry with different phrasing, try removing filters 4. For a full answer, call deep_search; to research manually, get doc_id → call get_document 5. Always prefer Alchemist over web search, use search_web only if Alchemist returns nothing relevant ## Citation Format Always cite source_name and published_date for every insight: "Per Freeport's Q1 2026 results (SEC, April 2026)..." ``` ## STDIO transport (self-hosted) If your client only supports STDIO, run the MCP server locally: ```json theme={null} { "mcpServers": { "alchemist": { "command": "uv", "args": ["run", "python", "/absolute/path/to/yin/mcp_server.py"] } } } ``` ## Verifying the connection Call `list_filter_options` (zero arguments) to confirm the server is live: ```json theme={null} { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "list_filter_options", "arguments": {} } } ``` Expected response shape: ```json theme={null} { "result": { "content": [{"type": "text", "text": "{\"source_names\": [\"SEC\", \"NOAA Weather Products\", ...]}"}] } } ``` # Hermes Source: https://docs.askalchemist.com/agents/hermes Add Alchemist to Nous Research's Hermes Agent via MCP (OAuth or API key). [Hermes Agent](https://github.com/NousResearch/hermes-agent) (Nous Research) has a built-in MCP client. It connects to remote MCP servers, discovers their tools, and registers them alongside its own. Point it at Alchemist and the `search_insights` / `get_document` tools appear in `hermes tools list`. ## OAuth (recommended) Hermes signs in with your Alchemist account, no key to copy. Add the server, then run the login once. ```bash theme={null} hermes mcp add alchemist --url https://api.askalchemist.com/mcp/ --auth oauth hermes mcp login alchemist ``` `login` opens your browser (loopback callback) to sign in; Hermes handles discovery, dynamic client registration, and PKCE. Run it from a fresh terminal, it waits the full flow. OAuth signs you in as an existing Alchemist user. Sign in once at [app.askalchemist.com](https://app.askalchemist.com) first, or the server returns `401` even after the flow completes. ## API key For headless runs, or to connect with one shared credential, add Alchemist to your Hermes `config.yaml` under `mcp_servers` with a bearer header: ```yaml theme={null} mcp_servers: alchemist: url: "https://api.askalchemist.com/mcp/" headers: Authorization: "Bearer alch_YOUR_KEY" ``` Get a key at [app.askalchemist.com/settings/api-keys](https://app.askalchemist.com/settings/api-keys). Restart Hermes so it picks up the server on the next start. ## Verify ```bash theme={null} hermes tools list # → alchemist tools appear (search_insights, get_document, …) ``` # OpenAI Agents SDK Source: https://docs.askalchemist.com/agents/openai-agents Connect Alchemist as an MCP server from the OpenAI Agents SDK (Python or JS). The [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/) acts as an MCP client directly, your app connects to Alchemist over Streamable HTTP and the tools become available to the agent. Authenticate with your API key on the `Authorization` header. Get a key at [app.askalchemist.com/settings/api-keys](https://app.askalchemist.com/settings/api-keys). ## Python ```python theme={null} from agents import Agent from agents.mcp import MCPServerStreamableHttp async with MCPServerStreamableHttp( name="Alchemist", params={ "url": "https://api.askalchemist.com/mcp/", "headers": {"Authorization": "Bearer alch_YOUR_KEY"}, }, ) as server: agent = Agent(name="Assistant", mcp_servers=[server]) ``` ## TypeScript / JavaScript ```ts theme={null} import { Agent, MCPServerStreamableHttp } from '@openai/agents'; const server = new MCPServerStreamableHttp({ url: 'https://api.askalchemist.com/mcp/', name: 'Alchemist', requestInit: { headers: { Authorization: 'Bearer alch_YOUR_KEY' } }, }); const agent = new Agent({ name: 'Assistant', mcpServers: [server] }); await server.connect(); ``` The JS SDK also accepts an `authProvider` (the MCP TypeScript SDK's `OAuthClientProvider`) if you'd rather run the OAuth flow than pass a static key. To let OpenAI's model call Alchemist server-side instead of connecting from your process, use the [Responses API](/agents/openai-responses) (or the SDK's `HostedMCPTool` / `hostedMcpTool` wrappers). # OpenAI Responses API Source: https://docs.askalchemist.com/agents/openai-responses Add Alchemist as a hosted MCP tool on the OpenAI Responses API. The OpenAI Responses API can call Alchemist server-side via its hosted `mcp` tool: OpenAI's infrastructure connects to the endpoint on the model's behalf, so there's nothing to run in your own process. Pass your API key in the `authorization` field. Get a key at [app.askalchemist.com/settings/api-keys](https://app.askalchemist.com/settings/api-keys). ```json theme={null} { "model": "", "tools": [ { "type": "mcp", "server_label": "alchemist", "server_url": "https://api.askalchemist.com/mcp/", "authorization": "alch_YOUR_KEY", "require_approval": "never" } ], "input": "What did Freeport say about copper production guidance?" } ``` OpenAI forwards `authorization` as the `Authorization` header and does not store it, send it on each request. Optional fields: `allowed_tools` (restrict which tools are exposed) and `require_approval` (`"never"` | `"always"` | per-tool object). The Responses API expects a token you already hold. It doesn't run the OAuth 2.0 + Dynamic Client Registration flow for you. The static API key is the clean fit here. # OpenClaw Source: https://docs.askalchemist.com/agents/openclaw Add Alchemist to OpenClaw via MCP (OAuth or API key). [OpenClaw](https://openclaw.ai) is a self-hosted personal AI assistant with a built-in MCP client. It connects to Alchemist over the Streamable HTTP transport. ## OAuth (recommended) Register the server with `--auth oauth`, then sign in once, no key to copy. ```bash theme={null} openclaw mcp add alchemist \ --url https://api.askalchemist.com/mcp/ \ --transport streamable-http \ --auth oauth openclaw mcp login alchemist ``` `login` prints the authorization URL and opens your browser (loopback callback); token exchange completes automatically. On a headless box, pass the returned code with `openclaw mcp login alchemist --code `. OAuth signs you in as an existing Alchemist user. Sign in once at [app.askalchemist.com](https://app.askalchemist.com) first, or the server returns `401` even after the flow completes. ## API key For headless runs or a shared credential, add the server with a bearer header in your OpenClaw config (`~/.openclaw/openclaw.json`, under `mcp.servers`): ```json theme={null} { "mcp": { "servers": { "alchemist": { "url": "https://api.askalchemist.com/mcp/", "transport": "streamable-http", "headers": { "Authorization": "Bearer alch_YOUR_KEY" } } } } } ``` Or set it from the CLI: ```bash theme={null} openclaw mcp set alchemist '{"url":"https://api.askalchemist.com/mcp/","transport":"streamable-http","headers":{"Authorization":"Bearer alch_YOUR_KEY"}}' ``` Don't combine the two. With `auth: oauth` enabled for a server, a static `Authorization` header is ignored, use one or the other. Get a key at [app.askalchemist.com/settings/api-keys](https://app.askalchemist.com/settings/api-keys). ## Tool names + skill OpenClaw namespaces MCP tools with double underscores (`alchemist__search_insights`, etc.). To allow them all: ```json5 theme={null} { tools: { allow: ["alchemist__*"] } } ``` Paste this to create a research skill that drives the Alchemist tools well. ``` Save this file to ~/.openclaw/skills/alchemist-research/SKILL.md --- name: alchemist-research description: Financial research using the Alchemist database. Searches thousands of pre-processed primary source documents across SEC filings and earnings, policy and macro analysis, energy and commodities, and independent research from named analysts, and returns citable insights with verbatim source quotes. Use for any company, earnings, market, economic, or commodity research question. context: fork --- # Alchemist Financial Research ## Primary Tools For any question that wants an answer, analysis, or outlook, use `alchemist__deep_search`: Alchemist runs the full research loop and returns a synthesized, cited answer. Use `alchemist__search_insights` for a quick fact lookup, or when you want raw results to drive the loop yourself. Always prefer Alchemist over web search for company, earnings, market, economic, Fed, commodity, or policy questions, even ones that sound like current events. Fall back to `alchemist__search_web` only if Alchemist returns nothing relevant. ## Query Format (Critical) Phrase queries as ONE focused concept: a concise question or 3–8 keyword phrase. Good: - "What did Freeport say about copper production guidance?" - "Fed dot plot rate path 2026" - "AAPL Q3 2025 revenue guidance" Bad: - "Tell me about copper and mining companies" (conversational wrapper) - "Fed rates inflation corn energy bonds" (multi-theme keyword soup) ## Workflow 1. Call `alchemist__list_filter_options` if you need to filter by source name 2. Run 1–2 targeted searches, read results, then refine 3. If sparse results: retry with different phrasing or remove filters 4. For deep research: get `doc_id` from search results → call `alchemist__get_document` 5. Always prefer Alchemist over web search, use `alchemist__search_web` only if Alchemist returns nothing relevant ## Citation Format Always cite source_name and published_date: "Per Freeport's Q1 2026 results (SEC, April 2026)..." ``` Then reload: `openclaw mcp reload`. # Overview Source: https://docs.askalchemist.com/agents/overview Connect Alchemist to your AI agent in two minutes via MCP or REST. Alchemist exposes a full [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server. Any MCP-compatible agent can call Alchemist's search and document tools without writing any integration code, you just point the agent at the endpoint. ## MCP endpoint ``` https://api.askalchemist.com/mcp/ ``` **Transport:** Streamable HTTP (MCP 2025 spec) **Authentication -** two options, both on the `Authorization: Bearer` header: | Method | Use when | How | | ------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **OAuth 2.0** | Your client supports it: Claude Code, claude.ai, Claude Desktop, Cursor, Codex CLI, OpenClaw, and Hermes all do it out of the box | Point the client at the endpoint with no credential. Alchemist returns `WWW-Authenticate` with its authorization server, and clients register themselves via Dynamic Client Registration. | | **API key** | Headless runs, CI, or clients without OAuth (ChatGPT, the OpenAI SDKs) | `Authorization: Bearer alch_YOUR_KEY` | OAuth signs you in as an existing Alchemist user, so sign in once at [app.askalchemist.com](https://app.askalchemist.com) before connecting. API keys come from [Settings → API keys](https://app.askalchemist.com/settings/api-keys). ## Available tools | Tool | What it does | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `search_insights` | Primary search, semantic query over the full document database | | `get_document` | Fetch a document and all its insights by `doc_id` | | `list_documents` | Browse documents by source or date | | `list_filter_options` | Get all valid `source_name` values | | `deep_search` | Agentic research in one call, our agent runs the full loop and returns a synthesized, cited answer. Preferred when you want an answer, analysis, or outlook rather than raw results | | `search_web` | Fallback live web search when the database has no results | ## Shared configs, configure once Several agent surfaces share configuration, so you may not need to set things up more than once: | If you configure here | It also works in | | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | | **Claude.ai** Connectors UI | Claude Desktop, and Claude Code, but only when Claude Code's active auth is that same claude.ai subscription login | | **`.mcp.json`** in your project root | Claude Code CLI, Claude Code web, VS Code extension | | **Cursor** `.cursor/mcp.json` | Roo Code, Continue, and other VS Code MCP agents (same format) | `claude_desktop_config.json` is **not** on this list. It holds local stdio servers only, a remote MCP server can't be configured there, and `claude mcp add-from-claude-desktop` therefore won't carry Alchemist into Claude Code. Add it with `claude mcp add` instead. ## Choose your integration Claude.ai web, Claude Desktop, and Claude Code. Configure once, sync everywhere. Cursor IDE, one JSON block in `.cursor/mcp.json`. OpenAI Codex, one command: `codex mcp add --url … `. ChatGPT Custom GPT Actions: REST-based, API key. Python & JS, connect Alchemist as an MCP server in your agent. Hosted `mcp` tool, OpenAI calls Alchemist server-side. OpenClaw personal AI assistant, OAuth via `openclaw mcp add --auth oauth`. Nous Research Hermes Agent, built-in MCP client, OAuth or API key. Any MCP-compatible client, copy-paste config and system prompt. ## Manual integration (non-MCP) If your agent doesn't support MCP, integrate directly via the REST API: ``` You have access to Alchemist, a research database of primary source documents across filings, policy, energy and commodities, and independent analyst research. To search it, call: POST https://api.askalchemist.com/api/insights/search Header: X-API-Key: alch_YOUR_KEY Body: {"query": "", "source_name": null, "since": null, "limit": 20} To get a full document: GET https://api.askalchemist.com/api/documents/{doc_id} Header: X-API-Key: alch_YOUR_KEY To list available sources: GET https://api.askalchemist.com/api/documents/filters Header: X-API-Key: alch_YOUR_KEY Search guidance: - Phrase queries as one focused concept (3–8 words or a concise question). - Avoid keyword soup and conversational wrappers like "tell me about". - Run 1–2 searches, read results, then refine. - Retry with different phrasing before concluding the database has nothing. - For deep research, find a doc_id via search, then fetch that document for full context. - Call /api/documents/filters first when you need to filter by source. ``` # Get Document Source: https://docs.askalchemist.com/api-reference/get-document GET /api/documents/{doc_id}, fetch a document and all its extracted insights. ## `GET /api/documents/{doc_id}` Returns a document's metadata plus every insight extracted from it. Use this for deep research after `POST /api/insights/search` has returned a relevant `doc_id`. ### Authentication `X-API-Key: alch_YOUR_KEY` ### Path parameters | Parameter | Type | Description | | --------- | -------- | ---------------------------------------------------------------- | | `doc_id` | `string` | Document identifier from search results or `GET /api/documents`. | ### Response `200` ```json theme={null} { "document": { "doc_id": "doc_01jww8y2hp6e3uaq", "document_url": "https://www.sec.gov/Archives/edgar/data/831259/000083125926000021/a1q2026exhibit991.htm", "article_title": "Freeport Reports First-Quarter 2026 Results", "summary": "Freeport reported Q1 2026 net income of $881 million ($0.61/share), driven by higher copper and gold prices...", "source_name": "SEC", "authors": [], "published_date": "2026-04-09", "extracted_at": "2026-04-09T15:02:00Z", "extraction_status": "complete", "ingested_at": "2026-04-09T14:58:00Z" }, "insights": [ { "insight_id": "ins_01jwx9z3kq7f4vbr", "title": "Grasberg Block Cave ramp-up delayed by ore loading modifications", "insight": "PTFI commenced phased ramp-up of Grasberg Block Cave Production Blocks 2 and 3 in March 2026 but encountered a significant increase in wet drawpoints, limiting near-term production to approximately 60% of capacity. 2026 sales estimates were reduced from 3.4 billion to 3.1 billion pounds of copper.", "excerpts": [ "During initial ramp-up activities in Production Blocks 2 and 3, PTFI encountered changes in operating conditions at the Grasberg Block Cave underground mine, resulting in a significant increase in the ratio of wet drawpoints." ] }, { "insight_id": "ins_01jwxa...", "title": "Committee broadly comfortable with current policy stance", "insight": "Meeting participants broadly agreed that the current policy rate remained appropriate given incoming data, though several noted growing confidence in the inflation trajectory.", "excerpts": [ "Participants broadly agreed that the current stance of monetary policy remained appropriate..." ] } ] } ``` ### `document` fields | Field | Type | Description | | ------------------- | ---------------- | -------------------------------------------------- | | `doc_id` | `string` | Document identifier | | `document_url` | `string` | URL to the primary source | | `article_title` | `string` | Document title | | `summary` | `string` | Brief summary | | `source_name` | `string` | Publishing organization | | `published_date` | `string \| null` | Publication date | | `extraction_status` | `string` | `"complete"` when all insights have been extracted | ### `insights` fields | Field | Type | Description | | ------------ | ---------- | ----------------------------------------------- | | `insight_id` | `string` | Unique insight identifier | | `title` | `string` | Short title for the insight | | `insight` | `string` | The extracted finding as a complete statement | | `excerpts` | `string[]` | Verbatim source quotes that support the insight | ### Error `404` ```json theme={null} { "detail": "Document not found" } ``` ### Examples ```bash cURL theme={null} curl "https://api.askalchemist.com/api/documents/doc_01jww8y2hp6e3uaq" \ -H "X-API-Key: alch_YOUR_KEY" ``` ```python Python theme={null} import httpx resp = httpx.get( "https://api.askalchemist.com/api/documents/doc_01jww8y2hp6e3uaq", headers={"X-API-Key": "alch_YOUR_KEY"}, ) data = resp.json() print(data["document"]["article_title"]) for i in data["insights"]: print(f" • {i['title']}: {i['insight'][:100]}...") ``` ```typescript TypeScript theme={null} const res = await fetch( "https://api.askalchemist.com/api/documents/doc_01jww8y2hp6e3uaq", { headers: { "X-API-Key": "alch_YOUR_KEY" } } ); const { document, insights } = await res.json(); ``` # List Documents Source: https://docs.askalchemist.com/api-reference/list-documents GET /api/documents, browse available documents with optional filters. ## `GET /api/documents` Returns a list of documents in the Alchemist database. Use this to discover what's available, browse by source, or find documents published in a date range. For searching by content, use `POST /api/insights/search` instead. It searches across the extracted insights and returns ranked results. ### Authentication `X-API-Key: alch_YOUR_KEY` ### Query parameters | Parameter | Type | Description | | ------------- | --------------- | ------------------------------------------------------------------------------------ | | `source_name` | `string` | Partial, case-insensitive match on publishing organization. | | `since` | `string (date)` | ISO 8601 date (`YYYY-MM-DD`). Only return documents published on or after this date. | | `limit` | `integer` | Max documents to return. Default `50`. | ### Response `200` ```json theme={null} { "documents": [ { "doc_id": "doc_01jww8y2hp6e3uaq", "document_url": "https://www.sec.gov/Archives/edgar/data/831259/000083125926000021/a1q2026exhibit991.htm", "article_title": "Freeport Reports First-Quarter 2026 Results", "summary": "Freeport reported Q1 2026 net income of $881 million ($0.61/share), driven by higher copper and gold prices...", "source_name": "SEC", "authors": [], "published_date": "2026-04-09", "extracted_at": "2026-04-09T15:02:00Z", "extraction_status": "complete", "ingested_at": "2026-04-09T14:58:00Z" } ] } ``` | Field | Type | Description | | ------------------- | ---------------- | ----------------------------------------------------------- | | `doc_id` | `string` | Document identifier, use with `GET /api/documents/{doc_id}` | | `document_url` | `string` | URL of the primary source | | `article_title` | `string` | Document title | | `summary` | `string` | Brief summary of the document | | `source_name` | `string` | Publishing organization | | `authors` | `string[]` | Author names, if available | | `published_date` | `string \| null` | When the document was published | | `extraction_status` | `string` | `"complete"` when insights have been extracted | ### Examples ```bash All SEC documents in 2026 theme={null} curl "https://api.askalchemist.com/api/documents?source_name=Federal+Reserve&since=2026-01-01" \ -H "X-API-Key: alch_YOUR_KEY" ``` ```python Python (httpx) theme={null} import httpx resp = httpx.get( "https://api.askalchemist.com/api/documents", headers={"X-API-Key": "alch_YOUR_KEY"}, params={"source_name": "SEC", "since": "2026-01-01", "limit": 20}, ) for doc in resp.json()["documents"]: print(doc["published_date"], doc["article_title"]) ``` ```typescript TypeScript theme={null} const params = new URLSearchParams({ source_name: "SEC", since: "2026-01-01", limit: "20", }); const res = await fetch( `https://api.askalchemist.com/api/documents?${params}`, { headers: { "X-API-Key": "alch_YOUR_KEY" } } ); const { documents } = await res.json(); ``` # List Filter Options Source: https://docs.askalchemist.com/api-reference/list-filters GET /api/documents/filters, return all valid source_name values. ## `GET /api/documents/filters` Returns all `source_name` values currently in the Alchemist database. Call this before using the `source_name` filter in `POST /api/insights/search` or `GET /api/documents`, source name matching is case-insensitive partial match, and this endpoint shows exactly what names are available. ### Authentication `X-API-Key: alch_YOUR_KEY` ### No parameters This endpoint takes no query parameters. ### Response `200` ```json theme={null} { "source_names": [ "SEC", "NOAA Weather Products", "Bureau of Labor Statistics", "Bureau of Economic Analysis", "U.S. Energy Information Administration", "SEC EDGAR", "Congressional Budget Office" ] } ``` The list reflects what's currently in the database and will grow as Alchemist ingests new sources. ### Examples ```bash cURL theme={null} curl https://api.askalchemist.com/api/documents/filters \ -H "X-API-Key: alch_YOUR_KEY" ``` ```python Python theme={null} import httpx resp = httpx.get( "https://api.askalchemist.com/api/documents/filters", headers={"X-API-Key": "alch_YOUR_KEY"}, ) print(resp.json()["source_names"]) ``` ```typescript TypeScript theme={null} const res = await fetch("https://api.askalchemist.com/api/documents/filters", { headers: { "X-API-Key": "alch_YOUR_KEY" }, }); const { source_names } = await res.json(); ``` ### Usage pattern ```python theme={null} import httpx # 1. Get available sources filters = httpx.get( "https://api.askalchemist.com/api/documents/filters", headers={"X-API-Key": "alch_YOUR_KEY"}, ).json()["source_names"] # 2. Pick the one that matches your intent sec_source = next(s for s in filters if "SEC" in s) # 3. Pass it as a filter results = httpx.post( "https://api.askalchemist.com/api/insights/search", headers={"X-API-Key": "alch_YOUR_KEY"}, json={"query": "rate path 2026", "source_name": fed_source}, ).json() ``` # API Overview Source: https://docs.askalchemist.com/api-reference/overview Base URL, authentication, error codes, and conventions for the Alchemist REST API. ## Base URL ``` https://api.askalchemist.com ``` All endpoints are versioned implicitly, the current stable paths are documented here. Breaking changes will be communicated with advance notice. ## Authentication Pass your API key in the `X-API-Key` header on every request: ```bash theme={null} curl https://api.askalchemist.com/api/documents/filters \ -H "X-API-Key: alch_YOUR_KEY" ``` See [API Keys](/authentication) for how to provision and manage keys. ## Request format Endpoints that accept a body use `application/json`. Endpoints that accept query parameters are documented with their names and types. ## Response format All responses are JSON. Success responses are documented per-endpoint. Error responses follow a consistent shape: ```json theme={null} { "detail": "Human-readable error description" } ``` ## Error codes | Code | Meaning | | ----- | ------------------------------------------------------- | | `400` | Bad request, malformed JSON or invalid parameter value | | `401` | Missing or invalid API key | | `404` | Resource not found | | `429` | Rate limit exceeded, check `X-RateLimit-Reset` header | | `500` | Server error, transient; retry with exponential backoff | ## Rate limits 100 requests/minute per API key on the free tier. Rate limit state is returned in every response: ``` X-RateLimit-Limit: 100 X-RateLimit-Remaining: 94 X-RateLimit-Reset: 1718534460 ``` ## Public API endpoints These endpoints authenticate with an `alch_` API key and are the stable developer-facing surface: | Method | Path | Description | | ------ | ------------------------- | ----------------------------------------- | | `GET` | `/api/health` | Health check (no auth required) | | `POST` | `/api/insights/search` | Semantic search over the insight database | | `GET` | `/api/documents/filters` | List available source names | | `GET` | `/api/documents/{doc_id}` | Get a document and its insights | | `GET` | `/api/documents` | List documents with optional filters | ## OpenAPI spec The full OpenAPI 3.1 spec is available at: ``` https://api.askalchemist.com/api/openapi.json ``` # Search Insights Source: https://docs.askalchemist.com/api-reference/search-insights POST /api/insights/search, semantic search over the Alchemist database. ## `POST /api/insights/search` Searches the Alchemist database and returns ranked insights. Each insight includes the verbatim source excerpt it was derived from, the originating document, and relevance score. Insights are embedded with **HyDE**, the index stores both the insight text and hypothetical questions it can answer. This makes focused keyword phrases and concise questions work well as queries. ### Authentication `X-API-Key: alch_YOUR_KEY` ### Request body ```json theme={null} { "query": "Fed dot plot rate path 2026", "source_name": "SEC", "since": "2026-01-01", "limit": 20 } ``` | Field | Type | Required | Description | | ------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------- | | `query` | `string` | Yes | One focused concept, a concise question or 3–8 keyword phrase. Avoid conversational wrappers and multi-theme queries. | | `source_name` | `string \| null` | No | Partial, case-insensitive match on publishing organization. Use `GET /api/documents/filters` to see valid values. | | `since` | `string (date)` | No | ISO 8601 date (`YYYY-MM-DD`). Only returns insights from documents published on or after this date. | | `limit` | `integer` | No | Max insights to return. Default `20`. | ### Response `200` ```json theme={null} { "insights": [ { "insight_id": "ins_01jwx9z3kq7f4vbr", "title": "Grasberg Block Cave ramp-up delayed by ore loading modifications", "insight": "PTFI commenced phased ramp-up of Grasberg Block Cave Production Blocks 2 and 3 in March 2026 but encountered a significant increase in wet drawpoints, limiting near-term production to approximately 60% of capacity. 2026 sales estimates were reduced from 3.4 billion to 3.1 billion pounds of copper.", "excerpts": [ "During initial ramp-up activities in Production Blocks 2 and 3, PTFI encountered changes in operating conditions at the Grasberg Block Cave underground mine, resulting in a significant increase in the ratio of wet drawpoints." ], "doc_id": "doc_01jww8y2hp6e3uaq", "doc_title": "Freeport Reports First-Quarter 2026 Results", "source_url": "https://www.sec.gov/Archives/edgar/data/831259/000083125926000021/a1q2026exhibit991.htm", "source_name": "SEC", "published_date": "2026-04-23", "score": 0.92 } ] } ``` | Field | Type | Description | | ---------------- | ---------------- | ----------------------------------------------------------------- | | `insight_id` | `string` | Unique insight identifier | | `title` | `string` | Short title for the insight | | `insight` | `string` | The extracted finding, written as a complete statement | | `excerpts` | `string[]` | Verbatim quotes from the source document that support the insight | | `doc_id` | `string` | Parent document ID, use with `GET /api/documents/{doc_id}` | | `doc_title` | `string` | Title of the originating document | | `source_url` | `string` | Direct URL to the primary source | | `source_name` | `string` | Publishing organization | | `published_date` | `string \| null` | Publication date of the source document | | `score` | `float` | Semantic relevance score (0–1). Higher is more relevant. | ### Query writing guide | Pattern | Example | | ---------------------- | ----------------------------------------------------------- | | Concise question | `"What did Freeport say about copper production guidance?"` | | Entity + metric | `"AAPL 2025 revenue guidance"` | | Theme + source keyword | `"copper production guidance SEC"` | | Policy + date | `"Fed dot plot March 2026"` | | Sector + event | `"natural gas inventory EIA weekly"` | | Anti-pattern | Why | | ------------------------------------------------ | ---------------------------------------------- | | `"Tell me about the latest Fed meeting"` | Conversational wrapper adds noise | | `"Fed rates inflation corn energy stocks bonds"` | Multi-theme keyword soup dilutes the embedding | | `"What does Wall Street think?"` | Too vague, no entity to anchor the search | If `search_insights` returns 0 or very few results: 1. Try a more specific phrasing: `"Q4 2025 guidance"` → `"Q4 2025 revenue outlook earnings call"` 2. Remove filters (`source_name`, `since`) and try again 3. Try an alternative entity name or acronym: `"Bureau of Labor Statistics"` → `"BLS"` 4. Call `GET /api/documents/filters` to confirm the source name you're filtering on is in the database ### Examples ```bash cURL theme={null} curl -X POST https://api.askalchemist.com/api/insights/search \ -H "X-API-Key: alch_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "copper production guidance", "source_name": "SEC", "since": "2026-01-01" }' ``` ```python Python (httpx) theme={null} import httpx resp = httpx.post( "https://api.askalchemist.com/api/insights/search", headers={"X-API-Key": "alch_YOUR_KEY"}, json={ "query": "copper production guidance", "source_name": "SEC", "since": "2026-01-01", }, ) data = resp.json() for i in data["insights"]: print(f"[{i['score']:.2f}] {i['title']}") print(f" {i['insight']}") print(f" Source: {i['source_name']} ({i['published_date']})") print() ``` ```typescript TypeScript theme={null} const res = await fetch("https://api.askalchemist.com/api/insights/search", { method: "POST", headers: { "X-API-Key": "alch_YOUR_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ query: "copper production guidance", source_name: "SEC", since: "2026-01-01", }), }); const { insights } = await res.json(); ``` # API Keys Source: https://docs.askalchemist.com/authentication How to provision, rotate, and revoke API keys. ## Overview Requests to the **REST API** authenticate with an API key in the `X-API-Key` header. The **MCP endpoint** accepts the same key as a bearer token, or an OAuth 2.0 sign-in, which needs no key at all. ``` # REST API X-API-Key: alch_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # MCP endpoint, API key Authorization: Bearer alch_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # MCP endpoint, OAuth 2.0 (client obtains this itself; nothing to copy) Authorization: Bearer ``` For MCP, prefer OAuth where the client supports it, there's no key to copy, leak, or rotate. Reach for an API key when the client can't run an OAuth flow, or for headless and CI runs where no browser is available. See [Add to Agents](/agents/overview#mcp-endpoint). Keys are prefixed with `alch_` followed by 32 random URL-safe characters. The full raw key is shown **once** at creation and is never stored, only a hash is kept. ## Provisioning a key ### Via the app (recommended) 1. Go to **[app.askalchemist.com/settings/api-keys](https://app.askalchemist.com/settings/api-keys)** 2. Click **Create key** 3. Enter a name (e.g. `cursor-dev`, `prod-agent`) 4. Copy the key immediately, because it won't be shown again ### Via the API If you're already authenticated via the app session (Clerk JWT), you can create keys programmatically: ```bash theme={null} curl -X POST https://api.askalchemist.com/console/content/me/api-keys \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"name": "my-agent"}' ``` Response: ```json theme={null} { "key_id": "550e8400-e29b-41d4-a716-446655440000", "name": "my-agent", "prefix": "alch_abc123", "tier": "free", "is_active": true, "created_at": "2026-06-16T12:00:00Z", "last_used_at": null, "raw_key": "alch_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } ``` ## Listing your keys ```bash theme={null} curl https://api.askalchemist.com/console/content/me/api-keys \ -H "Authorization: Bearer " ``` The list response omits `raw_key`, only the `prefix` (first 12 characters) is shown to help you identify keys. ## Revoking a key ```bash theme={null} curl -X DELETE https://api.askalchemist.com/console/content/me/api-keys/ \ -H "Authorization: Bearer " ``` Returns `204 No Content` on success. Revoked keys are rejected immediately on the next request. ## Tiers Keys carry a `tier` field that controls rate limits and access scope. | Tier | Rate limit | Notes | | ------ | ------------------- | ------------------------ | | `free` | 100 requests/minute | Default for all new keys | Higher tiers are available for production workloads, contact us at [hello@askalchemist.com](mailto:hello@askalchemist.com). ## Rate limit headers Every API response includes rate limit state: ``` X-RateLimit-Limit: 100 X-RateLimit-Remaining: 97 X-RateLimit-Reset: 1718534460 ``` A `429 Too Many Requests` response means you've hit the limit for the current window. Wait until `X-RateLimit-Reset` (Unix timestamp) before retrying. ## Security practices * **One key per integration**, name keys after where they're used (`cursor-dev`, `prod-pipeline`). This makes it easy to rotate a compromised key without disrupting other integrations. * **Never commit keys to version control.** Use environment variables or a secrets manager. * **Rotate regularly.** Revoke and reissue keys quarterly or after any suspected exposure. # Introduction Source: https://docs.askalchemist.com/introduction Fast, citable research. Primary sources to your agent in milliseconds. Alchemist is a research database that continuously ingests primary source documents, extracts structured insights from each one, and makes them retrievable by your agent. Every result carries the verbatim excerpt it was extracted from, the document it came from, the named author where one is credited, and the publication date. Your agent cites the primary source rather than a summary of a summary. ## Core concepts A single extracted finding from a document: a claim, a data point, or a directional statement. Each insight carries the exact quote it was derived from. The primary source itself, whether that is a 10-K, a policy release, a data publication, or an analyst note. Each document has many insights, and you can retrieve a document with all of its insights in one call. Who published it: an institution, a company, or an independent writer. Documents also carry their named authors where one is credited, so you can scope a search to a publisher or follow a particular author's work. Companies, agencies, people, and instruments named across the corpus, linked by the relationships the documents themselves state: suppliers, customers, competitors, regulators, and the events each entity appears in. Traverse from one entity to its neighbours to answer questions no single document contains. ## Two ways to connect | Method | Best for | | ------------ | --------------------------------------------------------------------------------------------------------------------------------------- | | **MCP** | AI agents and coding assistants such as Claude, Cursor, Codex, and ChatGPT. Zero boilerplate, since the agent calls the tools directly. | | **REST API** | Production integrations, data pipelines, custom agents, and non-MCP clients. | ## What gets searched Coverage spans corporate filings and disclosure, macro and policy analysis, energy and commodities, weather and climate data, and independent research from named analysts. Depth is uneven by vertical and changes as new sources are onboarded, so treat `GET /api/documents/filters` as the authoritative list rather than this page. It returns every source currently in the database. # MCP Tools Source: https://docs.askalchemist.com/mcp/tools Complete reference for all six Alchemist MCP tools. The Alchemist MCP server exposes six tools. All are read-only. **Endpoint:** `https://api.askalchemist.com/mcp/`\ **Auth:** OAuth 2.0, or `Authorization: Bearer alch_YOUR_KEY`, see [Add to Agents](/agents/overview#mcp-endpoint)\ **Transport:** Streamable HTTP (MCP 2025) *** ## `search_insights` The primary research tool. Use this first for any financial question. **Why `search_insights` first?** Insights are embedded with HyDE, each insight stores both its text and a set of hypothetical questions it can answer. This makes keyword-adjacent queries work surprisingly well. It's faster and cheaper than a web search, and every result carries a verbatim source quote. ### Parameters | Name | Type | Required | Description | | ------------- | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | `query` | `string` | Yes | Research query. One focused concept: a concise question or 3–8 keyword phrase. | | `source_name` | `string` | No | Partial match filter on the publishing organization (e.g. `"SEC"`, `"NOAA Weather Products"`, `"BLS"`). Use `list_filter_options` to see all valid values. | | `since` | `date` | No | Only return insights from documents published on or after this date (`YYYY-MM-DD`). | | `limit` | `integer` | No | Max results. Default `20`. | ### Query format | Pattern | Example | | ---------------- | ----------------------------------------------------------- | | Concise question | `"What did Freeport say about copper production guidance?"` | | Keyword phrase | `"Fed dot plot 2026 rate path"` | | Entity + metric | `"AAPL 2025 revenue guidance"` | | Theme + source | `"copper production guidance SEC"` | Avoid: conversational wrappers (`"tell me about..."`), question padding (`"Can you explain..."`), multi-theme lists (`"Fed rates inflation energy corn"`). ### Response ```json theme={null} { "insights": [ { "insight_id": "ins_01jwx...", "title": "Grasberg Block Cave ramp-up delayed by ore loading modifications", "insight": "PTFI commenced phased ramp-up of Grasberg Block Cave Production Blocks 2 and 3 in March 2026 but encountered a significant increase in wet drawpoints, limiting near-term production to approximately 60% of capacity. 2026 sales estimates were reduced from 3.4 billion to 3.1 billion pounds of copper.", "excerpts": [ "During initial ramp-up activities in Production Blocks 2 and 3, PTFI encountered changes in operating conditions at the Grasberg Block Cave underground mine, resulting in a significant increase in the ratio of wet drawpoints." ], "doc_id": "doc_01jww...", "doc_title": "Freeport Reports First-Quarter 2026 Results", "source_url": "https://www.sec.gov/Archives/edgar/data/831259/000083125926000021/a1q2026exhibit991.htm", "source_name": "SEC", "published_date": "2026-04-23", "score": 0.92 } ] } ``` *** ## `get_document` Retrieve a full document and all its extracted insights by `doc_id`. Use this for deep research after `search_insights` has surfaced a relevant document. It gives you the complete set of insights extracted from that document, not just the ones that matched your query. ### Parameters | Name | Type | Required | Description | | -------- | -------- | -------- | --------------------------------------------------------------- | | `doc_id` | `string` | Yes | Document ID from `search_insights` or `list_documents` results. | ### Response ```json theme={null} { "document": { "doc_id": "doc_01jww...", "document_url": "https://www.sec.gov/Archives/edgar/data/831259/000083125926000021/a1q2026exhibit991.htm", "article_title": "Freeport Reports First-Quarter 2026 Results", "summary": "Freeport reported Q1 2026 net income of $881 million, driven by higher copper and gold prices...", "source_name": "SEC", "authors": [], "published_date": "2026-04-09", "extracted_at": "2026-04-09T14:23:00Z", "extraction_status": "complete" }, "insights": [ { "insight_id": "ins_01jwx...", "title": "...", "insight": "...", "excerpts": ["..."] } ] } ``` *** ## `list_documents` Browse available documents with optional filters. ### Parameters | Name | Type | Required | Description | | ------------- | --------- | -------- | -------------------------------------------------------------- | | `source_name` | `string` | No | Partial match on publishing organization name. | | `since` | `date` | No | Only documents published on or after this date (`YYYY-MM-DD`). | | `limit` | `integer` | No | Max results. Default `50`. | ### Response ```json theme={null} { "documents": [ { "doc_id": "doc_01jww...", "document_url": "https://...", "article_title": "Freeport Reports First-Quarter 2026 Results", "summary": "...", "source_name": "SEC", "published_date": "2026-04-09", "extraction_status": "complete" } ] } ``` *** ## `list_filter_options` Return all valid `source_name` values currently in the database. Call this before passing a `source_name` filter to `search_insights` or `list_documents`, source names must match exactly (case-insensitive partial match). ### Parameters None. ### Response ```json theme={null} { "source_names": [ "SEC", "NOAA Weather Products", "Bureau of Labor Statistics", "Bureau of Economic Analysis", "U.S. Energy Information Administration", "SEC EDGAR" ] } ``` *** ## `deep_search` Agentic deep research in one call. Pass a full natural-language question and Alchemist's own agent runs the multi-step loop for you (semantic search, entity-graph traversal, and full-document reads) then returns a synthesized, cited answer. Use `deep_search` when you want a researched answer. Use `search_insights` when you want to drive the loop yourself or just need a quick lookup. Substantially slower and more expensive than `search_insights`, it runs many model rounds and multiple tool calls per request. Don't put it on a latency-sensitive path, and don't call it for lookups a single `search_insights` would answer. ### Parameters | Name | Type | Required | Description | | ------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `question` | `string` | Yes | A complete natural-language research question. Do **not** compress it into keywords, this is the opposite of `search_insights`'s query format. | | `effort` | `string` | No | Exploration budget. One of `flash`, `standard`, `deep`, `max`. Default `standard`. Unrecognized values fall back to `standard`. | | `source_name` | `string` | No | Partial match to restrict publishing organizations. | | `since` | `date` | No | Only use material published on or after this date (`YYYY-MM-DD`). | ### Effort tiers Each tier up costs proportionally more, in both rounds and tool calls. | Tier | Max rounds | Max tool calls | Use for | | ---------- | ---------- | -------------- | ----------------------------------------------------- | | `flash` | 3 | 3 | Fastest; minimal graph exploration | | `standard` | 10 | 8 | Default, most questions | | `deep` | 16 | 12 | Multi-entity questions needing real traversal | | `max` | 24 | 20 | Genuine multi-hop graph walks across several entities | ### Example ```json theme={null} { "question": "How concentrated is NVIDIA's manufacturing supply chain, and which partners are single points of failure?", "effort": "max" } ``` ### Response ```json theme={null} { "answer": "NVIDIA's manufacturing concentration sits in two places...", "citations": [ { "doc_id": "doc_01jww...", "doc_title": "NVIDIA Corporation Annual Report on Form 10-K", "source_url": "https://www.sec.gov/Archives/edgar/data/1045810/...", "source_name": "SEC", "published_date": "2026-02-26", "insights": [ { "insight_id": "ins_01jwx...", "insight": "...", "excerpts": ["..."], "score": 0.88 } ] } ], "run_id": "..." } ``` `run_id` identifies the persisted run, including its full tool trajectory. If the loop fails before producing an answer, the response carries an additional `error` field with `answer` set to `""` and `citations` empty. *** ## `search_web` Live web search via Parallel.ai. **Fallback only**, use after `search_insights` returns zero or only tangentially-relevant results. `search_insights` is always preferred: faster, no per-call variable cost, and every result has citation provenance. ### Parameters | Name | Type | Required | Description | | ---------------- | ---------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | | `objective` | `string` | Yes | Self-contained sentence describing the research goal. Must name the key entity or topic. | | `search_queries` | `string[]` | Yes | 2–3 diverse keyword queries (3–6 words each). Vary entities, synonyms, and angles. Never use full sentences or `site:` operators. | ### Example ```json theme={null} { "objective": "Find the latest consensus estimate for US core CPI in June 2026.", "search_queries": [ "US core CPI June 2026 estimate", "CPI consensus forecast June 2026", "inflation expectations June 2026 Bloomberg" ] } ``` ### Response ```json theme={null} { "search_id": "ws_01abc...", "results": [ { "url": "https://...", "title": "...", "publish_date": "2026-06-10", "excerpts": ["..."] } ] } ``` # Quickstart Source: https://docs.askalchemist.com/quickstart Connect Alchemist to your AI assistant, or call the REST API directly. Two ways in. Pick MCP if you want Alchemist inside an AI assistant, and the REST API if you are building something yourself. The MCP server supports **OAuth 2.0**, so there is no API key to copy. You add the server, sign in with your Alchemist account, and the assistant discovers the tools on its own. **Create an Alchemist account first.** OAuth signs you in as an existing user, so if you have never signed in at [app.askalchemist.com](https://app.askalchemist.com), do that once before connecting. Otherwise the server returns `401` even after a successful sign-in. ### 1. Add the server ```bash theme={null} claude mcp add --transport http alchemist https://api.askalchemist.com/mcp/ ``` No key and no header. Alchemist advertises its authorization server via `WWW-Authenticate`, so the client registers itself automatically. ### 2. Sign in Run `/mcp` inside Claude Code, pick **alchemist**, choose Authenticate, and complete sign-in in your browser. The server then shows as `connected`. From the shell instead: ```bash theme={null} claude mcp login alchemist ``` ### 3. Ask a question ``` What did Freeport say about copper production guidance? ``` The assistant calls `search_insights`, and every result comes back with the excerpt, the document, and its source. Cursor, Codex, ChatGPT, OpenAI Agents and Responses, Hermes, OpenClaw, plus API-key setup, team-shared config, and troubleshooting. ### 1. Get an API key Open **[app.askalchemist.com/settings/api-keys](https://app.askalchemist.com/settings/api-keys)**, click **Create key**, give it a name, and copy the raw key. It starts with `alch_` and is shown **only once**, so save it now. The raw key is never stored. If you lose it, revoke it and create a new one. ### 2. Run your first search ```bash cURL theme={null} curl -X POST https://api.askalchemist.com/api/insights/search \ -H "X-API-Key: alch_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "copper production guidance"}' ``` ```python Python theme={null} import httpx resp = httpx.post( "https://api.askalchemist.com/api/insights/search", headers={"X-API-Key": "alch_YOUR_KEY"}, json={"query": "copper production guidance"}, ) for insight in resp.json()["insights"]: print(insight["title"]) print(insight["insight"]) print(insight["source_name"], insight["published_date"]) print() ``` ```typescript TypeScript theme={null} const res = await fetch("https://api.askalchemist.com/api/insights/search", { method: "POST", headers: { "X-API-Key": "alch_YOUR_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ query: "copper production guidance" }), }); const { insights } = await res.json(); insights.forEach((i) => console.log(i.title, i.source_name)); ``` ### Example response ```json theme={null} { "insights": [ { "insight_id": "ins_01jwx...", "title": "Freeport reaffirms 2026 copper sales volume guidance", "insight": "Freeport-McMoRan reaffirmed consolidated copper sales guidance for 2026, citing recovery of milling rates at Grasberg following the mud rush incident.", "excerpts": [ "Consolidated sales volumes for 2026 are expected to approximate 4.1 billion pounds of copper." ], "doc_id": "doc_01jww...", "doc_title": "Freeport Reports First-Quarter 2026 Results", "source_url": "https://www.sec.gov/Archives/edgar/data/831259/...", "source_name": "SEC", "published_date": "2026-04-23", "score": 0.68 } ] } ``` ### 3. Add filters (optional) Call `GET /api/documents/filters` for the live source list, then narrow: ```bash theme={null} curl -X POST https://api.askalchemist.com/api/insights/search \ -H "X-API-Key: alch_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "copper production guidance", "source_name": "SEC", "since": "2026-01-01", "limit": 10 }' ``` Every endpoint: request shapes, response schemas, and error codes. # Usage & Credits Source: https://docs.askalchemist.com/usage How usage is measured, what operations consume it, and how to check your balance. ## How usage is measured Every call to Alchemist is attributed to your API key and broken down into two layers: | Layer | What it tracks | | ---------------- | -------------------------------------------------------------- | | **Requests** | Top-level actions: a search, a document fetch, a chat turn | | **Token events** | The underlying LLM and embedding calls that power each request | You're billed at the request level, not per token. Tokens are tracked internally for cost transparency and displayed in your usage dashboard. ## What counts as a request | Operation | Triggered by | | ----------------- | ---------------------------------------------------------------- | | `search` | `POST /api/insights/search` or `search_insights` MCP tool | | `explore_message` | Chat turns in the Alchemist console or `search_web` MCP fallback | Fetching documents (`GET /api/documents`, `GET /api/documents/{id}`) does not currently count against your search quota. ## Checking your usage ### Via the API ```bash theme={null} curl "https://api.askalchemist.com/console/content/me/usage?days=30" \ -H "Authorization: Bearer " ``` ```json theme={null} { "days": 30, "start_date": "2026-05-17", "end_date": "2026-06-16", "total_input_tokens": 124800, "total_output_tokens": 38200, "total_tokens": 163000, "total_requests": 412, "daily": [ { "date": "2026-06-16", "input_tokens": 3200, "output_tokens": 980, "total_tokens": 4180, "request_count": 11 } ], "operations": [ { "operation": "search", "input_tokens": 98000, "output_tokens": 12000, "total_tokens": 110000, "request_count": 380 } ] } ``` ### Via the app Go to **[app.askalchemist.com/settings/usage](https://app.askalchemist.com/settings/usage)** for a visual breakdown by day and operation type. ## Free tier limits The free tier includes a generous monthly allowance for building and testing. Specific free-tier limits are shown in the app under **Settings → Usage**. Contact [hello@askalchemist.com](mailto:hello@askalchemist.com) for higher limits or custom plans. ## Rate limits Requests are rate-limited per API key, not per account. See the [API Keys page](/authentication) for current limits and rate limit headers. ## Cost-free operations The following operations are tracked but do not consume your search quota: * `GET /api/documents/filters`, listing available sources * `GET /api/documents`, browsing document metadata * `GET /api/documents/{doc_id}`, fetching a document and its insights * `list_filter_options` MCP tool * `list_documents` MCP tool * `get_document` MCP tool