## Get an output item of an eval run

`OutputItemRetrieveResponse evals().runs().outputItems().retrieve(OutputItemRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}`

Get an evaluation run output item by ID.

### Parameters

- `OutputItemRetrieveParams params`

  - `String evalId`

  - `String runId`

  - `Optional<String> outputItemId`

### Returns

- `class OutputItemRetrieveResponse:`

  A schema representing an evaluation run output item.

  - `String id`

    Unique identifier for the evaluation run output item.

  - `long createdAt`

    Unix timestamp (in seconds) when the evaluation run was created.

  - `DatasourceItem datasourceItem`

    Details of the input data source item.

  - `long datasourceItemId`

    The identifier for the data source item.

  - `String evalId`

    The identifier of the evaluation group.

  - `JsonValue; object_ "eval.run.output_item"constant`

    The type of the object. Always "eval.run.output_item".

    - `EVAL_RUN_OUTPUT_ITEM("eval.run.output_item")`

  - `List<Result> results`

    A list of grader results for this output item.

    - `String name`

      The name of the grader.

    - `boolean passed`

      Whether the grader considered the output a pass.

    - `double score`

      The numeric score produced by the grader.

    - `Optional<Sample> sample`

      Optional sample or intermediate data produced by the grader.

    - `Optional<String> type`

      The grader type (for example, "string-check-grader").

  - `String runId`

    The identifier of the evaluation run associated with this output item.

  - `Sample sample`

    A sample containing the input and output of the evaluation run.

    - `EvalApiError error`

      An object representing an error response from the Eval API.

      - `String code`

        The error code.

      - `String message`

        The error message.

    - `String finishReason`

      The reason why the sample generation was finished.

    - `List<Input> input`

      An array of input messages.

      - `String content`

        The content of the message.

      - `String role`

        The role of the message sender (e.g., system, user, developer).

    - `long maxCompletionTokens`

      The maximum number of tokens allowed for completion.

    - `String model`

      The model used for generating the sample.

    - `List<Output> output`

      An array of output messages.

      - `Optional<String> content`

        The content of the message.

      - `Optional<String> role`

        The role of the message (e.g. "system", "assistant", "user").

    - `long seed`

      The seed used for generating the sample.

    - `double temperature`

      The sampling temperature used.

    - `double topP`

      The top_p value used for sampling.

    - `Usage usage`

      Token usage details for the sample.

      - `long cachedTokens`

        The number of tokens retrieved from cache.

      - `long completionTokens`

        The number of completion tokens generated.

      - `long promptTokens`

        The number of prompt tokens used.

      - `long totalTokens`

        The total number of tokens used.

  - `String status`

    The status of the evaluation run.

### Example

```java
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.evals.runs.outputitems.OutputItemRetrieveParams;
import com.openai.models.evals.runs.outputitems.OutputItemRetrieveResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        OutputItemRetrieveParams params = OutputItemRetrieveParams.builder()
            .evalId("eval_id")
            .runId("run_id")
            .outputItemId("output_item_id")
            .build();
        OutputItemRetrieveResponse outputItem = client.evals().runs().outputItems().retrieve(params);
    }
}
```

#### Response

```json
{
  "id": "id",
  "created_at": 0,
  "datasource_item": {
    "foo": "bar"
  },
  "datasource_item_id": 0,
  "eval_id": "eval_id",
  "object": "eval.run.output_item",
  "results": [
    {
      "name": "name",
      "passed": true,
      "score": 0,
      "sample": {
        "foo": "bar"
      },
      "type": "type"
    }
  ],
  "run_id": "run_id",
  "sample": {
    "error": {
      "code": "code",
      "message": "message"
    },
    "finish_reason": "finish_reason",
    "input": [
      {
        "content": "content",
        "role": "role"
      }
    ],
    "max_completion_tokens": 0,
    "model": "model",
    "output": [
      {
        "content": "content",
        "role": "role"
      }
    ],
    "seed": 0,
    "temperature": 0,
    "top_p": 0,
    "usage": {
      "cached_tokens": 0,
      "completion_tokens": 0,
      "prompt_tokens": 0,
      "total_tokens": 0
    }
  },
  "status": "status"
}
```
