UCloud logo UCloud logo UCloud
v2026.7.0-k8s.18
  1. UCloud/Core
  2. 1. Introduction
  3. 2. Projects
  4. 3. API Tokens
    1. 3.1. Platform API Tokens
    2. 3.2. Provider API Tokens
  5. 4. Accounting
  6. 5. Orchestration
  7. 6. Frontend
  8. UCloud/IM for Slurm-based HPC
  9. 7. Installation
  10. 8. Architecture and Networking
  11. 9. User and Project Management
  12. 10. Filesystem Integration
    1. 10.1. Inter-provider file transfers
  13. 11. Slurm Integration
    1. 11.1. Application Management
    2. 11.2. Built-in Applications
  14. 12. Reference
    1. 12.1. Configuration
    2. 12.2. CLI
  15. 13. Appendix
    1. 13.1. Built-in Application Index
  16. UCloud/IM for Kubernetes
  17. 14. Installation
  18. 15. Architecture and Networking
  19. 16. Filesystem Integration
  20. 17. Compute Jobs
    1. 17.1. Networks
    2. 17.2. Public Links
    3. 17.3. Public IPs
    4. 17.4. License Servers
    5. 17.5. SSH Servers
    6. 17.6. Job Audit Log
    7. 17.7. Virtual machines
  21. 18. AI Inference
    1. 18.1. Architecture
    2. 18.2. Chat Middleware
    3. 18.3. Chat Playground
    4. 18.4. Model Discovery and Catalog
    5. 18.5. Dynamo Deployments
    6. 18.6. Usage and Accounting
    7. 18.7. Audit
    8. 18.8. Metrics
    9. 18.9. Security
  22. 19. Integrated applications
    1. 19.1. Syncthing
    2. 19.2. Integrated terminal
    3. 19.3. Kubernetes clusters
      1. 19.3.1. Architecture
      2. 19.3.2. Stacks
      3. 19.3.3. Creating a cluster
      4. 19.3.4. Cluster dashboard
      5. 19.3.5. Networking and storage
      6. 19.3.6. Maintenance and upgrades
      7. 19.3.7. Backup and recovery
      8. 19.3.8. Reference
  23. 20. UCX applications
    1. 20.1. Hello world
    2. 20.2. Data binding
    3. 20.3. UI events
    4. 20.4. Component reference
    5. 20.5. API reference
  24. 21. Reference
    1. 21.1. Configuration
    2. 21.2. CLI
  25. Style guidelines
  26. 22. Branding and identity for UCloud
  27. 23. Documentation
  28. H: Procedures
  29. 24. H: Procedures
  30. 25. H: Introduction
  31. 26. H: Auditing
  32. 27. H: Auditing scenario
  33. 28. H: GitHub actions
  34. 29. H: Deployment
  35. 30. H: 3rd party dependencies (risk assesment)
  36. Glossary
  37. 31. Glossary
  1. Links
  2. Source Code
  3. Releases

Audit

The Integration Module writes an audit record for each logical inference call. The records show who used which model, when, and with what result. The record does not contain the message content.

The records use the same audit pipeline as the RPC calls of the platform. See Auditing for the general mechanism.

Record names

Request nameWhen the platform writes a record
inference.chatA Chat Completions call, or a chat in the playground.
inference.responsesA create call to the Responses API, including a streaming or background call.
inference.responses.deleteA deleted response.
inference.conversationsA conversation call that the platform rejects.
inference.conversations.deleteA deleted conversation.

The responses adapter suppresses the inner chat record, so one create call to the Responses API produces one inference.responses record. A response delete produces one inference.responses.delete record. See Chat Middleware.

Some read-only calls do not create a detailed audit record. The platform still covers them with infrastructure monitoring and logging, such as access logs and metrics. These endpoints are often part of the public API surface. /v1/models is an example, including the single-model route /v1/models/{name}. A GET request for one conversation is also read-only and does not create a detailed audit record. A background response writes a record when the platform accepts it.

Record fields

The Integration Module writes the record to audit_logs.logs in its database. These records are in the Integration Module database, not in the UCloud/Core database. The table has these fields:

FieldTypeMeaning
request_nametextThe record name from the table above.
received_attimestamptzWhen the Integration Module received the call.
request_sizebigintThe size of the request body.
response_codesmallintThe HTTP status of the call.
response_time_nanosbigintThe duration of the call in nanoseconds.
request_bodyjsonbThe audited request. See Request body.
usernametextThe user that created the token, or the owner of the playground session.
user_agenttextThe user agent of the client.
token_referencetextThe API token ID. Empty for a playground call.
remote_origintextThe client IP address. Empty for a playground call.
project_idtextThe project that owns the call. Empty for a personal call.

The platform does not update a record after it writes it.

Request body

The request_body field holds the audited request. It does not hold the message text.

A chat record has these fields:

FieldMeaning
modelThe model name.
streamtrue when the client requested a stream.
sourceplayground for a playground call. Absent for a public API call.
reasonThe outcome, or the rejection reason.
abortedtrue when the client cancelled the request.
messageCountThe number of messages in the request.
usageThe token usage.
temperatureThe temperature, when the client set it.
top_pThe top-p value, when the client set it.
max_completion_tokensThe completion limit, when the client set it.
reasoning_effortThe reasoning effort, when the client set it.
toolCountThe number of tools in the request.

A Responses record uses these fields when they apply: model, background, stream, source, reason, itemCount, conversation, previous_response_id, and usage.

A conversation delete record has one field:

{
    "conversationId": "conv_..."
}

A response delete record has one field:

{
    "responseId": "resp_..."
}

The reason field is the outcome for a normal call. Examples are success, success_missing_usage, background_submitted, client_cancelled, client_error, admission_rejected, payment_required, upstream_error, stream_timeout, incomplete, and error. For a rejected call, reason is the rejection reason.

Example

{
    "model": "deepseek-v4.1-flash-1017",
    "stream": true,
    "source": "playground",
    "reason": "success",
    "messageCount": 4,
    "usage": {
        "prompt_tokens": 1024,
        "completion_tokens": 256,
        "total_tokens": 1280,
        "prompt_tokens_details": {
            "cached_tokens": 0
        }
    },
    "temperature": 0.8,
    "top_p": 0.1,
    "toolCount": 2
}

Token correlation

The token_reference field holds the ID of the API token. Use it to connect an inference record to the token that the client used. See Provider API Tokens.

The username field is the user that created the token, or the owner of the playground session. For a project token, the record names the creator of the token, not the person who used the secret. Treat the token as the accountable principal and use token_reference to identify it.

A rejected authentication or authorization request has no token identity. Its username and token_reference are empty, and request_body holds only the rejection reason.

A playground call has no API token. Its record has a username and no token_reference. A job token has its own token ID, so a record from a job has a token_reference.

Retention

The audit store partitions audit_logs.logs into seven-day partitions and keeps them for 25 weeks. The Integration Module configuration does not expose a setting for this window.

See Auditing scenario for how to query the general audit records.

Query examples

Run these queries on the Integration Module database. Add a received_at condition to use the partitions.

The following query returns the inference records of the last seven days:

select
    received_at,
    request_name,
    username,
    project_id,
    token_reference,
    response_code,
    request_body->>'model' as model,
    request_body->>'reason' as outcome,
    request_body->'usage' as usage
from
    audit_logs.logs
where
    request_name like 'inference.%'
    and received_at >= now() - interval '7 days'
order by received_at desc
limit 100;

The following query returns the records of one API token in the last seven days:

select
    received_at,
    request_name,
    username,
    project_id,
    response_code,
    request_body->>'model' as model,
    request_body->>'reason' as outcome
from
    audit_logs.logs
where
    token_reference = '<token-id>'
    and request_name like 'inference.%'
    and received_at >= now() - interval '7 days'
order by received_at desc
limit 100;

The following query counts the outcomes of the chat requests of one day:

select
    request_body->>'reason' as outcome,
    count(*) as requests
from
    audit_logs.logs
where
    request_name = 'inference.chat'
    and received_at >= now() - interval '1 day'
group by 1
order by 2 desc;

Metrics

The Integration Module also exports Prometheus metrics for usage and latency. See Metrics.

Previous Usage and Accounting
Next Metrics