> ## Documentation Index
> Fetch the complete documentation index at: https://c-mass.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Introduction to c-mass API and its capabilities

<Note>
  This documentation provides a comprehensive guide on how to purchase carbon credits and offset emissions seamlessly using the c-mass API.
</Note>

## Welcome to the c-mass API

The c-mass API enables businesses to easily integrate carbon credit purchases into their operations, covering various activities such as transportation, logistics, and more.

## API Endpoint

The base URL for this API version is: `https://carbon-engine.onrender.com/v1`

All endpoints referenced in this documentation are relative to this base URL.

***

## Authentication

To access the API, clients must authenticate using their c-mass API Key by including it in the `Authorization` header.

* If an invalid API key is provided, the API will return a **401 Unauthorized** error.
* Use the **test API key** for test requests and the **live API key** for production requests.

### Test Mode

c-mass offers a **Test Mode** that allows users to explore API functionalities without incurring charges or purchasing real carbon credits.

* Toggle Test Mode via the web dashboard.
* The same API endpoints are used for both test and live modes, but a test API key must be provided.
* API keys (both test and live) can be generated from the **Devs page**.

***

## Rate Limiting

To maintain system stability, c-mass API enforces rate limits:

* **100 write operations per second**
* **100 read operations per second**
* Requests exceeding these limits will return a **429 Too Many Requests** response.

**Recommendation:** Implement a **retry mechanism with exponential backoff** to handle rate limits efficiently.

***

## Error Handling

The c-mass API uses standard HTTP status codes to indicate the success or failure of a request.

| Status Code | Error                | Description                                      |
| ----------- | -------------------- | ------------------------------------------------ |
| **400**     | Bad Request          | The request parameters are invalid.              |
| **401**     | Unauthorized         | API key is missing or invalid.                   |
| **403**     | Forbidden            | Action is not permitted.                         |
| **409**     | Conflict             | Idempotency conflict detected.                   |
| **422**     | Unprocessable Entity | Idempotency key used with a different payload.   |
| **429**     | Too Many Requests    | API rate limit exceeded.                         |
| **503**     | Service Unavailable  | Temporary server issue, retry the request later. |

For more details, refer to the specific API endpoint documentation.

***
