Gateway Mode

Audit LLM call after completion

Gateway Mode Step 2: Call this endpoint after your LLM API call completes.

Records:

  • Token usage for billing and quotas
  • Latency metrics
  • Provider and model information
  • Estimated cost

Requires a valid context_id from pre-check (not expired).

post/api/audit/llm-call

Request

Headers

Authorizationstring required
Example:Basic bXktb3JnOkFYT04tVjIteHh4

OAuth2-style Basic authentication header. Format: Basic base64(clientId:clientSecret)

  • clientId: Your organization identifier (required)
  • clientSecret: Authentication credential (optional for community mode)

Not required when DEPLOYMENT_MODE=community.

Request body

context_idstring required

Context ID from pre-check

client_idstring required

Client application ID

response_summarystring

Brief summary of LLM response (for audit)

provider'openai' | 'azure-openai' | 'anthropic' | 'bedrock' | 'ollama' | 'gemini' required

LLM provider name

modelstring required

Model identifier

latency_msinteger

LLM call latency in milliseconds

metadataobject

Additional metadata for audit

Example request

{
  "model": "gpt-4"
}

Response

Audit recorded

successboolean
audit_idstring

Unique audit record ID

Changes

No recorded changes to this operation across all 1 revision of this API.