> ## 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.

# Obter uma geração

> Recupera uma geração específica pelo ID.

Busca o registro de auditoria armazenado para um `request_id` da sua equipe.

Use:

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

Quando o gateway capturou todos os detalhes da solicitação dessa geração, a resposta também inclui:

* `replay_supported`: indica se há um payload pronto para repetição
* `replay_request`: o corpo da solicitação armazenado que pode ser enviado ao endpoint original para uma nova execução controlada

Fluxo típico para repetir uma solicitação:

1. Leia o registro da geração com `GET /v1/generations?id=<request_id>`.
2. Verifique se `replay_supported === true`.
3. Reenvie `replay_request` ao endpoint original indicado por `endpoint`, como `/v1/chat/completions` ou `/v1/responses`.


## OpenAPI

````yaml pt-BR/openapi/v1/openapi.localized.yaml GET /generations
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: >-
    Uma API de gateway para acessar diversos modelos de IA por meio de endpoints
    compatíveis com OpenAI.
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: Roteamento global
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /generations:
    get:
      tags:
        - Gateway
      summary: Obter uma geração
      description: Recupera uma geração específica pelo ID.
      operationId: getGeneration
      parameters:
        - name: id
          in: query
          required: true
          description: ID da geração
          schema:
            type: string
      responses:
        '200':
          description: Dados da geração
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerationResponse'
        '401':
          description: Não autorizado
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  reason:
                    type: string
        '404':
          description: Não encontrado
          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: >-
            Indica se há um payload de solicitação pronto para replay disponível
            para esta geração.
        replay_request:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            Payload de solicitação pronto para replay, capturado para esta
            geração quando disponível.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Autenticação com token Bearer

````

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