# GET Sessions Id Usage Limits (https://www.codevisor.dev/docs/api-reference/sessions/get-sessions-by-id-usage-limits)

## GET /v1/sessions/{id}/usage-limits

GET Sessions Id Usage Limits

## OpenAPI definition

```json

{
  "openapi": "3.2.0",
  "info": {
    "title": "Codevisor Server API",
    "version": "v1-experimental",
    "description": "Experimental public API for projects, coding-agent sessions, extensions, files, events, and terminals on a Codevisor server."
  },
  "servers": [
    {
      "url": "http://127.0.0.1:49361",
      "description": "Default local server. If 49361 is taken it uses the next free port up to 49399; `codevisor status` shows the port."
    }
  ],
  "tags": [
    {
      "name": "Server"
    },
    {
      "name": "Authentication"
    },
    {
      "name": "Updates"
    },
    {
      "name": "Projects"
    },
    {
      "name": "Workspaces"
    },
    {
      "name": "Harnesses"
    },
    {
      "name": "Plugins"
    },
    {
      "name": "MCP servers"
    },
    {
      "name": "Skills"
    },
    {
      "name": "Sessions"
    },
    {
      "name": "Files"
    },
    {
      "name": "Events"
    },
    {
      "name": "Terminals"
    }
  ],
  "paths": {
    "/v1/sessions/{id}/usage-limits": {
      "get": {
        "operationId": "get-sessions-by-id-usage-limits",
        "tags": [
          "Sessions"
        ],
        "summary": "GET Sessions Id Usage Limits",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string",
                      "enum": [
                        "available",
                        "unavailable"
                      ]
                    },
                    "harnessId": {
                      "type": "string"
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountLabel": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountEmail": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "plan": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "windows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "usedPercent": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "NaN"
                                ]
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "Infinity"
                                ]
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "-Infinity"
                                ]
                              }
                            ]
                          },
                          "durationMinutes": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "NaN"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "Infinity"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "-Infinity"
                                    ]
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "resetsAt": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "usedPercent"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "credits": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "hasCredits": {
                              "type": "boolean"
                            },
                            "unlimited": {
                              "type": "boolean"
                            },
                            "balance": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "hasCredits",
                            "unlimited"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "detail": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fetchedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "state",
                    "harnessId",
                    "windows",
                    "fetchedAt"
                  ],
                  "additionalProperties": false,
                  "$defs": {}
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Codevisor pairing token"
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The JSON body is malformed or does not match the request schema.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "Unauthorized": {
        "description": "A valid bearer token is required for non-local requests.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "NotFound": {
        "description": "The requested resource does not exist.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "Conflict": {
        "description": "The request conflicts with the resource's current state.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "InvalidRequest": {
        "description": "The request is well formed but cannot be applied.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "ServerError": {
        "description": "The server could not complete the request.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        }
      }
    }
  }
}

```