CodeCarbon Experiments API

The Experiments API from CodeCarbon — 4 operation(s) for experiments.

GitHub OpenAPI

Operations 4

POST /experiments Add Experiment #
GET /experiments/{experiment_id} Read Experiment #
GET /projects/{project_id}/experiments Read Project Experiments #
GET /projects/{project_id}/experiments/sums Read Project Detailed Sums By Experiment #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/codecarbon:codecarbon-experiments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

codecarbon-experiments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Codecarbon Experiments API
  version: 0.1.0
  x-refined-note:
  - x-original-title differs across the merged source definitions and was not carried
  description: 'Operations tagged Experiments across 2 of this provider''s published API definitions: codecarbon-openapi.json, codecarbon-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: /api/
- url: https://api.codecarbon.io/api
  description: Resolved from the relative server /api/ as served at https://api.codecarbon.io/openapi.json
tags:
- name: Experiments
paths:
  /experiments:
    post:
      tags:
      - Experiments
      summary: Add Experiment
      operationId: add_experiment_experiments_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExperimentCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - APIKeyCookie: []
      - HTTPBearer: []
    servers:
    - url: /api/
  /experiments/{experiment_id}:
    get:
      tags:
      - Experiments
      summary: Read Experiment
      operationId: read_experiment_experiments__experiment_id__get
      security:
      - APIKeyCookie: []
      - HTTPBearer: []
      parameters:
      - name: experiment_id
        in: path
        required: true
        schema:
          type: string
          title: Experiment Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    servers:
    - url: /api/
  /projects/{project_id}/experiments:
    get:
      tags:
      - Experiments
      summary: Read Project Experiments
      operationId: read_project_experiments_projects__project_id__experiments_get
      security:
      - APIKeyCookie: []
      - HTTPBearer: []
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          title: Project Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Experiment'
                title: Response Read Project Experiments Projects  Project Id  Experiments Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    servers:
    - url: /api/
  /projects/{project_id}/experiments/sums:
    get:
      tags:
      - Experiments
      summary: Read Project Detailed Sums By Experiment
      operationId: read_project_detailed_sums_by_experiment_projects__project_id__experiments_sums_get
      security:
      - APIKeyCookie: []
      - HTTPBearer: []
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          title: Project Id
      - name: start_date
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Start Date
      - name: end_date
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: End Date
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExperimentReport'
                title: Response Read Project Detailed Sums By Experiment Projects  Project Id  Experiments Sums Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    servers:
    - url: /api/
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Experiment:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        country_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Country Name
        country_iso_code:
          anyOf:
          - type: string
          - type: 'null'
          title: Country Iso Code
        region:
          anyOf:
          - type: string
          - type: 'null'
          title: Region
        on_cloud:
          anyOf:
          - type: boolean
          - type: 'null'
          title: On Cloud
        cloud_provider:
          anyOf:
          - type: string
          - type: 'null'
          title: Cloud Provider
        cloud_region:
          anyOf:
          - type: string
          - type: 'null'
          title: Cloud Region
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        project_id:
          type: string
          format: uuid
          title: Project Id
        id:
          type: string
          format: uuid
          title: Id
      type: object
      required:
      - name
      - description
      - timestamp
      - project_id
      - id
      title: Experiment
      example:
        cloud_provider: aws
        cloud_region: eu-west-1a
        country_iso_code: FRA
        country_name: France
        description: AWS API for Code Carbon
        name: Run on AWS
        on_cloud: true
        project_id: 8edb03e1-9a28-452a-9c93-a3b6560136d7
        region: france
        timestamp: '2021-04-04T08:43:00+02:00'
    ExperimentCreate:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        country_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Country Name
        country_iso_code:
          anyOf:
          - type: string
          - type: 'null'
          title: Country Iso Code
        region:
          anyOf:
          - type: string
          - type: 'null'
          title: Region
        on_cloud:
          anyOf:
          - type: boolean
          - type: 'null'
          title: On Cloud
        cloud_provider:
          anyOf:
          - type: string
          - type: 'null'
          title: Cloud Provider
        cloud_region:
          anyOf:
          - type: string
          - type: 'null'
          title: Cloud Region
        timestamp:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Timestamp
        project_id:
          type: string
          format: uuid
          title: Project Id
      type: object
      required:
      - name
      - description
      - project_id
      title: ExperimentCreate
      example:
        cloud_provider: aws
        cloud_region: eu-west-1a
        country_iso_code: FRA
        country_name: France
        description: AWS API for Code Carbon
        name: Run on AWS
        on_cloud: true
        project_id: 8edb03e1-9a28-452a-9c93-a3b6560136d7
        region: france
        timestamp: '2021-04-04T08:43:00+02:00'
    ExperimentReport:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        country_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Country Name
        country_iso_code:
          anyOf:
          - type: string
          - type: 'null'
          title: Country Iso Code
        region:
          anyOf:
          - type: string
          - type: 'null'
          title: Region
        on_cloud:
          anyOf:
          - type: boolean
          - type: 'null'
          title: On Cloud
        cloud_provider:
          anyOf:
          - type: string
          - type: 'null'
          title: Cloud Provider
        cloud_region:
          anyOf:
          - type: string
          - type: 'null'
          title: Cloud Region
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        project_id:
          type: string
          format: uuid
          title: Project Id
        experiment_id:
          type: string
          format: uuid
          title: Experiment Id
        emissions:
          type: number
          title: Emissions
        cpu_power:
          type: number
          title: Cpu Power
        gpu_power:
          type: number
          title: Gpu Power
        ram_power:
          type: number
          title: Ram Power
        cpu_energy:
          type: number
          title: Cpu Energy
        gpu_energy:
          type: number
          title: Gpu Energy
        ram_energy:
          type: number
          title: Ram Energy
        energy_consumed:
          type: number
          title: Energy Consumed
        duration:
          type: number
          title: Duration
        emissions_rate:
          type: number
          title: Emissions Rate
        emissions_count:
          type: integer
          title: Emissions Count
        cpu_utilization_percent:
          anyOf:
          - type: number
          - type: 'null'
          title: Cpu Utilization Percent
        gpu_utilization_percent:
          anyOf:
          - type: number
          - type: 'null'
          title: Gpu Utilization Percent
        ram_utilization_percent:
          anyOf:
          - type: number
          - type: 'null'
          title: Ram Utilization Percent
      type: object
      required:
      - name
      - description
      - timestamp
      - project_id
      - experiment_id
      - emissions
      - cpu_power
      - gpu_power
      - ram_power
      - cpu_energy
      - gpu_energy
      - ram_energy
      - energy_consumed
      - duration
      - emissions_rate
      - emissions_count
      title: ExperimentReport
      description: Code Carbon user test with default project
      country_iso_code: FRA
      country_name: France
      cpu_energy: 191.8251863024175
      cpu_power: 5760
      duration: 7673204
      emission: 152.28955200363455
      emissions_count: 64
      emissions_rate: 1.0984556074701752
      energy_consumed: 358.6795013312438
      experiment_id: 943b2aa5-9e21-41a9-8a38-562505b4b2aa
      gpu_energy: 140.01098718681496
      gpu_power: 2983.9739999999993
      name: Code Carbon user test
      on_cloud: false
      ram_energy: 26.84332784201141
      ram_power: 806.0337192959997
      region: france
      timestamp: '2021-10-07T20:19:27.716693'
  securitySchemes:
    APIKeyCookie:
      type: apiKey
      in: cookie
      name: user_session
    HTTPBearer:
      type: http
      scheme: bearer
x-refined-from:
- codecarbon-openapi.json
- codecarbon-openapi.yml