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.

๐Ÿค– Claude ๐Ÿ’ฌ ChatGPT โœจ Gemini ๐Ÿง‘โ€๐Ÿ’ป Copilot ๐Ÿ”Œ REST API

โšก Before You Start

Every integration below requires an EcoTrace API Key. If you don't have one yet:

  1. Sign in with Google on the EcoTrace website.
  2. Open your Settings โ†’ API & Integrations tab.
  3. 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.)

  1. Open your Claude Desktop config file:
    macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. 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" } } } }
  3. Restart Claude Desktop completely (quit & reopen).
  4. 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.

  1. Open chatgpt.com, click Explore GPTs โ†’ Create.
  2. 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."
  3. 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
  4. Click the โš™๏ธ Authentication gear. Choose API Key, Auth Type โ†’ Custom, Header Name โ†’ x-api-key. Paste your key.
  5. Save & Test: In the preview, try: "Score this recipe: https://www.allrecipes.com/recipe/12345"
  6. 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.

  1. Open Google AI Studio and create a new chat prompt.
  2. 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"] } }
  3. When Gemini calls the function, your application code should make a POST request to the EcoTrace API (see the API Reference below) and return the result.
  4. 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/analyze with the x-api-key header.

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.

  1. Open Copilot Studio and create or edit a copilot agent.
  2. Go to Actions โ†’ Add an action โ†’ OpenAPI.
  3. Paste the same OpenAPI schema shown in the ChatGPT section above (or upload it as a .yaml file).
  4. Under Authentication, choose API Key and set the header to x-api-key with your EcoTrace key.
  5. 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

POST https://useecotrace.com/api/v1/analyze

Headers

HeaderValue
Content-Typeapplication/json
x-api-keyYour EcoTrace API key

Request Body

FieldTypeDescription
inputModestring"url", "text", or "ingredients"
urlstringRecipe URL (when inputMode is "url")
textstringFull recipe text or ingredient list

Example (cURL)

curl -X POST https://useecotrace.com/api/v1/analyze \ -H "Content-Type: application/json" \ -H "x-api-key: eco_YOUR_KEY_HERE" \ -d '{ "inputMode": "url", "url": "https://www.allrecipes.com/recipe/12345" }'

Example (JavaScript / fetch)

const response = await fetch( 'https://useecotrace.com/api/v1/analyze', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': 'eco_YOUR_KEY_HERE' }, body: JSON.stringify({ inputMode: 'ingredients', text: '2 cups flour\n3 eggs\n1 cup sugar' }) } ); const data = await response.json(); console.log(data.sustainability_score);

Ready to get started?

Generate Your API Key Score a Meal