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

# Get Activity



## OpenAPI

````yaml /openapi.json get /api/activity/{request_id}
openapi: 3.1.0
info:
  title: Aixy Gateway API
  version: 0.1.0
  description: >-
    Route requests to configured AI providers through OpenAI- and
    Anthropic-compatible APIs. Aixy applies project access, model policies,
    guardrails, routing, budgets, and usage attribution before forwarding
    inference traffic.
servers:
  - url: https://api.aixy-gateway.com
    description: Aixy production gateway
security: []
tags:
  - name: operations
    description: Check process liveness and traffic readiness.
  - name: authentication
    description: Authenticate trusted server-side clients.
  - name: organizations
    description: Manage the organization and its lifecycle.
  - name: projects
    description: Create projects and manage project membership.
  - name: users
    description: Manage organization users, roles, and invitations.
  - name: teams
    description: Manage teams and team membership.
  - name: api-keys
    description: Manage project-scoped gateway API keys.
  - name: provider-credentials
    description: Manage organization and project provider credentials.
  - name: provider-catalog
    description: Discover providers supported by the gateway.
  - name: provider-models
    description: Discover and control models exposed by configured providers.
  - name: routing
    description: Configure stable model aliases, routing strategies, and fallbacks.
  - name: guardrails
    description: Configure prompt and sensitive-data protection policies.
  - name: identity connections
    description: Configure tenant-scoped enterprise identity federation.
  - name: playground
    description: Exercise configured models through the gateway.
  - name: cost-control
    description: Inspect spend and enforce budgets across tenant scopes.
  - name: metrics
    description: Inspect usage, token, latency, and error metrics.
  - name: activity
    description: Diagnose individual model requests and manage opt-in content capture.
  - name: monitors
    description: Configure operational monitors and notification channels.
  - name: audit
    description: Query, verify, and export the organization audit log.
  - name: telemetry exports
    description: Export telemetry to organization-owned destinations.
  - name: billing
    description: Inspect and manage the organization subscription.
  - name: models
    description: List models available to a project-scoped gateway API key.
  - name: inference
    description: Run model inference through the Aixy data plane.
  - name: pricing
    description: Manage versioned pricing attribution rules.
  - name: system
    description: Discover gateway capabilities and providers.
  - name: MCP beta
    description: Mcp beta operations exposed by the gateway.
  - name: cost-optimization
    description: Cost optimization operations exposed by the gateway.
  - name: custom domains
    description: Custom domains operations exposed by the gateway.
  - name: data processing
    description: Data processing operations exposed by the gateway.
  - name: feature flags
    description: Feature flags operations exposed by the gateway.
  - name: privacy
    description: Privacy operations exposed by the gateway.
  - name: roles
    description: Roles operations exposed by the gateway.
paths:
  /api/activity/{request_id}:
    get:
      tags:
        - activity
      summary: Get Activity
      operationId: get_activity
      parameters:
        - name: request_id
          in: path
          required: true
          schema:
            type: string
            title: Request Id
        - name: include_content
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Include Content
        - name: event_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Event Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivityDetailResponse'
        '400':
          description: The request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '401':
          description: Authentication is required or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '403':
          description: The authenticated account cannot perform this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '404':
          description: The requested resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '413':
          description: The request body exceeds the endpoint limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '503':
          description: The control-plane capability is unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        4XX:
          description: The request was rejected by validation or authorization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
      security:
        - BrowserSession: []
components:
  schemas:
    ActivityDetailResponse:
      properties:
        object:
          type: string
          const: activity.request
          title: Object
          default: activity.request
        event_id:
          type: string
          title: Event Id
        occurred_at:
          type: string
          title: Occurred At
        request_id:
          type: string
          title: Request Id
        upstream_request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Upstream Request Id
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
        session_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Key
        identity:
          $ref: '#/components/schemas/ActivityIdentityResponse'
        client:
          $ref: '#/components/schemas/ActivityClientResponse'
        endpoint:
          type: string
          title: Endpoint
        requested_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Requested Model
        effective:
          $ref: '#/components/schemas/ActivityEffectiveResponse'
        status_code:
          type: integer
          title: Status Code
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
        streaming:
          type: boolean
          title: Streaming
        timing:
          $ref: '#/components/schemas/ActivityTimingResponse'
        tokens:
          $ref: '#/components/schemas/ActivityTokensResponse'
        cost:
          $ref: '#/components/schemas/ActivityCostResponse'
        routing_attempts:
          items:
            $ref: '#/components/schemas/ActivityRoutingAttemptResponse'
          type: array
          title: Routing Attempts
        routing_candidates:
          items:
            $ref: '#/components/schemas/ActivityRoutingCandidateResponse'
          type: array
          title: Routing Candidates
        decisions:
          $ref: '#/components/schemas/ActivityDecisionsResponse'
        configuration:
          $ref: '#/components/schemas/ActivityConfigurationResponse'
        content_capture:
          $ref: '#/components/schemas/ActivityContentCaptureResponse'
        diagnostics:
          anyOf:
            - $ref: '#/components/schemas/ActivityDiagnosticsResponse'
            - type: 'null'
      type: object
      required:
        - event_id
        - occurred_at
        - request_id
        - identity
        - client
        - endpoint
        - requested_model
        - effective
        - status_code
        - error_code
        - streaming
        - timing
        - tokens
        - cost
        - routing_attempts
        - routing_candidates
        - decisions
        - configuration
        - content_capture
      title: ActivityDetailResponse
    GatewayErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/GatewayErrorDetail'
      type: object
      required:
        - error
      title: GatewayErrorResponse
    ActivityIdentityResponse:
      properties:
        organization:
          anyOf:
            - $ref: '#/components/schemas/ActivityResourceResponse'
            - type: 'null'
        project:
          anyOf:
            - $ref: '#/components/schemas/ActivityResourceResponse'
            - type: 'null'
        team:
          anyOf:
            - $ref: '#/components/schemas/ActivityResourceResponse'
            - type: 'null'
        api_key:
          anyOf:
            - $ref: '#/components/schemas/ActivityResourceResponse'
            - type: 'null'
        user:
          anyOf:
            - $ref: '#/components/schemas/ActivityUserResourceResponse'
            - type: 'null'
      type: object
      required:
        - organization
        - project
        - team
        - api_key
        - user
      title: ActivityIdentityResponse
    ActivityClientResponse:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
        kind:
          type: string
          enum:
            - application
            - sdk
            - http_client
            - unknown
          title: Kind
        source:
          type: string
          enum:
            - user_agent
            - client_header
            - gateway
            - unknown
          title: Source
      type: object
      required:
        - name
        - version
        - kind
        - source
      title: ActivityClientResponse
    ActivityEffectiveResponse:
      properties:
        provider:
          type: string
          title: Provider
        model:
          type: string
          title: Model
      type: object
      required:
        - provider
        - model
      title: ActivityEffectiveResponse
    ActivityTimingResponse:
      properties:
        total_ms:
          type: number
          title: Total Ms
        upstream_ms:
          type: number
          title: Upstream Ms
        aixy_overhead_ms:
          type: number
          title: Aixy Overhead Ms
        pre_upstream_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Pre Upstream Ms
        processing_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Processing Ms
        ttft_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Ttft Ms
        stream_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Stream Ms
      type: object
      required:
        - total_ms
        - upstream_ms
        - aixy_overhead_ms
        - pre_upstream_ms
        - processing_ms
        - ttft_ms
        - stream_ms
      title: ActivityTimingResponse
    ActivityTokensResponse:
      properties:
        input:
          anyOf:
            - type: integer
            - type: 'null'
          title: Input
        output:
          anyOf:
            - type: integer
            - type: 'null'
          title: Output
        total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total
        uncached_input:
          anyOf:
            - type: integer
            - type: 'null'
          title: Uncached Input
        cached_input:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cached Input
        cache_write_input:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Write Input
        reasoning:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reasoning
      type: object
      required:
        - input
        - output
        - total
        - uncached_input
        - cached_input
        - cache_write_input
        - reasoning
      title: ActivityTokensResponse
    ActivityCostResponse:
      properties:
        amount_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Amount Usd
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
        pricing_rule_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Pricing Rule Id
        pricing_rule_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Pricing Rule Version
        unattributed_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Unattributed Reason
        cost_contract_version:
          type: integer
          title: Cost Contract Version
      type: object
      required:
        - amount_usd
        - status
        - source
        - pricing_rule_id
        - pricing_rule_version
        - unattributed_reason
        - cost_contract_version
      title: ActivityCostResponse
    ActivityRoutingAttemptResponse:
      properties:
        attempt:
          type: integer
          title: Attempt
        provider:
          type: string
          title: Provider
        model:
          type: string
          title: Model
        selection_reason:
          type: string
          title: Selection Reason
        selection_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Selection Score
        status_code:
          anyOf:
            - type: integer
            - type: 'null'
          title: Status Code
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
        duration_ms:
          type: number
          title: Duration Ms
        fallback:
          type: boolean
          title: Fallback
      type: object
      required:
        - attempt
        - provider
        - model
        - selection_reason
        - selection_score
        - status_code
        - error_code
        - duration_ms
        - fallback
      title: ActivityRoutingAttemptResponse
    ActivityRoutingCandidateResponse:
      properties:
        provider:
          type: string
          title: Provider
        model:
          type: string
          title: Model
        connection_scope:
          type: string
          title: Connection Scope
        outcome:
          type: string
          title: Outcome
        reason:
          type: string
          title: Reason
      type: object
      required:
        - provider
        - model
        - connection_scope
        - outcome
        - reason
      title: ActivityRoutingCandidateResponse
    ActivityDecisionsResponse:
      properties:
        guardrail:
          $ref: '#/components/schemas/ActivityDecisionResponse'
        budget:
          $ref: '#/components/schemas/ActivityDecisionResponse'
        rate_limit:
          $ref: '#/components/schemas/ActivityDecisionResponse'
        cache:
          $ref: '#/components/schemas/ActivityDecisionResponse'
      type: object
      required:
        - guardrail
        - budget
        - rate_limit
        - cache
      title: ActivityDecisionsResponse
    ActivityConfigurationResponse:
      properties:
        snapshot_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Snapshot Version
        routing_model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Routing Model Id
        routing_model_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Routing Model Version
      type: object
      required:
        - snapshot_version
        - routing_model_id
        - routing_model_version
      title: ActivityConfigurationResponse
    ActivityContentCaptureResponse:
      properties:
        status:
          type: string
          title: Status
        content:
          anyOf:
            - $ref: '#/components/schemas/ActivityContentResponse'
            - type: 'null'
      type: object
      required:
        - status
        - content
      title: ActivityContentCaptureResponse
    ActivityDiagnosticsResponse:
      properties:
        observation_complete:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Observation Complete
        request_body_bytes:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Request Body Bytes
        service_tier:
          anyOf:
            - type: string
              enum:
                - auto
                - default
                - standard
                - flex
                - priority
                - batch
            - type: 'null'
          title: Service Tier
        base_overhead_ms:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Base Overhead Ms
        feature_duration_ms:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Feature Duration Ms
        feature_executions:
          items:
            $ref: '#/components/schemas/ActivityFeatureExecutionResponse'
          type: array
          maxItems: 16
          title: Feature Executions
        cache_savings:
          anyOf:
            - $ref: '#/components/schemas/ActivityCacheSavingsResponse'
            - type: 'null'
      type: object
      required:
        - observation_complete
        - request_body_bytes
        - service_tier
        - base_overhead_ms
        - feature_duration_ms
        - feature_executions
        - cache_savings
      title: ActivityDiagnosticsResponse
    GatewayErrorDetail:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
      type: object
      required:
        - code
        - message
      title: GatewayErrorDetail
    ActivityResourceResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      type: object
      required:
        - id
        - name
      title: ActivityResourceResponse
    ActivityUserResourceResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
      type: object
      required:
        - id
        - name
        - email
      title: ActivityUserResourceResponse
    ActivityDecisionResponse:
      properties:
        outcome:
          type: string
          title: Outcome
        source:
          type: string
          title: Source
        policy_versions:
          items:
            type: string
          type: array
          title: Policy Versions
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
      type: object
      required:
        - outcome
        - source
        - policy_versions
        - detail
      title: ActivityDecisionResponse
    ActivityContentResponse:
      properties:
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
        response:
          anyOf:
            - type: string
            - type: 'null'
          title: Response
        prompt_too_long:
          type: boolean
          title: Prompt Too Long
        response_too_long:
          type: boolean
          title: Response Too Long
        expires_at:
          type: string
          title: Expires At
      type: object
      required:
        - prompt
        - response
        - prompt_too_long
        - response_too_long
        - expires_at
      title: ActivityContentResponse
    ActivityFeatureExecutionResponse:
      properties:
        name:
          type: string
          pattern: ^[a-z][a-z0-9_.-]{0,63}$
          title: Name
        phase:
          type: string
          enum:
            - pre_call
            - post_call
          title: Phase
        duration_ms:
          type: number
          minimum: 0
          title: Duration Ms
        outcome:
          type: string
          enum:
            - completed
            - timed_out
            - cancelled
            - rejected
            - failed
          title: Outcome
      type: object
      required:
        - name
        - phase
        - duration_ms
        - outcome
      title: ActivityFeatureExecutionResponse
    ActivityCacheSavingsResponse:
      properties:
        amount_usd:
          type: string
          title: Amount Usd
        input_without_cache_usd:
          type: string
          title: Input Without Cache Usd
        input_with_cache_usd:
          type: string
          title: Input With Cache Usd
        source:
          type: string
          enum:
            - official
            - contract
            - manual
            - provider_catalog
            - models.dev
          title: Source
        pricing_rule_id:
          type: string
          format: uuid
          title: Pricing Rule Id
        pricing_rule_version:
          type: integer
          minimum: 1
          title: Pricing Rule Version
        status:
          type: string
          const: estimated
          title: Status
          default: estimated
      type: object
      required:
        - amount_usd
        - input_without_cache_usd
        - input_with_cache_usd
        - source
        - pricing_rule_id
        - pricing_rule_version
      title: ActivityCacheSavingsResponse
  securitySchemes:
    BrowserSession:
      type: apiKey
      description: Secure same-origin browser session cookie.
      in: cookie
      name: gateway_session

````

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