> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取生成记录

> 根据 ID 获取指定的生成记录。

获取属于你团队的指定 `request_id` 的已存储审计记录。

使用：

* `GET /v1/generations?id=<request_id>`

如果网关捕获了该生成请求的完整详细信息，响应还会包含：

* `replay_supported`：指示是否存在可用于重放的载荷
* `replay_request`：已存储的请求正文，可发送回原始端点以受控地重新运行

典型的重放流程：

1. 使用 `GET /v1/generations?id=<request_id>` 读取生成记录。
2. 检查 `replay_supported === true`。
3. 将 `replay_request` 重新提交到 `endpoint` 指定的原始端点，例如 `/v1/chat/completions` 或 `/v1/responses`。


## OpenAPI

````yaml zh-Hans/openapi/v1/openapi.localized.yaml GET /generations
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: 通过兼容 OpenAI 的端点访问各种 AI 模型的网关 API。
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: 全球路由
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /generations:
    get:
      tags:
        - Gateway
      summary: 获取生成记录
      description: 根据 ID 获取指定的生成记录。
      operationId: getGeneration
      parameters:
        - name: id
          in: query
          required: true
          description: 生成记录 ID
          schema:
            type: string
      responses:
        '200':
          description: 生成记录数据
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerationResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  reason:
                    type: string
        '404':
          description: 未找到
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
components:
  schemas:
    GenerationResponse:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
        request_id:
          type: string
        team_id:
          type: string
        app_id:
          type: string
          nullable: true
        endpoint:
          type: string
        model_id:
          type: string
        provider:
          type: string
        native_response_id:
          type: string
          nullable: true
        stream:
          type: boolean
        byok:
          type: boolean
        status_code:
          type: number
        success:
          type: boolean
        error_code:
          type: string
          nullable: true
        error_message:
          type: string
          nullable: true
        latency_ms:
          type: number
        generation_ms:
          type: number
        usage:
          type: object
          nullable: true
          properties:
            prompt_tokens:
              type: number
            completion_tokens:
              type: number
            total_tokens:
              type: number
        cost_nanos:
          type: number
        currency:
          type: string
        pricing_lines:
          type: array
          items:
            type: object
        key_id:
          type: string
        throughput:
          type: number
          nullable: true
        replay_supported:
          type: boolean
          description: 指示此生成是否提供可重放的请求负载。
        replay_request:
          type: object
          nullable: true
          additionalProperties: true
          description: 此生成的可重放请求负载（如有）。
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer 令牌身份验证

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.