> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/security-testing-agent-apis/security-testing-orchestration/usage.md).

# Usage

Access Account Usage

## GET /api/usage

> Report usage

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Usage","description":"Access Account Usage"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"jwt_header_Authorization":["core_account_view"]}],"components":{"securitySchemes":{"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"UsageReportUsageResponseBody":{"$ref":"#/components/schemas/UsageResult"},"UsageResult":{"type":"object","properties":{"accountIdentifier":{"type":"string","description":"Account identifier"},"activeDevelopers":{"$ref":"#/components/schemas/Usage"},"activeScans":{"$ref":"#/components/schemas/Usage"},"module":{"type":"string","description":"Harness module"},"timestamp":{"type":"integer","description":"Timestamp","format":"int64"}},"description":"Usage Result","required":["accountIdentifier","module","timestamp","activeDevelopers","activeScans"]},"Usage":{"type":"object","properties":{"count":{"type":"integer","description":"Unit count","format":"int64"},"displayName":{"type":"string","description":"Display name"},"references":{"type":"array","items":{"type":"string"},"description":"References"}},"description":"Usage","required":["count","displayName","references"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/usage":{"get":{"description":"Report usage","operationId":"Usage#ReportUsage","parameters":[{"allowEmptyValue":true,"description":"Harness Account ID","in":"query","name":"accountId","required":true,"schema":{"description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$","type":"string"}},{"allowEmptyValue":true,"description":"Timestamp indicating the end of the usage interval (in milliseconds since Unix epoch)","in":"query","name":"timestamp","required":true,"schema":{"description":"Timestamp indicating the end of the usage interval (in milliseconds since Unix epoch)","format":"int64","type":"integer"}},{"allowEmptyValue":true,"description":"Usage calculation interval (in days)","in":"query","name":"interval","schema":{"default":30,"description":"Usage calculation interval (in days)","format":"int64","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageReportUsageResponseBody"}}},"description":"OK response."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"BadRequest: Bad Request response."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Unauthorized: Unauthorized response."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Forbidden: Forbidden response."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"TooManyRequests: Too Many Requests response."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"InternalServerError: Internal Server Error response."}},"tags":["Usage"]}}}}
```

## GET /api/usage/all-accounts

> Report usage for all accounts

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Usage","description":"Access Account Usage"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"jwt_header_Authorization":["sto_internal_use_only"]}],"components":{"securitySchemes":{"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"UsageUsageAllAccountsResponseBody":{"$ref":"#/components/schemas/UsageAllAccountsResult"},"UsageAllAccountsResult":{"type":"object","properties":{"timestamp":{"type":"integer","description":"Timestamp","format":"int64"},"usage":{"type":"array","items":{"$ref":"#/components/schemas/AccountUsage"},"description":"Usage of all accounts"}},"description":"All Accounts Usage Result","required":["timestamp","usage"]},"AccountUsage":{"type":"object","properties":{"accountId":{"type":"string","description":"Account ID"},"developerCount":{"type":"integer","description":"Developer count","format":"int64"},"harnessCodeCount":{"type":"integer","description":"Harness Code scan count","format":"int64"},"harnessContainerCount":{"type":"integer","description":"Harness Container scan count","format":"int64"},"scanCount":{"type":"integer","description":"Scan count","format":"int64"}},"description":"Account Usage","required":["accountId","scanCount","developerCount"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/usage/all-accounts":{"get":{"description":"Report usage for all accounts","operationId":"Usage#UsageAllAccounts","parameters":[{"allowEmptyValue":true,"description":"Timestamp indicating the end of the usage interval (in milliseconds since Unix epoch)","in":"query","name":"timestamp","required":true,"schema":{"description":"Timestamp indicating the end of the usage interval (in milliseconds since Unix epoch)","format":"int64","type":"integer"}},{"allowEmptyValue":true,"description":"Usage calculation interval (in days)","in":"query","name":"interval","schema":{"default":30,"description":"Usage calculation interval (in days)","format":"int64","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageUsageAllAccountsResponseBody"}}},"description":"OK response."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"BadRequest: Bad Request response."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Unauthorized: Unauthorized response."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Forbidden: Forbidden response."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"TooManyRequests: Too Many Requests response."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"InternalServerError: Internal Server Error response."}},"tags":["Usage"]}}}}
```
