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

# 获取可观测性目标

> 在不返回凭据的情况下获取目标策略和筛选器。

<Note>此端点需要具有 `settings:read` 权限的管理 API 密钥。</Note>

密钥筛选器和分组事件规则按评估顺序返回。


## OpenAPI

````yaml zh-Hans/openapi/v1/openapi.localized.yaml GET /observability/destinations/{id}
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:
  /observability/destinations/{id}:
    get:
      tags:
        - Gateway
      summary: 获取可观测性目标
      description: 返回目标元数据和筛选器，但不包含机密配置。
      operationId: getObservabilityDestination
      parameters:
        - $ref: '#/components/parameters/ObservabilityDestinationId'
      responses:
        '200':
          description: 目标元数据
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObservabilityDestinationResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 未找到目标
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    ObservabilityDestinationId:
      name: id
      in: path
      required: true
      description: 可观测性目标标识符。
      schema:
        type: string
        format: uuid
  schemas:
    ObservabilityDestinationResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/ObservabilityDestination'
      additionalProperties: false
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        ok:
          type: boolean
          example: false
        error:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          example: error_type
        message:
          type: string
          example: Human-readable error message
        description:
          type: string
          example: Additional error details.
        generation_id:
          type: string
          example: G-abc123
        status_code:
          type: integer
          example: 502
        error_type:
          type: string
          enum:
            - user
            - system
          example: system
        error_origin:
          type: string
          enum:
            - user
            - gateway
            - upstream
          example: upstream
        reason:
          type: string
          example: all_candidates_failed
        attempt_count:
          type: integer
          example: 2
        failed_providers:
          type: array
          items:
            type: string
          example:
            - google-ai-studio
            - openai
        failed_statuses:
          type: array
          items:
            type: integer
          example:
            - 403
            - 429
        upstream_error:
          $ref: '#/components/schemas/ErrorUpstreamError'
        failure_sample:
          type: array
          items:
            $ref: '#/components/schemas/ErrorFailureSampleItem'
        provider_failure_diagnostics:
          $ref: '#/components/schemas/ErrorProviderFailureDiagnostics'
        routing_diagnostics:
          $ref: '#/components/schemas/ErrorRoutingDiagnostics'
        provider_candidate_diagnostics:
          $ref: '#/components/schemas/ErrorProviderCandidateDiagnostics'
        provider_enablement:
          $ref: '#/components/schemas/ErrorProviderEnablementDiagnostics'
        missing_pricing_providers:
          type: array
          items:
            type: string
        provider_payment_required_provider:
          type: string
          example: openai
        provider_payment_required_support_notice:
          type: string
          example: >-
            Our upstream provider billing appears to be unavailable. If this
            persists, contact support.
        details:
          type: array
          items:
            type: object
            additionalProperties: true
      additionalProperties: true
    ObservabilityDestination:
      type: object
      required:
        - id
        - workspace_id
        - type
        - name
        - enabled
        - privacy_mode
        - sampling_rate
        - group_join
        - key_filters
        - rule_groups
        - configured
      properties:
        id:
          type: string
          format: uuid
        workspace_id:
          type: string
          format: uuid
        type:
          $ref: '#/components/schemas/ObservabilityDestinationType'
        name:
          type: string
        enabled:
          type: boolean
        privacy_mode:
          type: boolean
        sampling_rate:
          type: number
          minimum: 0.0001
          maximum: 1
        group_join:
          type: string
          enum:
            - and
            - or
        include_generation_metadata:
          type: boolean
        include_cost_metadata:
          type: boolean
        include_identity_metadata:
          type: boolean
        include_request_context:
          type: boolean
        key_filters:
          type: array
          items:
            $ref: '#/components/schemas/ObservabilityKeyFilter'
        rule_groups:
          type: array
          items:
            $ref: '#/components/schemas/ObservabilityRuleGroup'
        configured:
          type: boolean
          description: 指示是否存在加密的目标配置。
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    ErrorUpstreamError:
      type: object
      properties:
        code:
          type: string
          nullable: true
          example: PERMISSION_DENIED
        message:
          type: string
          nullable: true
          example: The caller does not have permission.
        description:
          type: string
          nullable: true
        param:
          type: string
          nullable: true
    ErrorFailureSampleItem:
      type: object
      properties:
        provider:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        status:
          type: integer
          nullable: true
        upstream_error_code:
          type: string
          nullable: true
        upstream_error_message:
          type: string
          nullable: true
        upstream_error_description:
          type: string
          nullable: true
        upstream_error_param:
          type: string
          nullable: true
        upstream_payload_preview:
          type: string
          nullable: true
        retryable:
          type: boolean
          nullable: true
      additionalProperties: true
    ErrorProviderFailureDiagnostics:
      type: object
      properties:
        category:
          type: string
          enum:
            - credentials_not_configured
            - credentials_invalid_or_forbidden
            - provider_access_missing
            - region_or_project_restriction
            - model_unavailable_for_endpoint
            - rate_limited
            - server_error
        hint:
          type: string
        provider:
          type: string
          nullable: true
    ErrorRoutingDiagnostics:
      type: object
      properties:
        filterStages:
          type: array
          items:
            type: object
            properties:
              stage:
                type: string
              beforeCount:
                type: integer
              afterCount:
                type: integer
              droppedProviders:
                type: array
                items:
                  type: object
                  properties:
                    providerId:
                      type: string
                      nullable: true
                    reason:
                      type: string
                      nullable: true
                  additionalProperties: true
            additionalProperties: true
      additionalProperties: true
    ErrorProviderCandidateDiagnostics:
      type: object
      properties:
        totalProviders:
          type: integer
        supportsEndpointCount:
          type: integer
        candidateCount:
          type: integer
        droppedUnsupportedEndpoint:
          type: array
          items:
            type: string
        droppedMissingAdapter:
          type: array
          items:
            type: object
            properties:
              providerId:
                type: string
                nullable: true
              endpoint:
                type: string
                nullable: true
            additionalProperties: true
      additionalProperties: true
    ErrorProviderEnablementDiagnostics:
      type: object
      properties:
        capability:
          type: string
        providersBefore:
          type: array
          items:
            type: string
        providersAfter:
          type: array
          items:
            type: string
        dropped:
          type: array
          items:
            type: object
            properties:
              providerId:
                type: string
                nullable: true
              reason:
                type: string
                nullable: true
            additionalProperties: true
      additionalProperties: true
    ObservabilityDestinationType:
      type: string
      enum:
        - otel_collector
        - webhook
    ObservabilityKeyFilter:
      type: object
      required:
        - key_id
        - mode
      properties:
        key_id:
          type: string
          format: uuid
        mode:
          type: string
          enum:
            - include
            - exclude
      additionalProperties: false
    ObservabilityRuleGroup:
      type: object
      required:
        - match
        - rules
      properties:
        match:
          type: string
          enum:
            - and
            - or
        rules:
          type: array
          minItems: 1
          maxItems: 20
          items:
            $ref: '#/components/schemas/ObservabilityRule'
      additionalProperties: false
    ObservabilityRule:
      type: object
      required:
        - field
        - condition
      properties:
        field:
          type: string
          enum:
            - model
            - provider
            - session_id
            - user_id
            - api_key_name
            - finish_reason
            - input
            - output
            - token_cost
            - total_cost
            - total_tokens
            - prompt_tokens
            - completion_tokens
        condition:
          type: string
          enum:
            - equals
            - not_equals
            - contains
            - not_contains
            - starts_with
            - ends_with
            - exists
            - not_exists
            - matches_regex
        value:
          type: string
          maxLength: 128
          nullable: true
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer 令牌身份验证

````

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