CodeCarbon Project tokens API

The Project tokens API from CodeCarbon — 2 operation(s) for project tokens.

GitHub OpenAPI

Operations 3

POST /projects/{project_id}/api-tokens Add Project Token #
GET /projects/{project_id}/api-tokens Get All Project Tokens #
DELETE /projects/{project_id}/api-tokens/{token_id} Delete Project Token #

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-project-tokens-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-project-tokens-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Codecarbon Project tokens API
  version: 0.1.0
  x-refined-note:
  - x-original-title differs across the merged source definitions and was not carried
  description: 'Operations tagged Project tokens 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: Project tokens
paths:
  /projects/{project_id}/api-tokens:
    post:
      tags:
      - Project tokens
      summary: Add Project Token
      operationId: add_project_token_projects__project_id__api_tokens_post
      security:
      - APIKeyCookie: []
      - HTTPBearer: []
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          title: Project Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectTokenCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectToken'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Project tokens
      summary: Get All Project Tokens
      operationId: get_all_project_tokens_projects__project_id__api_tokens_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/ProjectToken'
                title: Response Get All Project Tokens Projects  Project Id  Api Tokens Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    servers:
    - url: /api/
  /projects/{project_id}/api-tokens/{token_id}:
    delete:
      tags:
      - Project tokens
      summary: Delete Project Token
      operationId: delete_project_token_projects__project_id__api_tokens__token_id__delete
      security:
      - APIKeyCookie: []
      - HTTPBearer: []
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          title: Project Id
      - name: token_id
        in: path
        required: true
        schema:
          type: string
          title: Token Id
      responses:
        '204':
          description: Successful Response
        '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
    ProjectTokenCreate:
      properties:
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        access:
          type: integer
          title: Access
          default: 2
      type: object
      title: ProjectTokenCreate
      example:
        access: 1
        name: my project token
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProjectToken:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        token:
          anyOf:
          - type: string
          - type: 'null'
          title: Token
        last_used:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Used
        access:
          type: integer
          title: Access
          default: 2
        revoked:
          type: boolean
          title: Revoked
          default: false
      type: object
      required:
      - id
      - project_id
      title: ProjectToken
      example:
        access: 1
        id: 8edb03e1-9a28-452a-9c93-a3b6560136d7
        last_used: '2021-04-04T08:43:00+02:00'
        name: my project token
        project_id: 8edb03e1-9a28-452a-9c93-a3b6560136d7
        revoked: false
  securitySchemes:
    APIKeyCookie:
      type: apiKey
      in: cookie
      name: user_session
    HTTPBearer:
      type: http
      scheme: bearer
x-refined-from:
- codecarbon-openapi.json
- codecarbon-openapi.yml