AI Integrations Guide
Plug EcoTrace into your favorite AI assistants and calculate the environmental impact of any recipe without ever leaving the chat. New to EcoStrain? See how scores are calculated.
โก Before You Start
Every integration below requires an EcoTrace API Key. If you don't have one yet:
- Sign in with Google on the EcoTrace website.
- Open your Settings โ API & Integrations tab.
- Click "Generate New API Key" and save it somewhere safe. You will only see it once!
Claude (Anthropic)
Connect via Model Context Protocol (MCP)
Claude Desktop natively supports MCP. EcoTrace runs a hosted MCP server -- add it by URL, nothing to download or install.
mcp-remote bridges Claude Desktop to the remote server below -- confirmed working. (Claude Desktop's own native url-based remote-server support didn't connect reliably as of this writing; this sidesteps that.)
- Open your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json
- Add the EcoTrace server entry:
{ "mcpServers": { "ecotrace": { "command": "npx", "args": ["-y", "mcp-remote", "https://useecotrace.com/mcp"], "headers": { "x-api-key": "eco_YOUR_KEY_HERE" } } } }
- Restart Claude Desktop completely (quit & reopen).
- Look for the ๐จ tool icon in the chat bar. Ask Claude: "Score the EcoTrace impact of a classic beef lasagna recipe and suggest greener alternatives."
ChatGPT (OpenAI)
Connect via Custom GPT Actions · No local install
ChatGPT uses Custom GPT Actions (an OpenAPI schema) to call external APIs. Because EcoTrace exposes a standard REST endpoint, you can wire it up in minutes โ no servers required.
- Open chatgpt.com, click Explore GPTs โ Create.
- In the Configure tab, name your GPT (e.g. "EcoTrace Assistant") and give it instructions like: "You help users understand the environmental impact of recipes. Use the EcoTrace API to score any recipe the user provides."
- Scroll down, click Create new action, and paste this schema:
openapi: 3.1.0 info: title: EcoTrace API version: 1.0.0 description: Calculate the EcoStrain score of recipes. servers: - url: https://useecotrace.com/api/v1 paths: /analyze: post: summary: Score a recipe's environmental impact operationId: scoreRecipe requestBody: required: true content: application/json: schema: type: object properties: inputMode: type: string enum: [url, text, ingredients] description: How the recipe is provided url: type: string description: URL of the recipe (when inputMode is url) text: type: string description: Full recipe text or ingredients list required: [inputMode] responses: "200": description: Scoring result with breakdown
- Click the โ๏ธ Authentication gear. Choose API Key, Auth Type โ Custom, Header Name โ
x-api-key. Paste your key. - Save & Test: In the preview, try: "Score this recipe: https://www.allrecipes.com/recipe/12345"
- Once satisfied, click Publish to the GPT Store so others can use it too!
Google Gemini
Connect via Gemini Extensions / Google AI Studio
Gemini supports external API calls through Extensions in Google AI Studio and through Function Calling in the Gemini API.
- Open Google AI Studio and create a new chat prompt.
- In the Tools panel, select Function Declarations and add a function:
{ "name": "scoreRecipe", "description": "Calculate the environmental EcoStrain score of a recipe", "parameters": { "type": "object", "properties": { "inputMode": { "type": "string", "enum": ["url", "text", "ingredients"], "description": "How the recipe is provided" }, "url": { "type": "string", "description": "URL of the recipe" }, "text": { "type": "string", "description": "Full recipe text or ingredients list" } }, "required": ["inputMode"] } }
- When Gemini calls the function, your application code should make a
POSTrequest to the EcoTrace API (see the API Reference below) and return the result. - For production apps using the Gemini SDK, register the function declaration and handle the tool call in your backend, forwarding to
https://useecotrace.com/api/v1/analyzewith thex-api-keyheader.
Microsoft Copilot
Connect via Copilot Studio Actions / Plugins
Microsoft Copilot (and Copilot Studio) supports connecting external APIs through Actions and Plugins using the same OpenAPI specification format as ChatGPT.
- Open Copilot Studio and create or edit a copilot agent.
- Go to Actions โ Add an action โ OpenAPI.
- Paste the same OpenAPI schema shown in the ChatGPT section above (or upload it as a
.yamlfile). - Under Authentication, choose API Key and set the header to
x-api-keywith your EcoTrace key. - Save, test, and publish your Copilot agent.
REST API Reference
For any app, script, or AI platform
Use the EcoTrace API directly from any language or platform. All you need is an HTTP client and your API key.
Endpoint
Headers
| Header | Value |
|---|---|
Content-Type | application/json |
x-api-key | Your EcoTrace API key |
Request Body
| Field | Type | Description |
|---|---|---|
inputMode | string | "url", "text", or "ingredients" |
url | string | Recipe URL (when inputMode is "url") |
text | string | Full recipe text or ingredient list |
Example (cURL)
Example (JavaScript / fetch)
Ready to get started?