# Get LLM request

`GET /v1/projects/{project}/llmRequests/{llmRequest}`, operation `llmRequests.GetLlmRequest`

Gets a request to one of a project's models, without its prompt or answer.

The request log keeps each request for as many days as the organization's plan says (llmgateway.requestLogDays: 7 on Hobby, 30 on Pro, 90 on Team and Enterprise); an older one is not found.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | Yes | `string` | The project's ID. |
| `llmRequest` | path | Yes | `string` | The request's ID. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alias` | `string` | Yes | The alias the request named the model by; it remains after the model is deleted. |
| `cacheReadTokens` | `integer (int64)` | Yes | Prompt tokens read from the provider's cache. |
| `cacheWriteTokens` | `integer (int64)` | Yes | Prompt tokens written to the provider's cache. |
| `cost` | `Money` | No | What the request cost at the provider's list prices; absent for models whose prices kosem does not know, and for requests not sent. |
| `cost.currencyCode` | `string` | Yes | The currency, as its three-letter ISO 4217 code, such as USD. |
| `cost.nanos` | `integer (int32)` | Yes | The billionths of a unit of the amount, such as 500000000 of US$1.50. |
| `cost.units` | `integer (int64)` | Yes | The whole units of the amount, such as 1 of US$1.50. |
| `durationMs` | `integer (int64)` | Yes | How long the request took, in milliseconds, from when the gateway received it until the answer ended. |
| `errorCode` | `string` | Yes | What went wrong, when something did: the gateway's code, such as insufficient_quota, or the provider's, such as overloaded_error. |
| `errorMessage` | `string` | Yes | The error's message, cut short. A provider's can quote values from the request. |
| `firstTokenLatencyMs` | `integer (int64)` | No | How long the first piece of a streamed answer took to arrive, in milliseconds; absent for answers not streamed, or with no content. |
| `inputTokens` | `integer (int64)` | Yes | Prompt tokens neither read from nor written to a cache. |
| `model` | `string` | Yes | The project's model called, projects/{project_id}/models/{model_id}. |
| `name` | `string` | Yes | Resource name, projects/{project_id}/llmRequests/{llm_request_id}. |
| `operation` | `string` | Yes | What the request was to the provider, such as openai.chat_completions, or generate.anthropic.messages for generation in kosem's format. |
| `outcome` | `string` | Yes | How the request ended: ANSWERED, with the whole answer, whose providerStatus says whether the provider succeeded; CALLER_LEFT before the answer was whole; BROKEN_OFF before it was whole; TIMED_OUT, longer than a request may last; UNREACHABLE, the provider could not be reached or did not start its answer in time; CREDENTIAL_REFUSED by the provider; REDIRECTED by the provider. Not sent: SPEND_LIMITED, the organization or the project reached its monthly spend limit; BILLING_REFUSED by the organization's billing; RATE_LIMITED, the project ran out of a rate quota, which the log keeps at most once a second for each project; WRONG_FORMAT, the model is not served in the format of the endpoint called. Values: `ANSWERED`, `CALLER_LEFT`, `BROKEN_OFF`, `TIMED_OUT`, `UNREACHABLE`, `CREDENTIAL_REFUSED`, `REDIRECTED`, `SPEND_LIMITED`, `BILLING_REFUSED`, `RATE_LIMITED`, `WRONG_FORMAT`. |
| `outputTokens` | `integer (int64)` | Yes | Tokens of the answer, including reasoning. |
| `principal` | `string` | Yes | Who made the request, such as user:usr_… or serviceAccount:sa_…. |
| `provider` | `string` | Yes | The provider the request went through, or would have: organizations/{organization_id}/providers/{provider_id}, or projects/{project_id}/providers/{provider_id} for the project's own. |
| `providerModel` | `string` | Yes | The provider's name for the model, such as gpt-5-mini. |
| `providerStatus` | `integer (int32)` | Yes | The HTTP status the provider answered with; 0 when it did not answer. |
| `providerType` | `string` | Yes | The type of the model's provider, such as providerTypes/anthropic. |
| `reasoningTokens` | `integer (int64)` | Yes | Tokens the model reasoned with, a part of outputTokens. |
| `requestFormat` | `string` | No | The provider API format the caller used; absent for generation in kosem's format, and for records from before format translation. The operation names what went to the provider, which may use a different format. Values: `ANTHROPIC_MESSAGES`, `OPENAI_RESPONSES`, `OPENAI_CHAT_COMPLETIONS`. |
| `source` | `string` | Yes | What in kosem made the request, such as an agent, projects/{project_id}/agents/{agent_id}; empty for calls to the API. |
| `sourceModel` | `string` | Yes | When the model called is an adoption: the organization's model it adopted, organizations/{organization_id}/models/{model_id}; empty otherwise. |
| `startTime` | `string (date-time)` | Yes | When the gateway received the request. |
| `stream` | `boolean` | Yes | Whether the answer was streamed. |
| `upstreamRequestId` | `string` | Yes | The provider's ID for the request, from its answer. |
| `usageEstimated` | `boolean` | Yes | Whether the gateway estimated some of the tokens, because the provider did not report them all, as when the answer broke off. |
| `userAgent` | `string` | Yes | The caller's user agent, cut short. |

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.