> For the complete documentation index, see [llms.txt](https://tri.gitbook.io/tri-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tri.gitbook.io/tri-doc/liquidity-pool/carbon-equivalent-reporting/ai-compute/get-ai-compute-estimation-co2.md).

# Get AI Compute Estimation CO2

### Liquidity Pool

<mark style="color:green;">`POST`</mark> <https://sandbox.triangle.digital/api/v2/liquidity\\_pool/ai\\_compute/estimation>

CO<sub>2</sub>e of one AI generation, from the provider, the model and the number of output tokens generated — the same calculation an [AI Compute expense line](/tri-doc/liquidity-pool/create-invoice.md) of an invoice is given.

**Headers**

<table data-full-width="true"><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr></tbody></table>

**Body**

<table data-full-width="true" data-search="false"><thead><tr><th width="220">Name</th><th width="110">Type</th><th>Description</th><th width="250">Example</th></tr></thead><tbody><tr><td><code>hash</code></td><td>string</td><td><strong>Required.</strong> API key.</td><td>fk5f0iuy-rr06-j4x3-i75b-fy2s67s4ilo1</td></tr><tr><td><code>provider</code></td><td>string</td><td><strong>Required.</strong> Identifier of the AI provider — a <code>value</code> of <a href="/tri-doc/liquidity-pool/carbon-equivalent-reporting/ai-compute/get-ai-compute-providers.md">Get AI Compute Providers</a>.</td><td>anthropic</td></tr><tr><td><code>model_name</code></td><td>string</td><td><strong>Required.</strong> Model of that provider — a value of <a href="/tri-doc/liquidity-pool/carbon-equivalent-reporting/ai-compute/get-ai-compute-models.md">Get AI Compute Models</a>. A model belonging to another provider is refused.</td><td>claude-opus-4-20250514</td></tr><tr><td><code>output_token_count</code></td><td>integer</td><td><strong>Required.</strong> Number of output tokens generated — a positive whole number.</td><td>1324345</td></tr></tbody></table>

{% code fullWidth="false" %}

```json
{
    "hash": "fk5f0iuy-rr06-j4x3-i75b-fy2s67s4ilo1",
    "provider": "anthropic",
    "model_name": "claude-opus-4-20250514",
    "output_token_count": 1324345
}
```

{% endcode %}

**Response fields**

<table data-full-width="true" data-search="false"><thead><tr><th width="230">Field</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>message</code></td><td>string</td><td>Human-readable result of the call.</td></tr><tr><td><code>success</code></td><td>boolean</td><td>Whether the call succeeded; a failed call answers HTTP 400.</td></tr><tr><td><code>data.co2</code></td><td>number</td><td>Metric tons of CO<sub>2</sub>e, rounded to four decimals — the value an AI Compute expense line of this generation stores. A generation under 0.00005 tons answers <code>0.0</code>.</td></tr><tr><td><code>data.co2_kg</code></td><td>number</td><td>The same figure in kilograms, unrounded.</td></tr><tr><td><code>operations_count</code></td><td>integer</td><td>Always <code>1</code>.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}
{% code fullWidth="false" %}

```json
{
    "message": "Data received successfully.",
    "success": true,
    "data": {
        "co2": 0.0166,
        "co2_kg": 16.583488122318094
    },
    "operations_count": 1
}
```

{% endcode %}
{% endtab %}

{% tab title="400" %}
The hash is unknown, a required parameter is missing, `output_token_count` is not a positive whole number, or the model does not belong to the provider; the message says what exactly.

```json
{
    "message": "Could not find model `gpt-4o` for anthropic provider.",
    "success": false,
    "data": {}
}
```

{% endtab %}
{% endtabs %}
