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

# 규정 준수 영수증

> 완료를 위해 서명된 SMLTP 준수 영수증을 가져옵니다.

# 준수 영수증

완료가 **SMLTP 게이트웨이**를 통해 라우팅되면 SecureAI는 통화를 관리하는 정책에 대한 암호화 증거인 서명된 규정 준수 **영수증**을 생성합니다. 이 엔드포인트는 번들 ID로 해당 영수증을 가져옵니다.

영수증은 게이트웨이 라우팅 배포에만 존재합니다. 직접 공급자 배포에는 영수증에 서명할 게이트웨이가 없으며 이 끝점은 `404`을 반환합니다.

## 엔드포인트

```
GET /receipts/:bundleId
```

## 번들 ID의 출처

완료 응답은 호출에 대해 SMLTP 자격이 부여될 때마다 번들 ID를 노출합니다.

* 클래식 끝점: `metadata.smltp.bundle_id` (및 기성품 `metadata.smltp.receipt_url`).
* OpenAI 호환 엔드포인트: `secureai.smltp_bundle_id`.

기본/직접 공급자 배포에서도 번들 ID(`jti-…`와 같은 자격 ID)가 반환됩니다. 그러나 해당 ID의 **서명된 영수증**은 트래픽이 SMLTP 게이트웨이를 통해 라우팅되는 경우에만 존재합니다. 직접 배포에서는 이 끝점이 `404`를 반환합니다(아래 참조).

## 인증

```bash theme={null}
Authorization: Bearer sk-your-api-key-here
```

## 요청 예시

```bash theme={null}
curl -X GET "https://{customer.name}.hiperai.ai/api/external/receipts/bnd_9f2c...e71" \
  -H "Authorization: Bearer sk-your-api-key-here"
```

## 응답

### 200 OK

```json theme={null}
{
  "success": true,
  "receipt": {
    "bundle_id": "bnd_9f2c...e71",
    "...": "signed SMLTP receipt payload (policy, entitlement, verdict, signatures)"
  }
}
```

`receipt` 객체는 게이트웨이에서 내보내는 서명된 페이로드입니다. 영수증이 투명성 및 감사 모델에 어떻게 부합하는지 알아보려면 [SMLTP 보안](/ko/en/security/smltp)을 참조하세요.

### 404 찾을 수 없음

```json theme={null}
{
  "success": false,
  "error": "Receipt not found",
  "message": "No receipt for this bundle id. Receipts are only available when requests are routed through the SMLTP gateway, and are retained in its in-memory store for a limited time. The authoritative record is the hash-chained audit log."
}
```

### 400 잘못된 요청

번들 ID가 누락되었거나 128자를 초과하는 경우 반환됩니다.

## 메모

* 영수증은 게이트웨이의 인메모리 저장소에 한정된 시간 동안 보관됩니다. 장기적인 증거를 위해 신뢰할 수 있고 변경할 수 없는 기록인 **해시 체인 감사 로그**를 활용하세요. [불변 로그](/ko/ko/security/immutable-logs)를 참조하세요.
* 모든 배포 경로가 게이트웨이를 통과하는 것은 아닙니다. `404`을 통합 오류가 아닌 "이 호출에 대한 게이트웨이 수신 없음"으로 처리합니다.

## 관련

* [SMLTP 보안](/ko/ko/security/smltp)
* [불변 로그](/ko/ko/security/immutable-logs)
* [채팅 완료](/ko/ko/api/chat/completions)


## OpenAPI

````yaml GET /receipts/{bundleId}
openapi: 3.0.3
info:
  title: SecureAI External API
  description: >
    SecureAI External API provides AI chat completion and image generation
    capabilities with knowledge base retrieval, 

    security policies, and comprehensive usage tracking. This API is designed
    for external developers 

    and integrations using API key authentication.


    ## Key Features

    - **RAG (Retrieval-Augmented Generation)**: Automatically search knowledge
    bases for relevant context

    - **Multi-Model Support**: OpenAI, Anthropic, Google, Meta, and other AI
    models

    - **Model Redundancy & Failover**: Caller-defined failover chains (primary +
    fallbacks) with per-attempt timeouts

    - **OpenAI-Compatible Endpoint**: Point any OpenAI SDK at `/api/external/v1`
    — no code changes

    - **Image Generation**: Generate and edit images using Google Gemini 2.5
    Flash Image

    - **Speech-to-Speech (S2S)**: Real-time voice conversations using OpenAI
    Realtime API with WebRTC

    - **Security Policies**: SMLTP policy enforcement, per-call Prompt Shield,
    and signed compliance receipts

    - **Usage Tracking**: Comprehensive usage monitoring, self-service quota,
    and rate limiting

    - **Knowledge Base Integration**: Access to personal and shared knowledge
    bases

    - **User Management**: Complete user, group, and role management
    capabilities

    - **Audit Logging**: Comprehensive activity and security audit logs


    ## Authentication

    All endpoints (except health check) require API key authentication using
    Bearer token:

    ```

    Authorization: Bearer sk-your-api-key-here

    ```


    ## Billing and Usage

    By default, API requests are billed to the user account that owns the API
    key. You can specify 

    a different user to bill by including the `user_id` parameter in your
    request. This allows for:

    - Multi-tenant applications with per-user billing

    - Flexible completion limit management

    - Per-user "Usage by Model" settings


    ## Rate Limits

    - Default: 60 requests per minute, 1000 requests per hour

    - Daily limits: 100 requests (configurable)

    - Monthly limits: 10,000 requests (configurable)


    ## Base URL

    ```

    https://secureai.hiperai.ai/api/external

    ```
  version: 1.1.0
  contact:
    name: SecureAI Support
    email: support@secureai.hiperai.ai
  license:
    name: Proprietary
    url: https://secureai.hiperai.ai/terms
servers:
  - url: https://secureai.hiperai.ai/api/external
    description: Production server
  - url: http://localhost:3010/api/external
    description: Development server
security:
  - ApiKeyAuth: []
tags:
  - name: System
    description: System health and status endpoints
  - name: Discovery
    description: Endpoints to discover available models, indexes, and policies
  - name: Chat
    description: AI chat completion endpoints
  - name: User Management
    description: Endpoints for managing user accounts and roles
  - name: Index Management
    description: Endpoints for managing knowledge base indexes
  - name: Group Management
    description: Endpoints for managing user groups
  - name: SMLTP Security
    description: Endpoints for managing SMLTP security policies and audit logs
  - name: Role Management
    description: Endpoints for managing user roles
  - name: Activity Logs
    description: Endpoints for retrieving activity logs
externalDocs:
  description: SecureAI Documentation
  url: https://secureai.hiperai.ai/docs
paths:
  /receipts/{bundleId}:
    get:
      tags:
        - Security
      summary: Fetch a signed SMLTP compliance receipt
      description: >
        Returns the signed compliance receipt for a gateway-routed completion.
        The

        bundle id is exposed on completion responses as
        `metadata.smltp.bundle_id`

        (classic) or `secureai.smltp_bundle_id` (/v1). Returns 404 on

        direct-provider deployments (no gateway to sign receipts).
      operationId: getReceipt
      parameters:
        - name: bundleId
          in: path
          required: true
          schema:
            type: string
            maxLength: 128
      responses:
        '200':
          description: The signed receipt object
        '400':
          description: Invalid bundle id
        '404':
          description: No receipt for this bundle id (or non-gateway deployment)
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: |
        API key authentication using Bearer token format.
        Example: `Authorization: Bearer sk-your-api-key-here`

````