---
title: "Code-context quota pre-flight"
method: GET
path: "/api/code/quota"
tags: ["Code"]
---

# Code-context quota pre-flight

`GET /api/code/quota`

## Request

- Base URL: `http://localhost:38200`
- URL: `http://localhost:38200/api/code/quota`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `token`

Returns the tenant's current `code_contexts` usage and plan limit so the indexer CLI can run a transparent cost-preview before uploading any contexts.

## Response `200`

Quota snapshot.

- object
  - `used` integer: Code-file contexts currently stored for this tenant.
  - `limit` integer: Plan limit for the code_contexts bucket.
  - `remaining` integer: limit - used
  - `percentUsed` number: 0-100
  - `plan` string

## Other responses

- `401`: Missing or invalid credentials.

---

[API](https://skmtc.dev/contextq/apis/contextq-api.md) · [All operations](https://skmtc.dev/contextq/apis/contextq-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contextq/apis/contextq-api/revisions/7afc44056a22?raw)
