Skip to Content
kosemdocs
ReferenceAPILlm requests

List LLM requests

Lists the requests to a project's models, newest first, without their prompts or answers. With the project - and an organization filter, lists them across the organization's projects: those of every project the caller holds llmgateway.requests.list on. Only the requests of as many days as the organization's plan keeps are listed (llmgateway.requestLogDays: 7 on Hobby, 30 on Pro, 90 on Team and Enterprise).

GET
/v1/projects/{project}/llmRequests

Lists the requests to a project's models, newest first, without their prompts or answers.

With the project - and an organization filter, lists them across the organization's projects: those of every project the caller holds llmgateway.requests.list on. Only the requests of as many days as the organization's plan keeps are listed (llmgateway.requestLogDays: 7 on Hobby, 30 on Pro, 90 on Team and Enterprise).

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

project*string

The project's ID, or - for the projects of the organization that filter names.

Match^(-|prj_[0-7][0-9a-hjkmnp-tv-z]{25})$

Query Parameters

pageSize?integer

Maximum number of items to return. Defaults to 50; values above 500 are treated as 500.

Formatint32
Range0 <= value
pageToken?string

Page token from a previous response.

filter?string

Comparisons joined by AND (AIP-160): organization = "organizations/{organization_id}", required with the project -, and only then; model, principal, source and operation with = and a quoted string, such as principal = "serviceAccount:sa_…"; outcome with = and an outcome, or with != as often as needed, such as outcome != CALLER_LEFT; failed = true for requests that did not end in a successful answer, and failed = false for those that did, where a caller leaving is neither; time with >=, >, <= or < and a quoted RFC 3339 timestamp, compared with startTime.

Lengthlength <= 2048

Response Body

OK

application/json
  1. response
llmRequests*array<>

Requests, newest first.

nextPageToken*string

Token for the next page; empty on the last page.

Example Request
curl -X GET 'https://api.kosem.ai/v1/projects/string/llmRequests'
Example Response
{
  "llmRequests": [
    {
      "alias": "string",
      "cacheReadTokens": 0,
      "cacheWriteTokens": 0,
      "cost": {
        "currencyCode": "string",
        "nanos": -999999999,
        "units": 0
      },
      "durationMs": 0,
      "errorCode": "string",
      "errorMessage": "string",
      "firstTokenLatencyMs": 0,
      "inputTokens": 0,
      "model": "string",
      "name": "string",
      "operation": "string",
      "outcome": "ANSWERED",
      "outputTokens": 0,
      "principal": "string",
      "provider": "string",
      "providerModel": "string",
      "providerStatus": 0,
      "providerType": "string",
      "reasoningTokens": 0,
      "requestFormat": "ANTHROPIC_MESSAGES",
      "source": "string",
      "sourceModel": "string",
      "startTime": "2019-08-24T14:15:22Z",
      "stream": true,
      "upstreamRequestId": "string",
      "usageEstimated": true,
      "userAgent": "string"
    }
  ],
  "nextPageToken": "string"
}